\r
Runtime Architectural Protocol as defined in the DXE CIS\r
\r
- This code is used to produce the EFI runtime virtual switch over\r
+ This code is used to produce the EFI runtime architectural protocol.\r
\r
--*/\r
\r
#ifndef _RUNTIME_H_\r
#define _RUNTIME_H_\r
\r
-//\r
-// Data structures\r
-//\r
-typedef struct {\r
- LIST_ENTRY Link;\r
- BOOLEAN Valid;\r
- EFI_PHYSICAL_ADDRESS ImageBase;\r
- UINTN ImageSize; // In no. of pages\r
- VOID *RelocationData;\r
-} RUNTIME_IMAGE_RELOCATION_DATA;\r
-\r
-typedef struct {\r
- LIST_ENTRY Link;\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
-} RUNTIME_NOTIFY_EVENT_DATA;\r
-\r
//\r
// Function Prototypes\r
//\r
-VOID\r
-RelocatePeImageForRuntime (\r
- RUNTIME_IMAGE_RELOCATION_DATA *Image\r
- )\r
-;\r
-\r
EFI_STATUS\r
EFIAPI\r
RuntimeDriverCalculateCrc32 (\r
IN UINTN DataSize,\r
OUT UINT32 *CrcOut\r
)\r
-;\r
+/*++\r
\r
-EFI_STATUS\r
-EFIAPI\r
-RuntimeDriverRegisterImage (\r
- IN EFI_RUNTIME_ARCH_PROTOCOL *This,\r
- IN EFI_PHYSICAL_ADDRESS ImageBase,\r
- IN UINTN ImageSize,\r
- IN VOID *RelocationData\r
- )\r
+Routine Description:\r
+\r
+ Calculate CRC32 for target data\r
+\r
+Arguments:\r
+\r
+ Data - The target data.\r
+ DataSize - The target data size.\r
+ CrcOut - The CRC32 for target data.\r
+\r
+Returns:\r
+\r
+ EFI_SUCCESS - The CRC32 for target data is calculated successfully.\r
+ EFI_INVALID_PARAMETER - Some parameter is not valid, so the CRC32 is not \r
+ calculated.\r
+\r
+--*/\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
+RuntimeDriverConvertPointer (\r
+ IN UINTN DebugDisposition,\r
+ IN OUT VOID **ConvertAddress\r
)\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Determines the new virtual address that is to be used on subsequent memory accesses.\r
+\r
+Arguments:\r
+ \r
+ DebugDisposition - Supplies type information for the pointer being converted.\r
+ ConvertAddress - A pointer to a pointer that is to be fixed to be the value needed\r
+ for the new virtual address mappings being applied.\r
+\r
+Returns:\r
+\r
+ EFI_SUCCESS - The pointer pointed to by Address was modified.\r
+ EFI_NOT_FOUND - The pointer pointed to by Address was not found to be part\r
+ of the current memory map. This is normally fatal.\r
+ EFI_INVALID_PARAMETER - One of the parameters has an invalid value.\r
+\r
+--*/\r
;\r
\r
EFI_STATUS\r
EFIAPI\r
-RuntimeDriverConvertPointer (\r
- IN UINTN DebugDisposition,\r
- IN OUT VOID **ConvertAddress\r
+RuntimeDriverSetVirtualAddressMap (\r
+ IN UINTN MemoryMapSize,\r
+ IN UINTN DescriptorSize,\r
+ IN UINT32 DescriptorVersion,\r
+ IN EFI_MEMORY_DESCRIPTOR *VirtualMap\r
)\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Changes the runtime addressing mode of EFI firmware from physical to virtual.\r
+\r
+Arguments:\r
+ \r
+ MemoryMapSize - The size in bytes of VirtualMap.\r
+ DescriptorSize - The size in bytes of an entry in the VirtualMap.\r
+ DescriptorVersion - The version of the structure entries in VirtualMap.\r
+ VirtualMap - An array of memory descriptors which contain new virtual\r
+ address mapping information for all runtime ranges.\r
+\r
+Returns:\r
+\r
+ EFI_SUCCESS - The virtual address map has been applied.\r
+ EFI_UNSUPPORTED - EFI firmware is not at runtime, or the EFI firmware is already in\r
+ virtual address mapped mode.\r
+ EFI_INVALID_PARAMETER - DescriptorSize or DescriptorVersion is invalid.\r
+ EFI_NO_MAPPING - A virtual address was not supplied for a range in the memory\r
+ map that requires a mapping.\r
+ EFI_NOT_FOUND - A virtual address was supplied for an address that is not found\r
+ in the memory map.\r
+\r
+--*/\r
;\r
\r
VOID\r
RuntimeDriverInitializeCrc32Table (\r
VOID\r
)\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Initialize CRC32 table.\r
+\r
+Arguments:\r
+\r
+ None.\r
+\r
+Returns:\r
+\r
+ None.\r
+\r
+--*/\r
;\r
\r
EFI_STATUS\r
IN EFI_HANDLE ImageHandle,\r
IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
-;\r
+/*++\r
\r
+Routine Description:\r
\r
-//\r
-// Cache Flush Routine.\r
-//\r
-EFI_STATUS\r
-FlushCpuCache (\r
- IN EFI_PHYSICAL_ADDRESS Start,\r
- IN UINT64 Length\r
- )\r
+ Install Runtime AP. This code includes the EfiRuntimeLib, but it only \r
+ functions at RT in physical mode. \r
+\r
+Arguments:\r
+ \r
+ ImageHandle - Image handle of this driver.\r
+ SystemTable - Pointer to the EFI System Table.\r
+\r
+Returns:\r
+\r
+ EFI_SUCEESS - Runtime Driver Architectural Protocol installed.\r
+\r
+--*/\r
;\r
\r
#endif\r