]>
Commit | Line | Data |
---|---|---|
fb0b259e | 1 | /** @file\r |
2 | Runtime Architectural Protocol as defined in the DXE CIS.\r | |
f2abdc91 | 3 | \r |
fb0b259e | 4 | Copyright (c) 2006, Intel Corporation. <BR>\r |
62409219 | 5 | All rights reserved. This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
fb0b259e | 9 | \r |
62409219 | 10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
f2abdc91 | 12 | \r |
fb0b259e | 13 | \r |
f2abdc91 | 14 | Module Name:\r |
15 | \r | |
16 | Runtime.h\r | |
17 | \r | |
18 | Abstract:\r | |
19 | \r | |
f2abdc91 | 20 | This code is used to produce the EFI runtime architectural protocol.\r |
21 | \r | |
fb0b259e | 22 | **/\r |
f2abdc91 | 23 | \r |
24 | #ifndef _RUNTIME_H_\r | |
25 | #define _RUNTIME_H_\r | |
26 | \r | |
27 | #include <PiDxe.h>\r | |
28 | #include <Protocol/LoadedImage.h>\r | |
29 | #include <Protocol/Runtime.h>\r | |
f2abdc91 | 30 | #include <Library/BaseLib.h>\r |
31 | #include <Library/UefiDriverEntryPoint.h>\r | |
32 | #include <Library/DebugLib.h>\r | |
33 | #include <Library/ReportStatusCodeLib.h>\r | |
34 | #include <Library/BaseMemoryLib.h>\r | |
35 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
36 | #include <Library/UefiBootServicesTableLib.h>\r | |
37 | #include <Library/CacheMaintenanceLib.h>\r | |
38 | #include <Library/PeCoffLib.h>\r | |
39 | #include <Library/PcdLib.h>\r | |
40 | \r | |
41 | \r | |
42 | //\r | |
43 | // Function Prototypes\r | |
44 | //\r | |
45 | EFI_STATUS\r | |
46 | EFIAPI\r | |
47 | RuntimeDriverCalculateCrc32 (\r | |
48 | IN VOID *Data,\r | |
49 | IN UINTN DataSize,\r | |
50 | OUT UINT32 *CrcOut\r | |
51 | )\r | |
52 | /*++\r | |
53 | \r | |
54 | Routine Description:\r | |
55 | \r | |
56 | Calculate CRC32 for target data\r | |
57 | \r | |
58 | Arguments:\r | |
59 | \r | |
60 | Data - The target data.\r | |
61 | DataSize - The target data size.\r | |
62 | CrcOut - The CRC32 for target data.\r | |
63 | \r | |
64 | Returns:\r | |
65 | \r | |
66 | EFI_SUCCESS - The CRC32 for target data is calculated successfully.\r | |
62409219 | 67 | EFI_INVALID_PARAMETER - Some parameter is not valid, so the CRC32 is not\r |
f2abdc91 | 68 | calculated.\r |
69 | \r | |
70 | --*/\r | |
71 | ;\r | |
72 | \r | |
73 | EFI_STATUS\r | |
74 | EFIAPI\r | |
75 | RuntimeDriverConvertPointer (\r | |
76 | IN UINTN DebugDisposition,\r | |
77 | IN OUT VOID **ConvertAddress\r | |
78 | )\r | |
79 | /*++\r | |
80 | \r | |
81 | Routine Description:\r | |
82 | \r | |
83 | Determines the new virtual address that is to be used on subsequent memory accesses.\r | |
84 | \r | |
85 | Arguments:\r | |
62409219 | 86 | \r |
f2abdc91 | 87 | DebugDisposition - Supplies type information for the pointer being converted.\r |
88 | ConvertAddress - A pointer to a pointer that is to be fixed to be the value needed\r | |
89 | for the new virtual address mappings being applied.\r | |
90 | \r | |
91 | Returns:\r | |
92 | \r | |
93 | EFI_SUCCESS - The pointer pointed to by Address was modified.\r | |
94 | EFI_NOT_FOUND - The pointer pointed to by Address was not found to be part\r | |
95 | of the current memory map. This is normally fatal.\r | |
96 | EFI_INVALID_PARAMETER - One of the parameters has an invalid value.\r | |
97 | \r | |
98 | --*/\r | |
99 | ;\r | |
100 | \r | |
101 | EFI_STATUS\r | |
102 | EFIAPI\r | |
103 | RuntimeDriverSetVirtualAddressMap (\r | |
104 | IN UINTN MemoryMapSize,\r | |
105 | IN UINTN DescriptorSize,\r | |
106 | IN UINT32 DescriptorVersion,\r | |
107 | IN EFI_MEMORY_DESCRIPTOR *VirtualMap\r | |
108 | )\r | |
109 | /*++\r | |
110 | \r | |
111 | Routine Description:\r | |
112 | \r | |
113 | Changes the runtime addressing mode of EFI firmware from physical to virtual.\r | |
114 | \r | |
115 | Arguments:\r | |
62409219 | 116 | \r |
f2abdc91 | 117 | MemoryMapSize - The size in bytes of VirtualMap.\r |
118 | DescriptorSize - The size in bytes of an entry in the VirtualMap.\r | |
119 | DescriptorVersion - The version of the structure entries in VirtualMap.\r | |
120 | VirtualMap - An array of memory descriptors which contain new virtual\r | |
121 | address mapping information for all runtime ranges.\r | |
122 | \r | |
123 | Returns:\r | |
124 | \r | |
125 | EFI_SUCCESS - The virtual address map has been applied.\r | |
126 | EFI_UNSUPPORTED - EFI firmware is not at runtime, or the EFI firmware is already in\r | |
127 | virtual address mapped mode.\r | |
128 | EFI_INVALID_PARAMETER - DescriptorSize or DescriptorVersion is invalid.\r | |
129 | EFI_NO_MAPPING - A virtual address was not supplied for a range in the memory\r | |
130 | map that requires a mapping.\r | |
131 | EFI_NOT_FOUND - A virtual address was supplied for an address that is not found\r | |
132 | in the memory map.\r | |
133 | \r | |
134 | --*/\r | |
135 | ;\r | |
136 | \r | |
137 | VOID\r | |
138 | RuntimeDriverInitializeCrc32Table (\r | |
139 | VOID\r | |
140 | )\r | |
141 | /*++\r | |
142 | \r | |
143 | Routine Description:\r | |
144 | \r | |
145 | Initialize CRC32 table.\r | |
146 | \r | |
147 | Arguments:\r | |
148 | \r | |
149 | None.\r | |
150 | \r | |
151 | Returns:\r | |
152 | \r | |
153 | None.\r | |
154 | \r | |
155 | --*/\r | |
156 | ;\r | |
157 | \r | |
158 | EFI_STATUS\r | |
159 | EFIAPI\r | |
160 | RuntimeDriverInitialize (\r | |
161 | IN EFI_HANDLE ImageHandle,\r | |
162 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
163 | )\r | |
164 | /*++\r | |
165 | \r | |
166 | Routine Description:\r | |
167 | \r | |
62409219 | 168 | Install Runtime AP. This code includes the EfiRuntimeLib, but it only\r |
169 | functions at RT in physical mode.\r | |
f2abdc91 | 170 | \r |
171 | Arguments:\r | |
62409219 | 172 | \r |
f2abdc91 | 173 | ImageHandle - Image handle of this driver.\r |
174 | SystemTable - Pointer to the EFI System Table.\r | |
175 | \r | |
176 | Returns:\r | |
177 | \r | |
178 | EFI_SUCEESS - Runtime Driver Architectural Protocol installed.\r | |
179 | \r | |
180 | --*/\r | |
181 | ;\r | |
182 | \r | |
183 | #endif\r |