]> git.proxmox.com Git - mirror_edk2.git/commitdiff
PrmPkg/PrmSampleHardwareAccessModule: Add non-print PRM handlers
authorMichael Kubacki <michael.kubacki@microsoft.com>
Wed, 10 Jun 2020 23:28:30 +0000 (16:28 -0700)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 5 Apr 2022 00:42:38 +0000 (00:42 +0000)
For each PRM handler that is currently present, a corresponding PRM
handler is added that does not print. This allows a caller to execute
a sample hardware access PRM handler without requiring that caller to
provide a debug print service.

Cc: Andrew Fish <afish@apple.com>
Cc: Kang Gao <kang.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Liu Yun <yun.y.liu@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
PrmPkg/Samples/PrmSampleHardwareAccessModule/PrmSampleHardwareAccessModule.c

index 87fe9cafc9127ac43c860a33b093e7305de151f2..32e04c5e85923a7df4583532699a20c596bf5d0c 100644 (file)
 // {2120cd3c-848b-4d8f-abbb-4b74ce64ac89}\r
 #define MSR_ACCESS_MICROCODE_SIGNATURE_PRM_HANDLER_GUID {0x2120cd3c, 0x848b, 0x4d8f, {0xab, 0xbb, 0x4b, 0x74, 0xce, 0x64, 0xac, 0x89}}\r
 \r
+// {5d28b4e7-3867-4aee-aa09-51fc282c3b22}\r
+#define MSR_PRINT_MICROCODE_SIGNATURE_PRM_HANDLER_GUID {0x5d28b4e7, 0x3867, 0x4aee, {0xaa, 0x09, 0x51, 0xfc, 0x28, 0x2c, 0x3b, 0x22}}\r
+\r
 // {ea0935a7-506b-4159-bbbb-48deeecb6f58}\r
 #define MSR_ACCESS_MTRR_DUMP_PRM_HANDLER_GUID {0xea0935a7, 0x506b, 0x4159, {0xbb, 0xbb, 0x48, 0xde, 0xee, 0xcb, 0x6f, 0x58}}\r
 \r
+// {4b64b702-4d2b-4dfe-ac5a-0b4110a2ca47}\r
+#define MSR_PRINT_MTRR_DUMP_PRM_HANDLER_GUID {0x4b64b702, 0x4d2b, 0x4dfe, {0xac, 0x5a, 0x0b, 0x41, 0x10, 0xa2, 0xca, 0x47}}\r
+\r
 // {1bd1bda9-909a-4614-9699-25ec0c2783f7}\r
 #define MMIO_ACCESS_HPET_PRM_HANDLER_GUID {0x1bd1bda9, 0x909a, 0x4614, {0x96, 0x99, 0x25, 0xec, 0x0c, 0x27, 0x83, 0xf7}}\r
 \r
+// {8a0efdde-78d0-45f0-aea0-c28245c7e1db}\r
+#define MMIO_PRINT_HPET_PRM_HANDLER_GUID {0x8a0efdde, 0x78d0, 0x45f0, {0xae, 0xa0, 0xc2, 0x82, 0x45, 0xc7, 0xe1, 0xdb}}\r
+\r
 #define HPET_BASE_ADDRESS 0xFED00000\r
 \r
 //\r
@@ -124,13 +133,18 @@ MtrrLibApplyVariableMtrrs (
 //\r
 \r
 /**\r
-  Prints all MTRR values including architectural and variable MTTRs.\r
+  Accesses MTRR values including architectural and variable MTRRs.\r
+\r
+  If the optional OsServiceDebugPrint function pointer is provided that function is\r
+  used to print the MTRR settings.\r
+\r
+  @param[in]  OsServiceDebugPrint   A pointer to an OS-provided debug print function.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
-PrintAllMtrrs (\r
-  IN PRM_OS_SERVICE_DEBUG_PRINT   OsServiceDebugPrint\r
+AccessAllMtrrs (\r
+  IN PRM_OS_SERVICE_DEBUG_PRINT   OsServiceDebugPrint   OPTIONAL\r
   )\r
 {\r
   MTRR_SETTINGS                   LocalMtrrs;\r
@@ -148,7 +162,7 @@ PrintAllMtrrs (
     ];\r
   MTRR_MEMORY_RANGE RawVariableRanges[ARRAY_SIZE (Mtrrs->Variables.Mtrr)];\r
 \r
-  if (OsServiceDebugPrint == NULL || !IsMtrrSupported ()) {\r
+  if (!IsMtrrSupported ()) {\r
     return;\r
   }\r
 \r
@@ -160,56 +174,63 @@ PrintAllMtrrs (
   //\r
   // Dump RAW MTRR contents\r
   //\r
-  OsServiceDebugPrint ("  MTRR Settings:\n");\r
-  OsServiceDebugPrint ("  =============\n");\r
+  if (OsServiceDebugPrint != NULL) {\r
+    OsServiceDebugPrint ("  MTRR Settings:\n");\r
+    OsServiceDebugPrint ("  =============\n");\r
 \r
-  AsciiSPrint (\r
-    &DebugMessage[0],\r
-    ARRAY_SIZE (DebugMessage),\r
-    "  MTRR Default Type: %016lx\n",\r
-    Mtrrs->MtrrDefType\r
-    );\r
-  OsServiceDebugPrint (&DebugMessage[0]);\r
-\r
-  for (Index = 0; Index < MTRR_NUMBER_OF_FIXED_MTRR; Index++) {\r
     AsciiSPrint (\r
       &DebugMessage[0],\r
       ARRAY_SIZE (DebugMessage),\r
-      "  Fixed MTRR[%02d]   : %016lx\n",\r
-      Index,\r
-      Mtrrs->Fixed.Mtrr[Index]\r
+      "  MTRR Default Type: %016lx\n",\r
+      Mtrrs->MtrrDefType\r
       );\r
     OsServiceDebugPrint (&DebugMessage[0]);\r
   }\r
-  ContainVariableMtrr = FALSE;\r
-  for (Index = 0; Index < VariableMtrrCount; Index++) {\r
-    if ((Mtrrs->Variables.Mtrr[Index].Mask & BIT11) == 0) {\r
-      //\r
-      // If mask is not valid, then do not display range\r
-      //\r
-      continue;\r
+\r
+  if (OsServiceDebugPrint != NULL) {\r
+    for (Index = 0; Index < MTRR_NUMBER_OF_FIXED_MTRR; Index++) {\r
+        AsciiSPrint (\r
+          &DebugMessage[0],\r
+          ARRAY_SIZE (DebugMessage),\r
+          "  Fixed MTRR[%02d]   : %016lx\n",\r
+          Index,\r
+          Mtrrs->Fixed.Mtrr[Index]\r
+          );\r
+        OsServiceDebugPrint (&DebugMessage[0]);\r
+      }\r
+\r
+    ContainVariableMtrr = FALSE;\r
+    for (Index = 0; Index < VariableMtrrCount; Index++) {\r
+      if ((Mtrrs->Variables.Mtrr[Index].Mask & BIT11) == 0) {\r
+        //\r
+        // If mask is not valid, then do not display range\r
+        //\r
+        continue;\r
+      }\r
+      ContainVariableMtrr = TRUE;\r
+      AsciiSPrint (\r
+        &DebugMessage[0],\r
+        ARRAY_SIZE (DebugMessage),\r
+        "  Variable MTRR[%02d]: Base=%016lx Mask=%016lx\n",\r
+        Index,\r
+        Mtrrs->Variables.Mtrr[Index].Base,\r
+        Mtrrs->Variables.Mtrr[Index].Mask\r
+        );\r
+      OsServiceDebugPrint (&DebugMessage[0]);\r
     }\r
-    ContainVariableMtrr = TRUE;\r
-    AsciiSPrint (\r
-      &DebugMessage[0],\r
-      ARRAY_SIZE (DebugMessage),\r
-      "  Variable MTRR[%02d]: Base=%016lx Mask=%016lx\n",\r
-      Index,\r
-      Mtrrs->Variables.Mtrr[Index].Base,\r
-      Mtrrs->Variables.Mtrr[Index].Mask\r
-      );\r
-    OsServiceDebugPrint (&DebugMessage[0]);\r
-  }\r
-  if (!ContainVariableMtrr) {\r
-    OsServiceDebugPrint ("  Variable MTRR    : None.\n");\r
+    if (!ContainVariableMtrr) {\r
+      OsServiceDebugPrint ("  Variable MTRR    : None.\n");\r
+    }\r
+    OsServiceDebugPrint ("\n");\r
   }\r
-  OsServiceDebugPrint ("\n");\r
 \r
   //\r
   // Dump MTRR setting in ranges\r
   //\r
-  OsServiceDebugPrint ("  Memory Ranges:\n");\r
-  OsServiceDebugPrint ("  ====================================\n");\r
+  if (OsServiceDebugPrint != NULL) {\r
+    OsServiceDebugPrint ("  Memory Ranges:\n");\r
+    OsServiceDebugPrint ("  ====================================\n");\r
+  }\r
   MtrrLibInitializeMtrrMask (&MtrrValidBitsMask, &MtrrValidAddressMask);\r
   Ranges[0].BaseAddress = 0;\r
   Ranges[0].Length      = MtrrValidBitsMask + 1;\r
@@ -227,15 +248,17 @@ PrintAllMtrrs (
 \r
   MtrrLibApplyFixedMtrrs (&Mtrrs->Fixed, Ranges, ARRAY_SIZE (Ranges), &RangeCount);\r
 \r
-  for (Index = 0; Index < RangeCount; Index++) {\r
-    AsciiSPrint (\r
-      &DebugMessage[0],\r
-      ARRAY_SIZE (DebugMessage),\r
-      "  %a:%016lx-%016lx\n",\r
-      mMtrrMemoryCacheTypeShortName[Ranges[Index].Type],\r
-      Ranges[Index].BaseAddress, Ranges[Index].BaseAddress + Ranges[Index].Length - 1\r
-      );\r
-    OsServiceDebugPrint (&DebugMessage[0]);\r
+  if (OsServiceDebugPrint != NULL) {\r
+    for (Index = 0; Index < RangeCount; Index++) {\r
+      AsciiSPrint (\r
+        &DebugMessage[0],\r
+        ARRAY_SIZE (DebugMessage),\r
+        "  %a:%016lx-%016lx\n",\r
+        mMtrrMemoryCacheTypeShortName[Ranges[Index].Type],\r
+        Ranges[Index].BaseAddress, Ranges[Index].BaseAddress + Ranges[Index].Length - 1\r
+        );\r
+      OsServiceDebugPrint (&DebugMessage[0]);\r
+    }\r
   }\r
 }\r
 \r
@@ -277,12 +300,17 @@ HpetRead (
 }\r
 \r
 /**\r
-  Prints HPET configuration information.\r
+  Accesses HPET configuration information.\r
+\r
+  If the optional OsServiceDebugPrint function pointer is provided that function is\r
+  used to print HPET settings.\r
+\r
+  @param[in]  OsServiceDebugPrint   A pointer to an OS-provided debug print function\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
-PrintHpetConfiguration (\r
+AccessHpetConfiguration (\r
   IN PRM_OS_SERVICE_DEBUG_PRINT           OsServiceDebugPrint\r
   )\r
 {\r
@@ -291,91 +319,108 @@ PrintHpetConfiguration (
   HPET_GENERAL_CONFIGURATION_REGISTER     HpetGeneralConfiguration;\r
   CHAR8                                   DebugMessage[256];\r
 \r
-  if (OsServiceDebugPrint == NULL) {\r
-    return;\r
-  }\r
-\r
   HpetGeneralCapabilities.Uint64  = HpetRead (HPET_GENERAL_CAPABILITIES_ID_OFFSET);\r
   HpetGeneralConfiguration.Uint64 = HpetRead (HPET_GENERAL_CONFIGURATION_OFFSET);\r
 \r
-  AsciiSPrint (\r
-    &DebugMessage[0],\r
-    ARRAY_SIZE (DebugMessage),\r
-    "  HPET Base Address = 0x%08x\n",\r
-    HPET_BASE_ADDRESS\r
-    );\r
-  OsServiceDebugPrint (&DebugMessage[0]);\r
-\r
-  AsciiSPrint (\r
-    &DebugMessage[0],\r
-    ARRAY_SIZE (DebugMessage),\r
-    "  HPET_GENERAL_CAPABILITIES_ID  = 0x%016lx\n",\r
-    HpetGeneralCapabilities\r
-    );\r
-  OsServiceDebugPrint (&DebugMessage[0]);\r
-\r
-  AsciiSPrint (\r
-    &DebugMessage[0],\r
-    ARRAY_SIZE (DebugMessage),\r
-    "  HPET_GENERAL_CONFIGURATION    = 0x%016lx\n",\r
-    HpetGeneralConfiguration.Uint64\r
-    );\r
-  OsServiceDebugPrint (&DebugMessage[0]);\r
-\r
-  AsciiSPrint (\r
-    &DebugMessage[0],\r
-    ARRAY_SIZE (DebugMessage),\r
-    "  HPET_GENERAL_INTERRUPT_STATUS = 0x%016lx\n",\r
-    HpetRead (HPET_GENERAL_INTERRUPT_STATUS_OFFSET)\r
-    );\r
-  OsServiceDebugPrint (&DebugMessage[0]);\r
+  if (OsServiceDebugPrint != NULL) {\r
+    AsciiSPrint (\r
+      &DebugMessage[0],\r
+      ARRAY_SIZE (DebugMessage),\r
+      "  HPET Base Address = 0x%08x\n",\r
+      HPET_BASE_ADDRESS\r
+      );\r
+    OsServiceDebugPrint (&DebugMessage[0]);\r
 \r
-  AsciiSPrint (\r
-    &DebugMessage[0],\r
-    ARRAY_SIZE (DebugMessage),\r
-    "  HPET_MAIN_COUNTER             = 0x%016lx\n",\r
-    HpetRead (HPET_MAIN_COUNTER_OFFSET)\r
-    );\r
-  OsServiceDebugPrint (&DebugMessage[0]);\r
+    AsciiSPrint (\r
+      &DebugMessage[0],\r
+      ARRAY_SIZE (DebugMessage),\r
+      "  HPET_GENERAL_CAPABILITIES_ID  = 0x%016lx\n",\r
+      HpetGeneralCapabilities\r
+      );\r
+    OsServiceDebugPrint (&DebugMessage[0]);\r
 \r
-  AsciiSPrint (\r
-    &DebugMessage[0],\r
-    ARRAY_SIZE (DebugMessage),\r
-    "  HPET Main Counter Period      = %d (fs)\n",\r
-    HpetGeneralCapabilities.Bits.CounterClockPeriod\r
-    );\r
-  OsServiceDebugPrint (&DebugMessage[0]);\r
+    AsciiSPrint (\r
+      &DebugMessage[0],\r
+      ARRAY_SIZE (DebugMessage),\r
+      "  HPET_GENERAL_CONFIGURATION    = 0x%016lx\n",\r
+      HpetGeneralConfiguration.Uint64\r
+      );\r
+    OsServiceDebugPrint (&DebugMessage[0]);\r
 \r
-  for (TimerIndex = 0; TimerIndex <= HpetGeneralCapabilities.Bits.NumberOfTimers; TimerIndex++) {\r
     AsciiSPrint (\r
       &DebugMessage[0],\r
       ARRAY_SIZE (DebugMessage),\r
-      "  HPET_TIMER%d_CONFIGURATION     = 0x%016lx\n",\r
-      TimerIndex,\r
-      HpetRead (HPET_TIMER_CONFIGURATION_OFFSET + TimerIndex * HPET_TIMER_STRIDE)\r
+      "  HPET_GENERAL_INTERRUPT_STATUS = 0x%016lx\n",\r
+      HpetRead (HPET_GENERAL_INTERRUPT_STATUS_OFFSET)\r
       );\r
     OsServiceDebugPrint (&DebugMessage[0]);\r
 \r
     AsciiSPrint (\r
       &DebugMessage[0],\r
       ARRAY_SIZE (DebugMessage),\r
-      "  HPET_TIMER%d_COMPARATOR        = 0x%016lx\n",\r
-      TimerIndex,\r
-      HpetRead (HPET_TIMER_COMPARATOR_OFFSET    + TimerIndex * HPET_TIMER_STRIDE)\r
+      "  HPET_MAIN_COUNTER             = 0x%016lx\n",\r
+      HpetRead (HPET_MAIN_COUNTER_OFFSET)\r
       );\r
     OsServiceDebugPrint (&DebugMessage[0]);\r
 \r
     AsciiSPrint (\r
       &DebugMessage[0],\r
       ARRAY_SIZE (DebugMessage),\r
-      "  HPET_TIMER%d_MSI_ROUTE         = 0x%016lx\n",\r
-      TimerIndex,\r
-      HpetRead (HPET_TIMER_MSI_ROUTE_OFFSET     + TimerIndex * HPET_TIMER_STRIDE)\r
+      "  HPET Main Counter Period      = %d (fs)\n",\r
+      HpetGeneralCapabilities.Bits.CounterClockPeriod\r
       );\r
     OsServiceDebugPrint (&DebugMessage[0]);\r
+\r
+    for (TimerIndex = 0; TimerIndex <= HpetGeneralCapabilities.Bits.NumberOfTimers; TimerIndex++) {\r
+      AsciiSPrint (\r
+        &DebugMessage[0],\r
+        ARRAY_SIZE (DebugMessage),\r
+        "  HPET_TIMER%d_CONFIGURATION     = 0x%016lx\n",\r
+        TimerIndex,\r
+        HpetRead (HPET_TIMER_CONFIGURATION_OFFSET + TimerIndex * HPET_TIMER_STRIDE)\r
+        );\r
+      OsServiceDebugPrint (&DebugMessage[0]);\r
+\r
+      AsciiSPrint (\r
+        &DebugMessage[0],\r
+        ARRAY_SIZE (DebugMessage),\r
+        "  HPET_TIMER%d_COMPARATOR        = 0x%016lx\n",\r
+        TimerIndex,\r
+        HpetRead (HPET_TIMER_COMPARATOR_OFFSET    + TimerIndex * HPET_TIMER_STRIDE)\r
+        );\r
+      OsServiceDebugPrint (&DebugMessage[0]);\r
+\r
+      AsciiSPrint (\r
+        &DebugMessage[0],\r
+        ARRAY_SIZE (DebugMessage),\r
+        "  HPET_TIMER%d_MSI_ROUTE         = 0x%016lx\n",\r
+        TimerIndex,\r
+        HpetRead (HPET_TIMER_MSI_ROUTE_OFFSET     + TimerIndex * HPET_TIMER_STRIDE)\r
+        );\r
+      OsServiceDebugPrint (&DebugMessage[0]);\r
+    }\r
   }\r
 }\r
 \r
+/**\r
+  Reads the microcode signature from architectural MSR 0x8B.\r
+\r
+  @retval MicrocodeSignature      The microcode signature value.\r
+**/\r
+UINT32\r
+GetMicrocodeSignature (\r
+  VOID\r
+  )\r
+{\r
+  MSR_IA32_BIOS_SIGN_ID_REGISTER  BiosSignIdMsr;\r
+\r
+  AsmWriteMsr64 (MSR_IA32_BIOS_SIGN_ID, 0);\r
+  AsmCpuid (CPUID_VERSION_INFO, NULL, NULL, NULL, NULL);\r
+  BiosSignIdMsr.Uint64 = AsmReadMsr64 (MSR_IA32_BIOS_SIGN_ID);\r
+\r
+  return BiosSignIdMsr.Bits.MicrocodeUpdateSignature;\r
+}\r
+\r
 /**\r
   Prints the microcode update signature as read from architectural MSR 0x8B.\r
 \r
@@ -386,22 +431,20 @@ PrintMicrocodeUpdateSignature (
   IN PRM_OS_SERVICE_DEBUG_PRINT   OsServiceDebugPrint\r
   )\r
 {\r
-  MSR_IA32_BIOS_SIGN_ID_REGISTER  BiosSignIdMsr;\r
+  UINT32                          MicrocodeSignature;\r
   CHAR8                           DebugMessage[256];\r
 \r
   if (OsServiceDebugPrint == NULL) {\r
     return;\r
   }\r
 \r
-  AsmWriteMsr64 (MSR_IA32_BIOS_SIGN_ID, 0);\r
-  AsmCpuid (CPUID_VERSION_INFO, NULL, NULL, NULL, NULL);\r
-  BiosSignIdMsr.Uint64 = AsmReadMsr64 (MSR_IA32_BIOS_SIGN_ID);\r
+  MicrocodeSignature = GetMicrocodeSignature ();\r
 \r
   AsciiSPrint (\r
     &DebugMessage[0],\r
     ARRAY_SIZE (DebugMessage),\r
     "  Signature read = 0x%x.\n",\r
-    BiosSignIdMsr.Bits.MicrocodeUpdateSignature\r
+    MicrocodeSignature\r
     );\r
   OsServiceDebugPrint (&DebugMessage[0]);\r
 }\r
@@ -409,7 +452,7 @@ PrintMicrocodeUpdateSignature (
 /**\r
   A sample Platform Runtime Mechanism (PRM) handler.\r
 \r
-  This sample handler attempts to read the microcode update signature MSR and print the result to a debug message.\r
+  This sample handler attempts to read the microcode update signature.\r
 \r
   @param[in]  ParameterBuffer     A pointer to the PRM handler parameter buffer\r
   @param[in]  ContextBUffer       A pointer to the PRM handler context buffer\r
@@ -419,6 +462,32 @@ PrintMicrocodeUpdateSignature (
 \r
 **/\r
 PRM_HANDLER_EXPORT (MsrAccessMicrocodeSignaturePrmHandler)\r
+{\r
+  UINT32  MicrocodeSignature;\r
+\r
+  MicrocodeSignature = 0;\r
+  MicrocodeSignature = GetMicrocodeSignature ();\r
+\r
+  if (MicrocodeSignature == 0) {\r
+    return EFI_NOT_FOUND;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  A sample Platform Runtime Mechanism (PRM) handler.\r
+\r
+  This sample handler attempts to read the microcode update signature MSR and print the result to a debug message.\r
+\r
+  @param[in]  ParameterBuffer     A pointer to the PRM handler parameter buffer\r
+  @param[in]  ContextBUffer       A pointer to the PRM handler context buffer\r
+\r
+  @retval EFI_STATUS              The PRM handler executed successfully.\r
+  @retval Others                  An error occurred in the PRM handler.\r
+\r
+**/\r
+PRM_HANDLER_EXPORT (MsrPrintMicrocodeSignaturePrmHandler)\r
 {\r
   PRM_OS_SERVICE_DEBUG_PRINT      OsServiceDebugPrint;\r
 \r
@@ -426,7 +495,7 @@ PRM_HANDLER_EXPORT (MsrAccessMicrocodeSignaturePrmHandler)
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  // In the POC, the OS debug print service is assumed to be at the beginning of ParameterBuffer\r
+  // The OS debug print service is assumed to be at the beginning of ParameterBuffer\r
   OsServiceDebugPrint = *((PRM_OS_SERVICE_DEBUG_PRINT *) ParameterBuffer);\r
   if (OsServiceDebugPrint == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -443,7 +512,7 @@ PRM_HANDLER_EXPORT (MsrAccessMicrocodeSignaturePrmHandler)
 /**\r
   A sample Platform Runtime Mechanism (PRM) handler.\r
 \r
-  This sample handler attempts to read the current MTRR settings and print the result to a debug message.\r
+  This sample handler attempts to read the current MTRR settings.\r
 \r
   @param[in]  ParameterBuffer     A pointer to the PRM handler parameter buffer\r
   @param[in]  ContextBUffer       A pointer to the PRM handler context buffer\r
@@ -453,6 +522,25 @@ PRM_HANDLER_EXPORT (MsrAccessMicrocodeSignaturePrmHandler)
 \r
 **/\r
 PRM_HANDLER_EXPORT (MsrAccessMtrrDumpPrmHandler)\r
+{\r
+  AccessAllMtrrs (NULL);\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  A sample Platform Runtime Mechanism (PRM) handler.\r
+\r
+  This sample handler attempts to read the current MTRR settings and print the result to a debug message.\r
+\r
+  @param[in]  ParameterBuffer     A pointer to the PRM handler parameter buffer\r
+  @param[in]  ContextBUffer       A pointer to the PRM handler context buffer\r
+\r
+  @retval EFI_STATUS              The PRM handler executed successfully.\r
+  @retval Others                  An error occurred in the PRM handler.\r
+\r
+**/\r
+PRM_HANDLER_EXPORT (MsrPrintMtrrDumpPrmHandler)\r
 {\r
   PRM_OS_SERVICE_DEBUG_PRINT      OsServiceDebugPrint;\r
 \r
@@ -468,16 +556,17 @@ PRM_HANDLER_EXPORT (MsrAccessMtrrDumpPrmHandler)
 \r
   OsServiceDebugPrint ("Hardware Access MsrAccessMtrrDumpPrmHandler entry.\n");\r
   OsServiceDebugPrint ("  Attempting to dump MTRR values:\n");\r
-  PrintAllMtrrs (OsServiceDebugPrint);\r
+  AccessAllMtrrs (OsServiceDebugPrint);\r
   OsServiceDebugPrint ("Hardware Access MsrAccessMtrrDumpPrmHandler exit.\n");\r
 \r
   return EFI_SUCCESS;\r
 }\r
 \r
+\r
 /**\r
   A sample Platform Runtime Mechanism (PRM) handler.\r
 \r
-  This sample handler attempts to read from a HPET MMIO resource and print the result to a debug message.\r
+  This sample handler attempts to read from a HPET MMIO resource.\r
 \r
   @param[in]  ParameterBuffer     A pointer to the PRM handler parameter buffer\r
   @param[in]  ContextBUffer       A pointer to the PRM handler context buffer\r
@@ -487,6 +576,25 @@ PRM_HANDLER_EXPORT (MsrAccessMtrrDumpPrmHandler)
 \r
 **/\r
 PRM_HANDLER_EXPORT (MmioAccessHpetPrmHandler)\r
+{\r
+  AccessHpetConfiguration (NULL);\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  A sample Platform Runtime Mechanism (PRM) handler.\r
+\r
+  This sample handler attempts to read from a HPET MMIO resource and print the result to a debug message.\r
+\r
+  @param[in]  ParameterBuffer     A pointer to the PRM handler parameter buffer\r
+  @param[in]  ContextBUffer       A pointer to the PRM handler context buffer\r
+\r
+  @retval EFI_STATUS              The PRM handler executed successfully.\r
+  @retval Others                  An error occurred in the PRM handler.\r
+\r
+**/\r
+PRM_HANDLER_EXPORT (MmioPrintHpetPrmHandler)\r
 {\r
   PRM_OS_SERVICE_DEBUG_PRINT      OsServiceDebugPrint;\r
 \r
@@ -494,16 +602,16 @@ PRM_HANDLER_EXPORT (MmioAccessHpetPrmHandler)
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  // In the POC, the OS debug print service is assumed to be at the beginning of ParameterBuffer\r
+  // An OS debug print service is assumed to be at the beginning of ParameterBuffer\r
   OsServiceDebugPrint = *((PRM_OS_SERVICE_DEBUG_PRINT *) ParameterBuffer);\r
   if (OsServiceDebugPrint == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  OsServiceDebugPrint ("Hardware Access MmioAccessHpetPrmHandler entry.\n");\r
+  OsServiceDebugPrint ("Hardware Access MmioPrintHpetPrmHandler entry.\n");\r
   OsServiceDebugPrint ("  Attempting to read HPET configuration...\n");\r
-  PrintHpetConfiguration (OsServiceDebugPrint);\r
-  OsServiceDebugPrint ("Hardware Access MmioAccessHpetPrmHandler exit.\n");\r
+  AccessHpetConfiguration (OsServiceDebugPrint);\r
+  OsServiceDebugPrint ("Hardware Access MmioPrintHpetPrmHandler exit.\n");\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -514,7 +622,10 @@ PRM_HANDLER_EXPORT (MmioAccessHpetPrmHandler)
 PRM_MODULE_EXPORT (\r
   PRM_HANDLER_EXPORT_ENTRY (MSR_ACCESS_MICROCODE_SIGNATURE_PRM_HANDLER_GUID, MsrAccessMicrocodeSignaturePrmHandler),\r
   PRM_HANDLER_EXPORT_ENTRY (MSR_ACCESS_MTRR_DUMP_PRM_HANDLER_GUID, MsrAccessMtrrDumpPrmHandler),\r
-  PRM_HANDLER_EXPORT_ENTRY (MMIO_ACCESS_HPET_PRM_HANDLER_GUID, MmioAccessHpetPrmHandler)\r
+  PRM_HANDLER_EXPORT_ENTRY (MMIO_ACCESS_HPET_PRM_HANDLER_GUID, MmioAccessHpetPrmHandler),\r
+  PRM_HANDLER_EXPORT_ENTRY (MSR_PRINT_MICROCODE_SIGNATURE_PRM_HANDLER_GUID, MsrPrintMicrocodeSignaturePrmHandler),\r
+  PRM_HANDLER_EXPORT_ENTRY (MSR_PRINT_MTRR_DUMP_PRM_HANDLER_GUID, MsrPrintMtrrDumpPrmHandler),\r
+  PRM_HANDLER_EXPORT_ENTRY (MMIO_PRINT_HPET_PRM_HANDLER_GUID, MmioPrintHpetPrmHandler)\r
   );\r
 \r
 /**\r