\r
typedef struct {\r
EFI_ACPI_DESCRIPTION_HEADER Header; ///< Standard ACPI description header\r
+ GUID PrmPlatformGuid; ///< A GUID that uniquely identifies this platform.\r
+ ///< Used to check for compatibility in PRM module\r
+ ///< runtime updates.\r
UINT32 PrmModuleInfoOffset; ///< Offset in bytes from the beginning of this\r
///< structure to the PRM Module Info array\r
UINT32 PrmModuleInfoCount; ///< Number of entries in the PRM Module Info array\r
\r
#include "PrmAcpiTable.h"\r
\r
+#include <Guid/ZeroGuid.h>\r
#include <IndustryStandard/Acpi.h>\r
#include <Library/BaseLib.h>\r
#include <Library/BaseMemoryLib.h>\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
+ //\r
+ if (CompareGuid (PlatformGuid, &gZeroGuid)) {\r
+ DEBUG ((\r
+ DEBUG_ERROR,\r
+ " %a %a: PcdPrmPlatformGuid must be set to a unique value in the platform DSC file.\n",\r
+ _DBGMSGID_,\r
+ __FUNCTION__\r
+ ));\r
+ ASSERT (!CompareGuid (PlatformGuid, &gZeroGuid));\r
+ }\r
+\r
DEBUG ((DEBUG_INFO, " %a %a: %d total PRM modules to process.\n", _DBGMSGID_, __FUNCTION__, mPrmModuleCount));\r
DEBUG ((DEBUG_INFO, " %a %a: %d total PRM handlers to process.\n", _DBGMSGID_, __FUNCTION__, mPrmHandlerCount));\r
\r
PrmAcpiTable->Header.OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision);\r
PrmAcpiTable->Header.CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId);\r
PrmAcpiTable->Header.CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision);\r
+ CopyGuid (&PrmAcpiTable->PrmPlatformGuid, PlatformGuid);\r
PrmAcpiTable->PrmModuleInfoOffset = OFFSET_OF (PRM_ACPI_DESCRIPTION_TABLE, PrmModuleInfoStructure);\r
PrmAcpiTable->PrmModuleInfoCount = (UINT32) mPrmModuleCount;\r
\r
\r
[Guids]\r
gEfiEndOfDxeEventGroupGuid\r
+ gZeroGuid\r
\r
[LibraryClasses]\r
BaseLib\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
This structure is passed as the context buffer to PRM handlers. The structure actually passed to PRM handlers is\r
allocated and populated by the OS where it gets all the information to populate the context buffer from other structures.\r
\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
+\r
+To apply a unique platform GUID set the following PCD to a unique value in your platform DSC file.\r
+ ``gPrmPkgTokenSpaceGuid.PcdPrmPlatformGuid``\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
+\r
## Overview\r
At a high-level, PRM can be viewed from three levels of granularity:\r
\r