From nobody Thu May 16 05:49:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+94466+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1664376314809777.143414272308; Wed, 28 Sep 2022 07:45:14 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id bePDYY1788612xbZW7AKJ6o8; Wed, 28 Sep 2022 07:45:14 -0700 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.59]) by mx.groups.io with SMTP id smtpd.web08.8867.1664376313087624103 for ; Wed, 28 Sep 2022 07:45:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bWiUsOdY+/ZQsiFTUH4JHwxscPaYV/FRvEtAelXksWRUS3l3lAF5+iXuIw4wiT0h02ffXPD+cslJezOqI1Mc9sm2Nu+ZjA4kveruojaEgLVgguSG5MvdsJ+erMoSzYgvQpHTD2bwGjjvHRessoivU0myXWr1dXCZfuz2y/M+nVNUaG77U7UZ3/k5yWW2OgXYl5wskox4SJ3r/wj9Pzwuls7iw8u0gHUK3cKWYoKDFXBikjzaQOHcw+VSeTKKKxcxhLFbk9VEbnNtahp64QMV5Mjb2y7WGzkR2tlcz0MU+abwJIl0lwa4VNiJ7sqcEAYN53zoU7xlHEMdejKvQU1CxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lm3xrOLtT6gqaKl8LLIjpsjFhqdO1dG/mAjgtQA3TLU=; b=Ga4pDRQ0FrHYNSANPluS8O+gA9t7Y9rIvBJZwAV66T6+T+CVw7Gjl1nLVGIkXQJ5x4IbZJvSTNDlQSAfoC9Wb0h1VpFaa53Fw8SK/K8++cniDe5uG2zeJq4YTcm0U4SZp192jPGekBjqOE4hlPBojmGUOB+GQHuwqdrxYapl2PwY0JJxijm32JL1pKL/2icnzYEYtkgYYQvxVbl1xRZah+So+doCY497j/kb4wn/KjSkVvrbhTO9BBJ8mP6e4+rTerVl/rJ8RbUTH2+vTU3RQYN8pmU1n5JzcoRa73YzMsBmAJeot0egnQeJc9/RuFkLD+DYTLdPwf9olBv/KPObhQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none X-Received: from MW4P223CA0002.NAMP223.PROD.OUTLOOK.COM (2603:10b6:303:80::7) by DM4PR12MB5889.namprd12.prod.outlook.com (2603:10b6:8:65::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.20; Wed, 28 Sep 2022 14:45:10 +0000 X-Received: from CO1NAM11FT084.eop-nam11.prod.protection.outlook.com (2603:10b6:303:80:cafe::20) by MW4P223CA0002.outlook.office365.com (2603:10b6:303:80::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17 via Frontend Transport; Wed, 28 Sep 2022 14:45:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+94466+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT084.mail.protection.outlook.com (10.13.174.194) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5676.17 via Frontend Transport; Wed, 28 Sep 2022 14:45:09 +0000 X-Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Wed, 28 Sep 2022 09:45:07 -0500 From: "Chang, Abner via groups.io" To: CC: Ray Ni , Michael D Kinney , Sunil V L , Abdul Lateef Attar Subject: [edk2-devel] [tianocore-docs][PATCH] edk II C Coding Standard: File and directory naming guidelines Date: Wed, 28 Sep 2022 22:44:49 +0800 Message-ID: <20220928144449.389-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT084:EE_|DM4PR12MB5889:EE_ X-MS-Office365-Filtering-Correlation-Id: 7775f9c6-5dbf-403a-b85c-08daa1600b17 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: qkZVbwzV+z3TpfBYb64y6qbGsZVKc/QN5ReQu0ZNthLFkys76e/vpyH/Q9LX3UiK4tiGjEx4tkcYvMkIJd1ODgLZmvNZyNAuZQnVemLRAIdsNm/OhusCAeXWD32Da8IM84Vxg5LNQDl6vZxyQYqI9DKUWwE2U8wDuvLqzaJW2aTD5WhBcQaG+mmUrbRZmV9ZnenmXn80wpSeHGvEiG86NvZr9+XBV0ywfIj7waTv+7ZdWg/WselqQylFDBN/6EvyQo7O1j7WwAZMEYQFWj9zVhkEVt5Qn09UjZhTmFZsFlb5fRjtSCHZa5dk2hqMTj7RuutBHiMPKa3XICCkOnyJl89hRO5MEbNAIZLWZZSAPDgiHf6HHhW+QcDxHLIe6Z414MzYl18tgL+pIMnXOBQbRfVBXWyoNmSv5pkBmWnNv5/Fs+g0JqNMyjfsgO2g5sHsdd/1D3MQHWsJIjXtiY4TAAYcUQoKTk29jMtdAsGRxQZMWnxbazGAAY2d8j/AJLgGi9hoDg/Agy7VQTesbegqtVqs7g0nPHOohdZ4f1R6Qasf3wIXwkw9KS7PxQXNAdhVs5UUXwNVt7muG3fjPGjoZM3VJVpQwLrqKU6rKojt1n6E1ovn3h5t8BVyhKl7er+0LULERLnLnJazhnKgeURuXHeCMyc4Mrm7LPlzmOwDmNhriJj44FoHOMB1XES9ALZnS7IXbNsaZyBaeXJfGT50LddqQ341oLFO18DzbZK/VXyYrgR/1NmpB+OYO3DQ83H0UKe7tiSuankBl3DpQTbfcDtfvJmXnDUsQpuP6dVhTOORkoa6xG3NZiCIBAZO4+WHnjKRotr1UqXWnyIWTLfZI8uXN567oW0HrqJsUbzA6cQ= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2022 14:45:09.9507 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7775f9c6-5dbf-403a-b85c-08daa1600b17 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT084.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5889 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@amd.com X-Gm-Message-State: iotJVhho44hDLUzfhOsVAugox1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1664376314; bh=RqGcPNepihFr6ZGQ1ZP6v+NHDn/EJPq0+fEY14R4Ur0=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=JRf6p8pYwnL/Yg8NXUSRAPDLwVmRe0lu8YBkrEjz4dHtr2MOaPu+xBsNE7884R0kR0h V0zd70Ub3ohdP19LRV3iEEqdKMdrS19SikYaWszp4Y/x4e+yPpy9Gbc++OtlI4eEe4bGQ TjkU06ryRa/qVKPE3y2gTWkoW2OfbiGytfk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1664376316254100001 Content-Type: text/plain; charset="utf-8" From: Abner Chang Add file and directory naming guidelines for EDKII modules. Also consider the processor architecture and vendor implementation. This is the draft version to community for the wide discussion. PR https://github.com/tianocore-docs/edk2-CCodingStandardsSpecification/pull/2 Signed-off-by: Abner Chang Cc: Ray Ni Cc: Michael D Kinney Cc: Sunil V L Cc: Abdul Lateef Attar --- 4_naming_conventions/42_file_names.md | 124 +++++++++++++++++++++ 4_naming_conventions/46_directory_names.md | 114 +++++++++++++++++++ 2 files changed, 238 insertions(+) create mode 100644 4_naming_conventions/46_directory_names.md diff --git a/4_naming_conventions/42_file_names.md b/4_naming_conventions/4= 2_file_names.md index f948763..e7c10b5 100644 --- a/4_naming_conventions/42_file_names.md +++ b/4_naming_conventions/42_file_names.md @@ -58,3 +58,127 @@ regular expression: =20 That is, a letter followed by zero, or more, letters, underscores, dashes,= or digits followed by a period followed by one or more letters or digits. + +### 4.2.5 File naming guidelines for modules + +Below sections are the file naming guidelines for EDK II meta files and so= urce files. + +#### 4.2.5.1 EDK II meta files within a package + +``` +Pkg.dec +Pkg.dsc + + REQUIRED * +``` + +#### 4.2.5.2 EDK II INF file within a Module instance +* If the implementation supports >=3D2 or all CPU archs: +``` +.inf + + REQUIRED * + REQUIRED Base, Sec, Pei, Dxe, DxeRuntime, Mm, Standal= oneMm, + Smm, Uefi. + +Example: + CpuIo2Dxe.inf +``` + +* If the implementation of CPU arch or vendor shares some code in the modu= le. Or the implementation is only for the specific CPU arch or vendor. +``` +.inf + + REQUIRED * + REQUIRED Base, Sec, Pei, Dxe, DxeRuntime, Mm, + StandaloneMm, Smm, Uefi. + OPTIONAL Ia32, X64, Arm, AArch64, RiscV64, LoongArch6= 4, Ebc, X86 + (X86 implies Ia32 and X64). + OPTIONAL * + +Example: + CpuIo2DxeAmd.inf +``` + +If the implementation does not have any shared code between phases. The mo= dule INF is located under \/\ or \/// (see section 4.6 Directory Names). + +* If the implementation supports >=3D2 or all CPU archs: +``` +//.inf + + OPTIONAL * + REQUIRED Base, Sec, Pei, Dxe, DxeRuntime, Mm, Standal= oneMm, Smm, + Uefi. + REQUIRED Same as + +Example: + PCD/Dxe/Pcd.inf +``` + +* If the implementation of CPU arch or vendor shares some code in the modu= le. Or the implementation is only for the specific CPU arch or vendor. +``` +//.inf + + OPTIONAL * + REQUIRED Base, Sec, Pei, Dxe, DxeRuntime, Mm, Standal= oneMm, Smm, + Uefi. + OPTIONAL Ia32, X64, Arm, AArch64, RiscV64, LoongArch6= 4, Ebc, X86 + (X86 implies Ia32 and X64). + OPTIONAL * + REQUIRED Same as + +``` +#### 4.2.5.3 EDK II INF file within a Library instance +``` +.inf + REQUIRED Base, Sec, Pei, Dxe, DxeRuntime, Mm, + StandaloneMm, Smm, Uefi. + OPTIONAL Ia32, X64, Arm, AArch64, RiscV64, Loo= ngArch64, + Ebc, X86 (X86 implies Ia32 and X64). + OPTIONAL * + REQUIRED * + OPTIONAL * (Typically name of PPI, Protocol, L= ibraryClass + that the implementation is layered = on top of) + +Example: + SmmAmdSmmCpuFeaturesLib.inf + SmmIntelSmmCpuFeaturesLib.inf +``` + +#### 4.2.5.4 EDK II source files within a Library/Module instance + +``` +.c +.h +.c +.h +/.c +/.h +/.nasm +/.S +//.c +//.h +//.nasm +//.S + + OPTIONAL Ia32, X64, Arm, AArch64, RiscV64, LoongArch64, Ebc= , X86 + (X86 implies Ia32 and X64). + OPTIONAL * + +Example: + IA32/SmiException.nasm + X64/SmiException.nasm + SmmCpuFeatureLib.c + SmmCpuFeatureLibCommon.c + IntelSmmCpuFeaturesLib.c + AmdSmmCpuFeaturesLib.c + + Or, + X86/IA32/SmiException.nasm + X86/X64/SmiException.nasm + X86/IntelSmmCpuFeaturesLib.c + X86/AmdSmmCpuFeaturesLib.c + RiscV64/JustAnExampleLib.c + SmmCpuFeatureLib.c + SmmCpuFeatureLibCommon.c +``` diff --git a/4_naming_conventions/46_directory_names.md b/4_naming_conventi= ons/46_directory_names.md new file mode 100644 index 0000000..e4df796 --- /dev/null +++ b/4_naming_conventions/46_directory_names.md @@ -0,0 +1,114 @@ + + +## 4.6 Directory Names +Below sections are the directory naming guidelines for EDK II modules + +#### 4.6.1 EDKII package directory + +``` +Pkg + + REQUIRED * +``` + +#### 4.6.2 EDKII Module directory + +* If the implementation supports >=3D2 or all CPU archs: +``` + + + REQUIRED Base, Sec, Pei, Dxe, DxeRuntime, Mm, Standal= oneMm, Smm, + Uefi. + REQUIRED * + +Example: + CpuDxe/ +``` + +* If the implementation is for the specific CPU arch or vendor: +``` + + + REQUIRED *=20 + REQUIRED Base, Sec, Pei, Dxe, DxeRuntime, Mm, + StandaloneMm, Smm, Uefi. + OPTIONAL Ia32, X64, Arm, AArch64, RiscV64, LoongArch6= 4, Ebc, X86 + (X86 implies Ia32 and X64). + OPTIONAL * + +Example: + CpuDxeRiscv64/ +``` + +* If the implementation does not have any shared code between phases (e.g. +MdeModulePkg/Universal/PCD) and supports >=3D2 or all CPU archs: + +``` +/ + + OPTIONAL * + REQUIRED Base, Sec, Pei, Dxe, DxeRuntime, Mm, Standal= oneMm, Smm, + Uefi. + +Example: + Pcd/Dxe/ +``` + +* If the implementation does not have any shared code between phases (e.g. +MdeModulePkg/Universal/PCD) and is for the specifc CPU arch or vendor: +``` +/// + + OPTIONAL * + REQUIRED Base, Sec, Pei, Dxe, DxeRuntime, Mm, Standal= oneMm, Smm, + Uefi. + OPTIONAL Ia32, X64, Arm, AArch64, RiscV64, LoongArch6= 4, Ebc, X86 + (X86 implies Ia32 and X64). + OPTIONAL * +``` + +#### 4.6.2 EDKII Library directory +``` + + + REQUIRED Base, Sec, Pei, Dxe, DxeRuntime, Mm, + StandaloneMm, Smm, Uefi. + OPTIONAL Ia32, X64, Arm, AArch64, RiscV64, Loo= ngArch64, + Ebc, X86 (X86 implies Ia32 and X64). + OPTIONAL * + REQUIRED * + OPTIONAL * (Typically name of PPI, Protocol, L= ibraryClass + that the implementation is layered = on top of). + +Example: + SmmAmdSmmCpuFeaturesLib/ +``` --=20 2.37.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#94466): https://edk2.groups.io/g/devel/message/94466 Mute This Topic: https://groups.io/mt/93974077/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-