Module Name: Runtime.h\r
\r
@par Revision Reference:\r
- Version 0.90.\r
+ Version 0.91.\r
\r
**/\r
\r
// Global ID for the Runtime Architectural Protocol\r
//\r
#define EFI_RUNTIME_ARCH_PROTOCOL_GUID \\r
- { 0x96d08253, 0x8483, 0x11d4, {0xbc, 0xf1, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }\r
+ { 0xb7dfb4e1, 0x52f, 0x449f, {0x87, 0xbe, 0x98, 0x18, 0xfc, 0x91, 0xb7, 0x33 } }\r
\r
-typedef struct _EFI_RUNTIME_ARCH_PROTOCOL EFI_RUNTIME_ARCH_PROTOCOL;\r
+typedef struct _EFI_RUNTIME_ARCH_PROTOCOL EFI_RUNTIME_ARCH_PROTOCOL;\r
\r
-/**\r
- When a SetVirtualAddressMap() is performed all the runtime images loaded by \r
- DXE must be fixed up with the new virtual address map. To facilitate this the \r
- Runtime Architectural Protocol needs to be informed of every runtime driver \r
- that is registered. All the runtime images loaded by DXE should be registered \r
- with this service by the DXE Core when ExitBootServices() is called. The \r
- images that are registered with this service must have successfully been \r
- loaded into memory with the Boot Service LoadImage(). As a result, no \r
- parameter checking needs to be performed.\r
-\r
- @param This The EFI_RUNTIME_ARCH_PROTOCOL instance.\r
- @param ImageBase Start of image that has been loaded in memory. It is either\r
- a pointer to the DOS or PE header of the image.\r
- @param ImageSize Size of the image in bytes.\r
- @param RelocationData Information about the fixups that were performed on ImageBase\r
- when it was loaded into memory. This information is needed\r
- when the virtual mode fix-ups are reapplied so that data that\r
- has been programmatically updated will not be fixed up. If\r
- code updates a global variable the code is responsible for\r
- fixing up the variable for virtual mode.\r
-\r
- @retval EFI_SUCCESS The ImageBase has been registered.\r
- @retval EFI_OUT_OF_RESOURCES There are not enough resources to register ImageBase.\r
+//\r
+// LIST_ENTRY from BaseType \r
+//\r
+typedef LIST_ENTRY EFI_LIST_ENTRY;\r
\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_RUNTIME_REGISTER_IMAGE) (\r
- IN EFI_RUNTIME_ARCH_PROTOCOL *This,\r
- IN EFI_PHYSICAL_ADDRESS ImageBase, \r
- IN UINTN ImageSize, \r
- IN VOID *RelocationData \r
- );\r
+typedef struct _EFI_RUNTIME_IMAGE_ENTRY EFI_RUNTIME_IMAGE_ENTRY;\r
\r
+struct _EFI_RUNTIME_IMAGE_ENTRY {\r
+ VOID *ImageBase;\r
+ UINT64 ImageSize;\r
+ VOID *RelocationData;\r
+ EFI_HANDLE Handle;\r
+ EFI_LIST_ENTRY Link;\r
+};\r
\r
-/**\r
- This function is used to support the required runtime events. Currently only \r
- runtime events of type EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE needs to be \r
- registered with this service. All the runtime events that exist in the DXE \r
- Core should be registered with this service when ExitBootServices() is called. \r
- All the events that are registered with this service must have been created \r
- with the Boot Service CreateEvent(). As a result, no parameter checking needs \r
- to be performed.\r
-\r
- @param This The EFI_RUNTIME_ARCH_PROTOCOL instance.\r
- @param Type The same as Type passed into CreateEvent().\r
- @param NotifyTpl The same as NotifyTpl passed into CreateEvent().\r
- @param NotifyFunction The same as NotifyFunction passed into CreateEvent().\r
- @param NotifyContext The same as NotifyContext passed into CreateEvent().\r
- @param Event The EFI_EVENT returned by CreateEvent(). Event must be in\r
- runtime memory.\r
-\r
- @retval EFI_SUCCESS The Event has been registered.\r
- @retval EFI_OUT_OF_RESOURCES There are not enough resources to register Event.\r
+typedef struct _EFI_RUNTIME_EVENT_ENTRY EFI_RUNTIME_EVENT_ENTRY;\r
\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_RUNTIME_REGISTER_EVENT) (\r
- IN EFI_RUNTIME_ARCH_PROTOCOL *This,\r
- IN UINT32 Type,\r
- IN EFI_TPL NotifyTpl,\r
- IN EFI_EVENT_NOTIFY NotifyFunction,\r
- IN VOID *NotifyContext,\r
- IN EFI_EVENT *Event\r
- );\r
+struct _EFI_RUNTIME_EVENT_ENTRY {\r
+ UINT32 Type;\r
+ EFI_TPL NotifyTpl;\r
+ EFI_EVENT_NOTIFY NotifyFunction;\r
+ VOID *NotifyContext;\r
+ EFI_EVENT *Event;\r
+ EFI_LIST_ENTRY Link;\r
+};\r
\r
//\r
// Interface stucture for the Runtime Architectural Protocol\r
//\r
/**\r
@par Protocol Description:\r
- The DXE driver that produces this protocol must be a runtime driver. This \r
- driver is responsible for initializing the SetVirtualAddressMap() and \r
- ConvertPointer() fields of the EFI Runtime Services Table and the \r
- CalculateCrc32() field of the EFI Boot Services Table. See the Runtime \r
- Services chapter and the Boot Services chapter for details on these services.\r
- After the two fields of the EFI Runtime Services Table and the one field of \r
- the EFI Boot Services Table have been initialized, the driver must install \r
- the EFI_RUNTIME_ARCH_PROTOCOL_GUID on a new handle with an EFI_RUNTIME_ARCH_ \r
- PROTOCOL interface pointer. The installation of this protocol informs the \r
- DXE core that the virtual memory services and the 32-bit CRC services are \r
- now available, and the DXE core must update the 32-bit CRC of the EFI Runtime \r
- Services Table and the 32-bit CRC of the EFI Boot Services Table.\r
-\r
- All runtime core services are provided by the EFI_RUNTIME_ARCH_PROTOCOL. \r
- This includes the support for registering runtime images that must be \r
- re-fixed up when a transition is made from physical mode to virtual mode. \r
- This protocol also supports all events that are defined to fire at runtime. \r
- This protocol also contains a CRC-32 function that will be used by the DXE \r
- core as a boot service. The EFI_RUNTIME_ARCH_PROTOCOL needs the CRC-32 \r
- function when a transition is made from physical mode to virtual mode and \r
- the EFI System Table and EFI Runtime Table are fixed up with virtual pointers.\r
-\r
- @param RegisterRuntimeImage\r
- Register a runtime image so it can be converted to virtual mode if the EFI Runtime Services \r
- SetVirtualAddressMap() is called.\r
-\r
- @param RegisterRuntimeEvent\r
- Register an event than needs to be notified at runtime. \r
+ Allows the runtime functionality of the DXE Foundation to be contained in a \r
+ separate driver. It also provides hooks for the DXE Foundation to export \r
+ information that is needed at runtime. As such, this protocol allows the DXE \r
+ Foundation to manage runtime drivers and events. This protocol also implies \r
+ that the runtime services required to transition to virtual mode, \r
+ SetVirtualAddressMap() and ConvertPointer(), have been registered into the \r
+ EFI Runtime Table in the EFI System Partition. This protocol must be produced \r
+ by a runtime DXE driver and may only be consumed by the DXE Foundation.\r
+\r
+ @param ImageHead\r
+ A list of type EFI_RUNTIME_IMAGE_ENTRY.\r
+\r
+ @param EventHead\r
+ A list of type EFI_RUNTIME_EVENT_ENTRY.\r
+\r
+ @param MemoryDescriptorSize\r
+ Size of a memory descriptor that is return by GetMemoryMap().\r
+\r
+ @param MemoryDescriptorVersion\r
+ Version of a memory descriptor that is return by GetMemoryMap().\r
+\r
+ @param MemoryMapSize \r
+ Size of the memory map in bytes contained in MemoryMapPhysical and MemoryMapVirtual. \r
+\r
+ @param MemoryMapPhysical\r
+ Pointer to a runtime buffer that contains a copy of \r
+ the memory map returned via GetMemoryMap().\r
+\r
+ @param MemoryMapVirtual\r
+ Pointer to MemoryMapPhysical that is updated to virtual mode after SetVirtualAddressMap().\r
+\r
+ @param VirtualMode\r
+ Boolean that is TRUE if SetVirtualAddressMap() has been called.\r
+\r
+ @param AtRuntime\r
+ Boolean that is TRUE if ExitBootServices () has been called.\r
\r
**/\r
struct _EFI_RUNTIME_ARCH_PROTOCOL {\r
- EFI_RUNTIME_REGISTER_IMAGE RegisterImage;\r
- EFI_RUNTIME_REGISTER_EVENT RegisterEvent;\r
+ EFI_LIST_ENTRY ImageHead;\r
+ EFI_LIST_ENTRY EventHead;\r
+ UINTN MemoryDescriptorSize;\r
+ UINT32 MemoryDesciptorVersion;\r
+ UINTN MemoryMapSize;\r
+ EFI_MEMORY_DESCRIPTOR *MemoryMapPhysical;\r
+ EFI_MEMORY_DESCRIPTOR *MemoryMapVirtual;\r
+ BOOLEAN VirtualMode;\r
+ BOOLEAN AtRuntime;\r
};\r
\r
extern EFI_GUID gEfiRuntimeArchProtocolGuid;\r