-RuntimeDriverRegisterImage (\r
- IN EFI_RUNTIME_ARCH_PROTOCOL *This,\r
- IN EFI_PHYSICAL_ADDRESS ImageBase,\r
- IN UINTN ImageSize,\r
- IN VOID *RelocationData\r
- )\r
-/*++\r
-\r
-Routine Description:\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
-Arguments:\r
-\r
- This - The EFI_RUNTIME_ARCH_PROTOCOL instance. \r
-\r
- 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
-\r
- ImageSize - Size of the image in bytes.\r
-\r
- 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
-Returns: \r
-\r
- EFI_SUCCESS - The ImageBase has been registered.\r
-\r
---*/\r
-{\r
- RUNTIME_IMAGE_RELOCATION_DATA *RuntimeImage;\r
-\r
- if (mMyLoadedImage->ImageBase == (VOID *) (UINTN) ImageBase) {\r
- //\r
- // We don't want to relocate our selves, as we only run in physical mode.\r
- //\r
- return EFI_SUCCESS;\r
- }\r
-\r
- RuntimeImage = &mRuntimeImageBuffer[mRuntimeImageNumber];\r
- mRuntimeImageNumber++;\r
- ASSERT (mRuntimeImageNumber < MAX_RUNTIME_IMAGE_NUM);\r
-\r
- RuntimeImage->Valid = TRUE;\r
- RuntimeImage->ImageBase = ImageBase;\r
- RuntimeImage->ImageSize = ImageSize;\r
- RuntimeImage->RelocationData = RelocationData;\r
-\r
- InsertTailList (&mRelocationList, &RuntimeImage->Link);\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-RuntimeDriverRegisterEvent (\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