3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 Runtime Architectural Protocol as defined in the DXE CIS
20 This code is used to produce the EFI runtime architectural protocol.
28 #include <Protocol/LoadedImage.h>
29 #include <Protocol/Runtime.h>
30 #include <Library/BaseLib.h>
31 #include <Library/UefiDriverEntryPoint.h>
32 #include <Library/DebugLib.h>
33 #include <Library/ReportStatusCodeLib.h>
34 #include <Library/BaseMemoryLib.h>
35 #include <Library/UefiRuntimeServicesTableLib.h>
36 #include <Library/UefiBootServicesTableLib.h>
37 #include <Library/CacheMaintenanceLib.h>
38 #include <Library/PeCoffLib.h>
39 #include <Library/PcdLib.h>
43 // Function Prototypes
47 RuntimeDriverCalculateCrc32 (
56 Calculate CRC32 for target data
60 Data - The target data.
61 DataSize - The target data size.
62 CrcOut - The CRC32 for target data.
66 EFI_SUCCESS - The CRC32 for target data is calculated successfully.
67 EFI_INVALID_PARAMETER - Some parameter is not valid, so the CRC32 is not
75 RuntimeDriverConvertPointer (
76 IN UINTN DebugDisposition
,
77 IN OUT VOID
**ConvertAddress
83 Determines the new virtual address that is to be used on subsequent memory accesses.
87 DebugDisposition - Supplies type information for the pointer being converted.
88 ConvertAddress - A pointer to a pointer that is to be fixed to be the value needed
89 for the new virtual address mappings being applied.
93 EFI_SUCCESS - The pointer pointed to by Address was modified.
94 EFI_NOT_FOUND - The pointer pointed to by Address was not found to be part
95 of the current memory map. This is normally fatal.
96 EFI_INVALID_PARAMETER - One of the parameters has an invalid value.
103 RuntimeDriverSetVirtualAddressMap (
104 IN UINTN MemoryMapSize
,
105 IN UINTN DescriptorSize
,
106 IN UINT32 DescriptorVersion
,
107 IN EFI_MEMORY_DESCRIPTOR
*VirtualMap
113 Changes the runtime addressing mode of EFI firmware from physical to virtual.
117 MemoryMapSize - The size in bytes of VirtualMap.
118 DescriptorSize - The size in bytes of an entry in the VirtualMap.
119 DescriptorVersion - The version of the structure entries in VirtualMap.
120 VirtualMap - An array of memory descriptors which contain new virtual
121 address mapping information for all runtime ranges.
125 EFI_SUCCESS - The virtual address map has been applied.
126 EFI_UNSUPPORTED - EFI firmware is not at runtime, or the EFI firmware is already in
127 virtual address mapped mode.
128 EFI_INVALID_PARAMETER - DescriptorSize or DescriptorVersion is invalid.
129 EFI_NO_MAPPING - A virtual address was not supplied for a range in the memory
130 map that requires a mapping.
131 EFI_NOT_FOUND - A virtual address was supplied for an address that is not found
138 RuntimeDriverInitializeCrc32Table (
145 Initialize CRC32 table.
160 RuntimeDriverInitialize (
161 IN EFI_HANDLE ImageHandle
,
162 IN EFI_SYSTEM_TABLE
*SystemTable
168 Install Runtime AP. This code includes the EfiRuntimeLib, but it only
169 functions at RT in physical mode.
173 ImageHandle - Image handle of this driver.
174 SystemTable - Pointer to the EFI System Table.
178 EFI_SUCEESS - Runtime Driver Architectural Protocol installed.