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
#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
\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
//\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
//\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