]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c
Merge R8->R9 tracker 5935 and 7080 to update runtime arch protocol to DxeCis 0.91...
[mirror_edk2.git] / EdkModulePkg / Core / Dxe / DxeMain / DxeMain.c
index 5e5b95af38bb9e3085cc6dfc665f8950f5190b6b..6b1f084e77bba7fcf568da2ad4c1dc6d6c7955a6 100644 (file)
@@ -157,7 +157,7 @@ EFI_METRONOME_ARCH_PROTOCOL       *gMetronome     = NULL;
 EFI_TIMER_ARCH_PROTOCOL           *gTimer         = NULL;\r
 EFI_BDS_ARCH_PROTOCOL             *gBds           = NULL;\r
 EFI_WATCHDOG_TIMER_ARCH_PROTOCOL  *gWatchdogTimer = NULL;\r
-EFI_RUNTIME_ARCH_PROTOCOL         *gRuntime       = NULL;\r
+\r
 \r
 //\r
 // BugBug: I'n not runtime, but is the PPI?\r
@@ -324,6 +324,26 @@ EFI_RUNTIME_SERVICES mEfiRuntimeServicesTableTemplate = {
 #endif\r
 };\r
 \r
+EFI_RUNTIME_ARCH_PROTOCOL gRuntimeTemplate = {\r
+  INITIALIZE_LIST_HEAD_VARIABLE (gRuntimeTemplate.ImageHead),\r
+  INITIALIZE_LIST_HEAD_VARIABLE (gRuntimeTemplate.EventHead),\r
+\r
+  //\r
+  // Make sure Size != sizeof (EFI_MEMORY_DESCRIPTOR). This will\r
+  // prevent people from having pointer math bugs in their code.\r
+  // now you have to use *DescriptorSize to make things work.\r
+  //\r
+  sizeof (EFI_MEMORY_DESCRIPTOR) + sizeof (UINT64) - (sizeof (EFI_MEMORY_DESCRIPTOR) % sizeof (UINT64)),  \r
+  EFI_MEMORY_DESCRIPTOR_VERSION, \r
+  0,\r
+  NULL,\r
+  NULL,\r
+  FALSE,\r
+  FALSE\r
+};\r
+\r
+EFI_RUNTIME_ARCH_PROTOCOL *gRuntime = &gRuntimeTemplate;\r
+\r
 //\r
 // DXE Core Global Variables for the EFI System Table, Boot Services Table, \r
 // DXE Services Table, and Runtime Services Table\r
@@ -886,11 +906,11 @@ CoreExitBootServices (
 \r
 Routine Description:\r
 \r
-  EFI 1.0 API to terminate Boot Services\r
+  Terminates all boot services.\r
 \r
 Arguments:\r
 \r
-  ImageHandle  - Handle that represents the identity of the calling image\r
+  ImageHandle   - Handle that identifies the exiting image.\r
 \r
   MapKey -Key to the latest memory map.\r
 \r
@@ -926,16 +946,6 @@ Returns:
   //\r
   gCpu->DisableInterrupt (gCpu);\r
 \r
-  //\r
-  // Register Runtime events with the Runtime Architectural Protocol\r
-  //\r
-  CoreShutdownEventServices ();\r
-\r
-  //\r
-  // Register Runtime images with the Runtime Architectural Protocol\r
-  //\r
-  CoreShutdownImageServices ();\r
-\r
   //\r
   // Report that ExitBootServices() has been called\r
   //\r
@@ -964,7 +974,12 @@ Returns:
   //\r
   SetMem (gBS, sizeof (EFI_BOOT_SERVICES), 0);\r
   gBS = NULL;\r
-\r
+  \r
+  //\r
+  // Update the AtRuntime field in Runtiem AP.\r
+  //\r
+  gRuntime->AtRuntime = TRUE;\r
+  \r
   return Status;\r
 }\r
 \r