From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (NAM04-MW2-obe.outbound.protection.outlook.com [40.107.101.53]) by mx.groups.io with SMTP id smtpd.web12.18615.1665834525511766430 for ; Sat, 15 Oct 2022 04:48:46 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=0bvAUmK+; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.101.53, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aIfwCfDku9K1Ndhshpo1NVemPPom9Ci5bngRvIlZO+yPdhtkxDI042BQjqYtIYNrsocBg0sFUNDWiUwp0jbPl08xGXJK0y1/QFWfYhG9R+c7f9a3Rr7buYsEz6nd2uhceAZ5YjV2b605P+MSBZmTq/8EBa4LnwAFVqBePYHxYnUtiT0TRsW/Dcf8jr3viWrdtkQkyPlzumT/0xKruK0Pha2S1H+EX2azARxJYq6zT/54yPQd/P0HhlmibKzR4VbF7nCD7f5vE+IGo+7vsETde2zO6ZSFOoYtftkVnGFMYvnEmzqgtS9rCiiD1lRm67Jw7uYWskLgn4i/G5ijdMcKAg== 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=O6X2t9bhKQJdAWjfm91gAcAfgrEbsKy9ZCSOpyFHdLg=; b=X2e9CrWqtYjYkv48i4rZCSPqDNJSSEaoHGnXYZxMouC1g+GaUREU33BkEPvY4roDS4T2Cdiqo/+NnJYYQ5zpRv6Pg85ziLqT30rgrw0sy87Ngg+wrBTBGnx6/v6Gk9DTS9sAvh1GcdF0ZY3/2jetCnqBCeBKnC92eSnh5fIxoohD0evx6fYkSFCd4fhojb0q4uEgZwmFUKUVIxrgTTEMKY47xINcgLOEb4aphgj5C/SgjfpgdY7T05SsSYEshlizgtpx5gIwpRL3srU10ExclKvRflu+hNnaf5c4yS4h6hknZRFa5y4l7U4/dgAoVYyL8Eiy+SBOdK2Q8mSLKWk0yw== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O6X2t9bhKQJdAWjfm91gAcAfgrEbsKy9ZCSOpyFHdLg=; b=0bvAUmK+kkG7nE63yFgReb2DoBHn/IP3RLR1TZXURWmfPS6ZUFlja856Let2Pb8Ybnv0wlMIQ2fZC5Nhmyd+CDqOh9j9e2suFvVOHUehuz01V5WwtWTcw3QvTqcb1s2v8LGXEhm40tEJ3b6I1Bx2UumS8k99XEf7tuzQvBEPPMk= Received: from MW4PR03CA0153.namprd03.prod.outlook.com (2603:10b6:303:8d::8) by IA1PR12MB7496.namprd12.prod.outlook.com (2603:10b6:208:418::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.21; Sat, 15 Oct 2022 11:48:43 +0000 Received: from CO1NAM11FT022.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8d:cafe::58) by MW4PR03CA0153.outlook.office365.com (2603:10b6:303:8d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.30 via Frontend Transport; Sat, 15 Oct 2022 11:48:42 +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 (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 Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT022.mail.protection.outlook.com (10.13.175.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5723.20 via Frontend Transport; Sat, 15 Oct 2022 11:48:42 +0000 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; Sat, 15 Oct 2022 06:48:38 -0500 From: "Chang, Abner" To: CC: Ray Ni , Michael D Kinney , Sunil V L , Abdul Lateef Attar , Leif Lindholm Subject: [tianocore-docs][PATCH V2 2/2] edk II C Coding Standard: Updates 4.2 and 4.3 sections Date: Sat, 15 Oct 2022 19:47:57 +0800 Message-ID: <20221015114757.383-1-abner.chang@amd.com> X-Mailer: git-send-email 2.37.1.windows.1 MIME-Version: 1.0 Return-Path: Abner.Chang@amd.com 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: CO1NAM11FT022:EE_|IA1PR12MB7496:EE_ X-MS-Office365-Filtering-Correlation-Id: 1ecf4a6d-18c6-40c4-430b-08daaea33547 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aBM9FjZ1ZEmsQJP2YBXaQo2GbNxoTg6IAW6K9jPZSdue6P9boW4WOmrvHjaE2rVX4rLLaEd40j6mcsGXwT8kgibvDi+zHMUMQanm13gsZLVZjX5VrFQ65yJ6OgO+Gc5pGRzzUPAt9hTyo7/qnnl0CL1kud1jyIL94BC5+sAyOkMI6h0eHaHNm6ercAJIUIoLu/Dmur69cufzcJTwf+XXcgzKYmYfK8t8W4c3dPszVOXrV2nqc1K47E7XA9QdAQwMv/uB6Mz78rO3YyZ0Po9qtLKWLqRjin4zZUrS3gJK8nNUI2sXZp+XGXo7gIPcIuQvSNMo5im7XbQdvjy5af96fmez87/53+CLQ5AzOegLwQ0FdmlyUENyvVNP5Kfj4UQEti/8zmviq8PNGGLneKCgQ0U55SaSq+2MiS1tiNx96UhX8wwgF57j7IhpY9IkcJ0WjPzHCgY/Ri7jkivnEaez3wKzdqe8aQHJy9f4RrHBDHmyuSG83+JhYEyBIeETiHuWihY39Q61H2J3Z9TSfMe4Q2pmfkTvqM8G2XGkc81DpIJ0ZvJz3L8tQ5VXTn7RC5nnIFwTax3zp+FVqoP79uThIWFxs6HvYTp3qSufiRWSnydDcs9n90p+s7lV8rFrgdPIKNw9T34zgmYb2NXiQqC2TwwrtAWby7XQmxJAMSK4d9aePhqZN/NowNSW0+92kEahYUaDEyFC8nKgM+R/yEGbv6S7DzAkhEee84XaLAiv8wi6/BUUWZDIoiwuN5JodonXHnjAcDT5V3A2xklTOwDE6WYZkvEfI0cvwheW94Kr+0quV71tqqRxd0LxPq0Q1Vx9NC6HBfhPQ83CHs8jtCkIdB2oKrT0lEWkPAubHERvStE= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(136003)(346002)(39860400002)(396003)(376002)(451199015)(46966006)(40470700004)(36840700001)(356005)(70586007)(70206006)(6916009)(54906003)(316002)(16526019)(86362001)(19627235002)(8676002)(26005)(7696005)(40480700001)(41300700001)(4326008)(47076005)(478600001)(966005)(40460700003)(36756003)(6666004)(1076003)(15650500001)(8936002)(36860700001)(82310400005)(2876002)(426003)(186003)(81166007)(336012)(2906002)(83380400001)(2616005)(82740400003)(5660300002)(36900700001)(19607625013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2022 11:48:42.1549 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1ecf4a6d-18c6-40c4-430b-08daaea33547 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: CO1NAM11FT022.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7496 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Abner Chang Updates 4.2 Directory names and 4.3 file names for the guidelines of module directory and file naming. PR: https://github.com/tianocore-docs/edk2-CCodingStandardsSpecification/pu= ll/2/files Signed-off-by: Abner Chang Cc: Ray Ni Cc: Michael D Kinney Cc: Sunil V L Cc: Abdul Lateef Attar Cc: Leif Lindholm --- 4_naming_conventions/42_directory_names.md | 101 +++++++++++++++++++ 4_naming_conventions/43_file_names.md | 108 ++++++++++++++++++++- 2 files changed, 208 insertions(+), 1 deletion(-) diff --git a/4_naming_conventions/42_directory_names.md b/4_naming_conventi= ons/42_directory_names.md index 766ccb1..959a3c9 100644 --- a/4_naming_conventions/42_directory_names.md +++ b/4_naming_conventions/42_directory_names.md @@ -2,6 +2,7 @@ 4.2 Directory Names =20 Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.
+ Copyright (c) 2022, Intel Corporation. All rights reserved.
=20 Redistribution and use in source (original document form) and 'compiled' forms (converted to PDF, epub, HTML and other formats) with or without @@ -28,3 +29,103 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. =20 --> + +## 4.2 Directory Names +Below sections are the directory naming guidelines for EDK II modules. The= guidelines are not +just considering the the uniformity of directory naming, but it also provi= des the flexibility of +directory name construction for the scenario of different EDK II module de= signs; such as the +support for multiple processor architectures and vendors. It may require t= he further discussions +between EDK II maintainers and contributors in order to determine the best= naming of the EDK II +module directory. + +#### 4.2.1 EDKII package directory + +``` +Pkg + + REQUIRED * +``` + +#### 4.2.2 EDKII Module directory + +* The guideline below is applied to all CPU architectures support, specifi= c CPU architecture and vendors support, or the implementation is shared by = certain CPU archs: +``` +[[]] + or +[/[/]] + + REQUIRED * + REQUIRED Base, Sec, Pei, Dxe, DxeRuntime, Mm, Standal= oneMm, Smm, + Uefi. + OPTIONAL The is represented with a BNF, + ::=3D'Ia32' | 'X64' | 'Arm' | 'AArch6= 4' | 'RiscV64' | + 'LoongArch64' | 'Ebc' =20 + ::=3D []* + =20 + Example: Ia32X64Arm or RiscV64LoongArch64 + =20 + OPTIONAL * + +Example: + - SmbiosDxe/ + - CpuDxe/ # First implementation of CpuDxe. + - CpuDxeIa32X64Amd/ # Ia32 and X64 AMD specific implementation= . + - CpuDxe/RiscV64/ # RiscV64 specific implementation. + / # Common files for the RiscV64 and other a= rchs. + - CpuDxe/Ia32X64/Amd/ # Ia32 and X64 AMD specific implementation= . + / # Common files for Ia32 and X64 archs. + /ArmAArch64/ # Arm and AArch64 implementation of CpuDxe= . + / # Common files for the Arm, AArch64, Ia32 = and X64. +``` + +* If the implementation does not have any shared code between phases (e.g. +MdeModulePkg/Universal/PCD). The guideline below is applied to all CPU arc= hitectures support, specific CPU architecture and vendors support, or the i= mplementation is shared by certain CPU archs: + +``` +/[/[/]] + + REQUIRED * + REQUIRED Base, Sec, Pei, Dxe, DxeRuntime, Mm, Standal= oneMm, Smm, + Uefi. + OPTIONAL The is represented with a BNF, + ::=3D'Ia32' | 'X64' | 'Arm' | 'AArch6= 4' | 'RiscV64' | + 'LoongArch64' | 'Ebc' + ::=3D []* + + Example: Ia32X64Arm or RiscV64LoongArch64 + OPTIONAL * +Example: + Pcd/Dxe/ +``` + +#### 4.2.2 EDKII Library directory +``` +[[]][] + or +[]/[[/]] + + REQUIRED Base, Sec, Pei, Dxe, DxeRuntime, Mm, + StandaloneMm, Smm, Uefi. + OPTIONAL The is represented with a B= NF, + ::=3D'Ia32' | 'X64' | 'Arm' | = 'AArch64' | 'RiscV64' | + 'LoongArch64' | 'Ebc' + ::=3D []* + + Example: Ia32X64Arm or RiscV64LoongAr= ch64 + OPTIONAL * + REQUIRED * + OPTIONAL * (Typically name of PPI, Protocol, L= ibraryClass + that the implementation is layered = on top of). + +Example: + - BaseXApicLib/ + - SmmIa32X64AmdSmmCpuFeaturesLib/ + - SmmArmAArch64SmmCpuFeaturesLib/ + - BaseMpInitLib/RiscV64/ # RiscV64 specific implementation. + /Ia32X64/ # Ia32 and X64 specific implementation. + /Ia32X64/Amd # Ia32 and X64 AMD specific implementat= ion. + /ArmAArch64/ # Arm and AAch64 specific implementatio= n. + /LoongArch64/ # LoongArch64 specific implementation. + / # Common files for RiscV64, Ia32, X64, = Arm, AArch64 and + LoongArch64. +``` diff --git a/4_naming_conventions/43_file_names.md b/4_naming_conventions/4= 3_file_names.md index 13e0c63..5714008 100644 --- a/4_naming_conventions/43_file_names.md +++ b/4_naming_conventions/43_file_names.md @@ -1,7 +1,8 @@