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 <Protocol/UgaIo.h>
31 #include <Library/BaseLib.h>
32 #include <Library/UefiDriverEntryPoint.h>
33 #include <Library/DebugLib.h>
34 #include <Library/ReportStatusCodeLib.h>
35 #include <Library/BaseMemoryLib.h>
36 #include <Library/UefiRuntimeServicesTableLib.h>
37 #include <Library/UefiBootServicesTableLib.h>
38 #include <Library/CacheMaintenanceLib.h>
39 #include <Library/PeCoffLib.h>
40 #include <Library/PcdLib.h>
44 // Function Prototypes
48 RuntimeDriverCalculateCrc32 (
57 Calculate CRC32 for target data
61 Data - The target data.
62 DataSize - The target data size.
63 CrcOut - The CRC32 for target data.
67 EFI_SUCCESS - The CRC32 for target data is calculated successfully.
68 EFI_INVALID_PARAMETER - Some parameter is not valid, so the CRC32 is not
76 RuntimeDriverConvertPointer (
77 IN UINTN DebugDisposition
,
78 IN OUT VOID
**ConvertAddress
84 Determines the new virtual address that is to be used on subsequent memory accesses.
88 DebugDisposition - Supplies type information for the pointer being converted.
89 ConvertAddress - A pointer to a pointer that is to be fixed to be the value needed
90 for the new virtual address mappings being applied.
94 EFI_SUCCESS - The pointer pointed to by Address was modified.
95 EFI_NOT_FOUND - The pointer pointed to by Address was not found to be part
96 of the current memory map. This is normally fatal.
97 EFI_INVALID_PARAMETER - One of the parameters has an invalid value.
104 RuntimeDriverSetVirtualAddressMap (
105 IN UINTN MemoryMapSize
,
106 IN UINTN DescriptorSize
,
107 IN UINT32 DescriptorVersion
,
108 IN EFI_MEMORY_DESCRIPTOR
*VirtualMap
114 Changes the runtime addressing mode of EFI firmware from physical to virtual.
118 MemoryMapSize - The size in bytes of VirtualMap.
119 DescriptorSize - The size in bytes of an entry in the VirtualMap.
120 DescriptorVersion - The version of the structure entries in VirtualMap.
121 VirtualMap - An array of memory descriptors which contain new virtual
122 address mapping information for all runtime ranges.
126 EFI_SUCCESS - The virtual address map has been applied.
127 EFI_UNSUPPORTED - EFI firmware is not at runtime, or the EFI firmware is already in
128 virtual address mapped mode.
129 EFI_INVALID_PARAMETER - DescriptorSize or DescriptorVersion is invalid.
130 EFI_NO_MAPPING - A virtual address was not supplied for a range in the memory
131 map that requires a mapping.
132 EFI_NOT_FOUND - A virtual address was supplied for an address that is not found
139 RuntimeDriverInitializeCrc32Table (
146 Initialize CRC32 table.
161 RuntimeDriverInitialize (
162 IN EFI_HANDLE ImageHandle
,
163 IN EFI_SYSTEM_TABLE
*SystemTable
169 Install Runtime AP. This code includes the EfiRuntimeLib, but it only
170 functions at RT in physical mode.
174 ImageHandle - Image handle of this driver.
175 SystemTable - Pointer to the EFI System Table.
179 EFI_SUCEESS - Runtime Driver Architectural Protocol installed.