The [Arch] refers to the Processor Architecture.

The [Module] refer to the EDK2 module.

The [X86] refers to both IA32 and X64.

The principles to create the X86 folder in the module:

  1. When X86-vendor’s implementation is introduced to the existing module:
  1. The folder reconstruction:

A-1. If the module is obviously used by IA32/X64 only

A-2. If the existing module is expected to accommodate the different archs or the module already has multiple archs:

[Ray] Looks good.

 

  1. The files reconstruction:

B-1. The module INF metafile

[Ray]  “CpuDxe.inf” and “CpuDxeArm.inf”? is that your intention? New developers may be confused that CpuDxe.inf supports only X86 arch.

Do you have an example that one module supporting multiple archs using different INF files? MdeModulePkg/DxeIpl is a module supporting different archs with the same INF file.

Or shall we leave it to be decided between the patch contributor and package/module maintainer?

 

                     B-2. Source files

                              The new arch implementation is introduced to the module in order to leverage the source code and the module design architecture, so

<OriginalFileName ><arch>.*

< OriginalFileNaming >Common.*

[Ray] If you check the MpInitLib, most of SEV logic are moved to AmdSev.c. But MpLib.c still contains logic to call functions from AmdSev.c based on some AMD specific check. In my opinion, that’s already good enough.

However, if you check MdeModulePkg/DxeIpl, implementations for different archs are in different *folders*.

Can we leave this to the module owner to decide how to place the implementations?

 

 

  1. When a new arch’s implementation is introduced to the existing module which was developed for the specific arch:
  1. The folder reconstruction:

[Ray] Do you move existing arch implementation to that arch folder? It will break existing platforms a lot.

[Ray] I agree. But if we don’t create arch folder for existing arch implementation, the pkg layout will be a mess.

 

[Ray] Hard for me to understand all the principles here. Maybe we review existing code including to-be-upstreamed code and decide how to go.

 

  1. The files reconstruction:

B-1. The module INF metafile

 

B-2. Source files

                             The new arch implementation is introduced to this module in order to leverage the source code and the module design architecture, so

< OriginalFileNaming ><arch>.*

<OriginalFileNaming>Common.*

 

  1. When a new arch implementation has a huge delta with the original implementation

Create a separate module instance. The naming of the module should follow below format,

< OriginalModuleNaming><arch>