UINT64 Signature;\r
UINT16 Revision;\r
UINT16 NumberPrmHandlers;\r
+ GUID PlatformGuid;\r
GUID ModuleGuid;\r
} PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT_HEADER;\r
\r
PRM_MODULE_EXPORT_DESCRIPTOR_SIGNATURE, \\r
PRM_MODULE_EXPORT_REVISION, \\r
VA_ARG_COUNT(__VA_ARGS__), \\r
+ EDKII_DSC_PLATFORM_GUID, \\r
EFI_CALLER_ID_GUID \\r
}, \\r
{ __VA_ARGS__ } \\r
OUT PRM_ACPI_DESCRIPTION_TABLE **PrmAcpiDescriptionTable\r
)\r
{\r
- EFI_GUID *PlatformGuid;\r
EFI_IMAGE_EXPORT_DIRECTORY *CurrentImageExportDirectory;\r
PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT *CurrentExportDescriptorStruct;\r
PRM_ACPI_DESCRIPTION_TABLE *PrmAcpiTable;\r
}\r
*PrmAcpiDescriptionTable = NULL;\r
\r
- PlatformGuid = (EFI_GUID *) PcdGetPtr (PcdPrmPlatformGuid);\r
//\r
- // The platform should set PcdPrmPlatformGuid to a non-zero value\r
+ // The platform DSC GUID must be set to a non-zero value\r
//\r
- if (CompareGuid (PlatformGuid, &gZeroGuid)) {\r
+ if (CompareGuid (&gEdkiiDscPlatformGuid, &gZeroGuid)) {\r
DEBUG ((\r
DEBUG_ERROR,\r
- " %a %a: PcdPrmPlatformGuid must be set to a unique value in the platform DSC file.\n",\r
+ " %a %a: The Platform GUID in the DSC file must be set to a unique non-zero value.\n",\r
_DBGMSGID_,\r
__FUNCTION__\r
));\r
- ASSERT (!CompareGuid (PlatformGuid, &gZeroGuid));\r
+ ASSERT (!CompareGuid (&gEdkiiDscPlatformGuid, &gZeroGuid));\r
}\r
\r
DEBUG ((DEBUG_INFO, " %a %a: %d total PRM modules to process.\n", _DBGMSGID_, __FUNCTION__, mPrmModuleCount));\r
PrmAcpiTable->Header.OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision);\r
PrmAcpiTable->Header.CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId);\r
PrmAcpiTable->Header.CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision);\r
- CopyGuid (&PrmAcpiTable->PrmPlatformGuid, PlatformGuid);\r
+ CopyGuid (&PrmAcpiTable->PrmPlatformGuid, &gEdkiiDscPlatformGuid);\r
PrmAcpiTable->PrmModuleInfoOffset = OFFSET_OF (PRM_ACPI_DESCRIPTION_TABLE, PrmModuleInfoStructure);\r
PrmAcpiTable->PrmModuleInfoCount = (UINT32) mPrmModuleCount;\r
\r
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision ## CONSUMES\r
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId ## CONSUMES\r
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision ## CONSUMES\r
- gPrmPkgTokenSpaceGuid.PcdPrmPlatformGuid ## CONSUMES\r
\r
[Protocols]\r
gEfiAcpiTableProtocolGuid\r
# report PRM handler execution time in the application. If such a TimerLib\r
# instance is not available, set this PCD to FALSE in the package DSC file.\r
gPrmPkgTokenSpaceGuid.PcdPrmInfoPrintHandlerExecutionTime|TRUE|BOOLEAN|0x00000003\r
-\r
- ## PRM Platform GUID\r
- #\r
- # Uniquely identifies a specific platform targeted for PRM module updates. Each\r
- # platform MUST provide a new GUID. This GUID is checked against the platform\r
- # GUID in the PRM module export descriptor during PRM runtime updates to determine\r
- # if a given PRM module update is valid for a given system. Even if PRM runtime\r
- # updates are not planned for a given platform, this value should still be given\r
- # a unique value in the platform DSC.\r
- gPrmPkgTokenSpaceGuid.PcdPrmPlatformGuid|{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}|VOID*|0x00000004\r
formal design and is not validated at product quality. The development of this feature is shared in the edk2-staging\r
branch to simplify collaboration by allowing direct code contributions and early feedback throughout its development.\r
\r
+> **Use recent edk2/master** - This code makes use of a very recent change in edk2 BaseTools. Specifically, commit\r
+[b65afdd](https://github.com/tianocore/edk2/commit/b65afdde74d6c1fac1cdbd2efdad23ba26295808). Ensure you have that\r
+change to build the code in this repo as-is.\r
+\r
> By default, the build makes use of a new ACPI OperationRegion type specifically introduced for PRM called\r
`PlatformRtMechanism`. Support for this OperationRegion is planned for the next release of the ACPI specification.\r
However, support for `PlatformRtMechanism` is already included in the iASL Compiler/Disassembler for early prototyping\r
### PRM Platform GUID\r
**IMPORTANT**\r
\r
-A configuration item that requires user attention is the PRM platform GUID. Each platform that uses PRM must be\r
-uniquely identifiable so that various instances of a PRM module can target the correct platform in PRM module updates.\r
+PRM has a concept of a "Platform GUID" which associates a specific platform with a set of PRM modules built for\r
+that platform. This GUID is used to ensure system compatibility for a given collection of PRM modules.\r
+\r
+Therefore, each PRM module must only target a single platform and each platform must have a unique GUID. Even if a\r
+PRM module is unchanged between two different platforms now, there is no guarantee that will remain the case so always\r
+assign a unique Platform GUID for each platform.\r
\r
-To apply a unique platform GUID set the following PCD to a unique value in your platform DSC file.\r
- ``gPrmPkgTokenSpaceGuid.PcdPrmPlatformGuid``\r
+The PRM Platform GUID is primarily used during PRM module runtime updates in the OS to ensure that the Platform GUID\r
+in the system's ACPI table (PRMT) matches the Platform GUID of the module requested for update. Even if runtime\r
+updates are not a planned feature for a given platform, still assign a unique Platform GUID for binary module\r
+identification (the Platform GUID is in the module's export descriptor) and to ensure such updates can be seamlessly\r
+supported in the future if needed.\r
\r
-The default value assigned in [PrmPkg.dec](PrmPkg/PrmPkg.dec) is zero. By design, this is an invalid value that will\r
-cause an ASSERT if it is not updated.\r
+In the `PrmPkg` implementation, the Platform GUID is automatically derived from the PLATFORM_GUID in the DSC file of\r
+the package being built.\r
\r
## Overview\r
At a high-level, PRM can be viewed from three levels of granularity:\r