]> git.proxmox.com Git - mirror_edk2.git/blame - EdkModulePkg/Universal/Runtime/RuntimeDxe/Runtime.c
Partially make EdkModulePkg pass intel IPF compiler with /W4 /WX switched on.
[mirror_edk2.git] / EdkModulePkg / Universal / Runtime / RuntimeDxe / Runtime.c
CommitLineData
878ddf1f 1/*++\r
2\r
3Copyright (c) 2006, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 Runtime.c\r
15\r
16Abstract:\r
17\r
18 Runtime Architectural Protocol as defined in the DXE CIS\r
19\r
20 This code is used to produce the EFI runtime virtual switch over\r
21\r
22 THIS IS VERY DANGEROUS CODE BE VERY CAREFUL IF YOU CHANGE IT\r
23\r
24 The transition for calling EFI Runtime functions in physical mode to calling\r
25 them in virtual mode is very very complex. Every pointer in needs to be \r
26 converted from physical mode to virtual mode. Be very careful walking linked\r
27 lists! Then to make it really hard the code it's self needs be relocated into\r
28 the new virtual address space.\r
29\r
30 So here is the concept. The code in this module will never ever be called in\r
31 virtual mode. This is the code that collects the information needed to convert\r
32 to virtual mode (DXE core registers runtime stuff with this code). Since this \r
33 code is used to fixup all runtime images, it CAN NOT fix it's self up. So some\r
34 code has to stay behind and that is us.\r
35\r
36 Also you need to be careful about when you allocate memory, as once we are in \r
37 runtime (including our EVT_SIGNAL_EXIT_BOOT_SERVICES event) you can no longer \r
38 allocate memory.\r
39\r
40 Any runtime driver that gets loaded before us will not be callable in virtual \r
41 mode. This is due to the fact that the DXE core can not register the info \r
42 needed with us. This is good, since it keeps the code in this file from \r
43 getting registered.\r
44\r
45\r
46Revision History:\r
47\r
48 - Move the CalculateCrc32 function from Runtime Arch Protocol to Boot Service.\r
49 Runtime Arch Protocol definition no longer contains CalculateCrc32. Boot Service\r
50 Table now contains an item named CalculateCrc32.\r
51\r
52--*/\r
53\r
54\r
55#include "Runtime.h"\r
56\r
57//\r
3ec2611d 58// Global Variables\r
878ddf1f 59//\r
3ec2611d
LG
60EFI_MEMORY_DESCRIPTOR *mVirtualMap = NULL;\r
61UINTN mVirtualMapDescriptorSize;\r
62UINTN mVirtualMapMaxIndex;\r
63VOID *mMyImageBase;\r
878ddf1f 64\r
65//\r
66// The handle onto which the Runtime Architectural Protocol instance is installed\r
67//\r
68EFI_HANDLE mRuntimeHandle = NULL;\r
69\r
70//\r
71// The Runtime Architectural Protocol instance produced by this driver\r
72//\r
73EFI_RUNTIME_ARCH_PROTOCOL mRuntime = {\r
3ec2611d
LG
74 INITIALIZE_LIST_HEAD_VARIABLE (mRuntime.ImageHead),\r
75 INITIALIZE_LIST_HEAD_VARIABLE (mRuntime.EventHead),\r
878ddf1f 76\r
3ec2611d
LG
77 //\r
78 // Make sure Size != sizeof (EFI_MEMORY_DESCRIPTOR). This will\r
79 // prevent people from having pointer math bugs in their code.\r
80 // now you have to use *DescriptorSize to make things work.\r
81 //\r
82 sizeof (EFI_MEMORY_DESCRIPTOR) + sizeof (UINT64) - (sizeof (EFI_MEMORY_DESCRIPTOR) % sizeof (UINT64)), \r
83 EFI_MEMORY_DESCRIPTOR_VERSION, \r
84 0,\r
85 NULL,\r
86 NULL,\r
87 FALSE,\r
88 FALSE\r
89};\r
878ddf1f 90\r
91//\r
92// Worker Functions\r
93//\r
1cc8ee78 94STATIC\r
878ddf1f 95VOID\r
96RuntimeDriverCalculateEfiHdrCrc (\r
97 IN OUT EFI_TABLE_HEADER *Hdr\r
98 )\r
99/*++\r
100\r
101Routine Description:\r
102\r
103 Calcualte the 32-bit CRC in a EFI table using the Runtime Drivers\r
104 internal function. The EFI Boot Services Table can not be used because\r
105 the EFI Boot Services Table was destroyed at ExitBootServices()\r
106\r
107Arguments:\r
108\r
109 Hdr - Pointer to an EFI standard header\r
110\r
111Returns:\r
112\r
113 None\r
114\r
115--*/\r
116{\r
117 UINT32 Crc;\r
118\r
119 Hdr->CRC32 = 0;\r
120\r
121 Crc = 0;\r
122 RuntimeDriverCalculateCrc32 ((UINT8 *) Hdr, Hdr->HeaderSize, &Crc);\r
123 Hdr->CRC32 = Crc;\r
124}\r
125\r
126EFI_STATUS\r
127EFIAPI\r
3ec2611d
LG
128RuntimeDriverConvertPointer (\r
129 IN UINTN DebugDisposition,\r
130 IN OUT VOID **ConvertAddress\r
878ddf1f 131 )\r
132/*++\r
133\r
134Routine Description:\r
135\r
3ec2611d 136 Determines the new virtual address that is to be used on subsequent memory accesses.\r
878ddf1f 137\r
138Arguments:\r
3ec2611d
LG
139 \r
140 DebugDisposition - Supplies type information for the pointer being converted.\r
141 ConvertAddress - A pointer to a pointer that is to be fixed to be the value needed\r
142 for the new virtual address mappings being applied.\r
878ddf1f 143\r
3ec2611d 144Returns:\r
878ddf1f 145\r
3ec2611d
LG
146 EFI_SUCCESS - The pointer pointed to by Address was modified.\r
147 EFI_NOT_FOUND - The pointer pointed to by Address was not found to be part\r
148 of the current memory map. This is normally fatal.\r
149 EFI_INVALID_PARAMETER - One of the parameters has an invalid value.\r
878ddf1f 150\r
151--*/\r
878ddf1f 152{\r
153 UINTN Address;\r
154 VOID *PlabelConvertAddress;\r
155 UINT64 VirtEndOfRange;\r
156 EFI_MEMORY_DESCRIPTOR *VirtEntry;\r
157 UINTN Index;\r
158\r
159 //\r
160 // Make sure ConvertAddress is a valid pointer\r
161 //\r
162 if (ConvertAddress == NULL) {\r
163 return EFI_INVALID_PARAMETER;\r
164 }\r
165 //\r
166 // Get the address to convert\r
167 //\r
168 Address = (UINTN) *ConvertAddress;\r
169\r
170 //\r
171 // If this is a null pointer, return if it's allowed\r
172 //\r
173 if (Address == 0) {\r
174 if (DebugDisposition & EFI_OPTIONAL_POINTER) {\r
175 return EFI_SUCCESS;\r
176 }\r
177\r
178 return EFI_INVALID_PARAMETER;\r
179 }\r
180\r
181 PlabelConvertAddress = NULL;\r
182 VirtEntry = mVirtualMap;\r
183 for (Index = 0; Index < mVirtualMapMaxIndex; Index++) {\r
184 //\r
185 // To prevent the inclusion of 64-bit math functions a UINTN was placed in\r
186 // front of VirtEntry->NumberOfPages to cast it to a 32-bit thing on IA-32\r
187 // platforms. If you get this ASSERT remove the UINTN and do a 64-bit\r
188 // multiply.\r
189 //\r
3ec2611d 190 ASSERT (((UINTN) VirtEntry->NumberOfPages < 0xffffffff) || (sizeof (UINTN) > 4));\r
878ddf1f 191\r
192 if ((VirtEntry->Attribute & EFI_MEMORY_RUNTIME) == EFI_MEMORY_RUNTIME) {\r
193 if (Address >= VirtEntry->PhysicalStart) {\r
194 VirtEndOfRange = VirtEntry->PhysicalStart + (((UINTN) VirtEntry->NumberOfPages) * EFI_PAGE_SIZE);\r
195 if (Address < VirtEndOfRange) {\r
196 //\r
197 // Compute new address\r
198 //\r
199 *ConvertAddress = (VOID *) (Address - (UINTN) VirtEntry->PhysicalStart + (UINTN) VirtEntry->VirtualStart);\r
200 return EFI_SUCCESS;\r
201 } else if (Address < (VirtEndOfRange + 0x200000)) {\r
202 //\r
203 // On Itanium GP defines a window +/- 2 MB inside an image.\r
204 // The compiler may asign a GP value outside of the image. Thus\r
205 // it could fall out side of any of our valid regions\r
206 //\r
207 PlabelConvertAddress = (VOID *) (Address - (UINTN) VirtEntry->PhysicalStart + (UINTN) VirtEntry->VirtualStart);\r
208 }\r
209 }\r
210 }\r
211\r
212 VirtEntry = NextMemoryDescriptor (VirtEntry, mVirtualMapDescriptorSize);\r
213 }\r
214\r
215 if (DebugDisposition & EFI_IPF_GP_POINTER) {\r
216 //\r
217 // If it's an IPF GP and the GP was outside the image handle that case.\r
218 //\r
219 if (PlabelConvertAddress != NULL) {\r
220 *ConvertAddress = PlabelConvertAddress;\r
221 return EFI_SUCCESS;\r
222 }\r
223 }\r
224\r
225 return EFI_NOT_FOUND;\r
226}\r
227\r
1cc8ee78 228STATIC\r
878ddf1f 229EFI_STATUS\r
230RuntimeDriverConvertInternalPointer (\r
231 IN OUT VOID **ConvertAddress\r
232 )\r
3ec2611d
LG
233/*++\r
234\r
235Routine Description:\r
236\r
237 Determines the new virtual address that is to be used on subsequent memory accesses \r
238 for internal pointers.\r
239\r
240Arguments:\r
241 \r
242 ConvertAddress - A pointer to a pointer that is to be fixed to be the value needed\r
243 for the new virtual address mappings being applied.\r
244\r
245Returns:\r
246\r
247 EFI_SUCCESS - The pointer pointed to by Address was modified.\r
248 EFI_NOT_FOUND - The pointer pointed to by Address was not found to be part\r
249 of the current memory map. This is normally fatal.\r
250 EFI_INVALID_PARAMETER - One of the parameters has an invalid value.\r
251\r
252--*/\r
878ddf1f 253{\r
254 return RuntimeDriverConvertPointer (0x0, ConvertAddress);\r
255}\r
256\r
257EFI_STATUS\r
258EFIAPI\r
259RuntimeDriverSetVirtualAddressMap (\r
260 IN UINTN MemoryMapSize,\r
261 IN UINTN DescriptorSize,\r
262 IN UINT32 DescriptorVersion,\r
263 IN EFI_MEMORY_DESCRIPTOR *VirtualMap\r
264 )\r
3ec2611d
LG
265/*++\r
266\r
267Routine Description:\r
268\r
269 Changes the runtime addressing mode of EFI firmware from physical to virtual.\r
270\r
271Arguments:\r
272 \r
273 MemoryMapSize - The size in bytes of VirtualMap.\r
274 DescriptorSize - The size in bytes of an entry in the VirtualMap.\r
275 DescriptorVersion - The version of the structure entries in VirtualMap.\r
276 VirtualMap - An array of memory descriptors which contain new virtual\r
277 address mapping information for all runtime ranges.\r
278\r
279Returns:\r
280\r
281 EFI_SUCCESS - The virtual address map has been applied.\r
282 EFI_UNSUPPORTED - EFI firmware is not at runtime, or the EFI firmware is already in\r
283 virtual address mapped mode.\r
284 EFI_INVALID_PARAMETER - DescriptorSize or DescriptorVersion is invalid.\r
285 EFI_NO_MAPPING - A virtual address was not supplied for a range in the memory\r
286 map that requires a mapping.\r
287 EFI_NOT_FOUND - A virtual address was supplied for an address that is not found\r
288 in the memory map.\r
289\r
290--*/ \r
878ddf1f 291{\r
2ce31132 292 EFI_STATUS Status;\r
3ec2611d
LG
293 EFI_RUNTIME_EVENT_ENTRY *RuntimeEvent;\r
294 EFI_RUNTIME_IMAGE_ENTRY *RuntimeImage;\r
878ddf1f 295 LIST_ENTRY *Link;\r
296 UINTN Index;\r
297 UINTN Index1;\r
298 EFI_DRIVER_OS_HANDOFF_HEADER *DriverOsHandoffHeader;\r
299 EFI_DRIVER_OS_HANDOFF *DriverOsHandoff;\r
2ce31132 300 EFI_PHYSICAL_ADDRESS VirtImageBase;\r
045f4521 301#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
302 EFI_CAPSULE_TABLE *CapsuleTable; \r
303#endif\r
878ddf1f 304\r
305 //\r
306 // Can only switch to virtual addresses once the memory map is locked down,\r
307 // and can only set it once\r
308 //\r
3ec2611d 309 if (!mRuntime.AtRuntime || mRuntime.VirtualMode) {\r
878ddf1f 310 return EFI_UNSUPPORTED;\r
311 }\r
312 //\r
313 // Only understand the original descriptor format\r
314 //\r
315 if (DescriptorVersion != EFI_MEMORY_DESCRIPTOR_VERSION || DescriptorSize < sizeof (EFI_MEMORY_DESCRIPTOR)) {\r
316 return EFI_INVALID_PARAMETER;\r
317 }\r
318 //\r
878ddf1f 319 // We are now committed to go to virtual mode, so lets get to it!\r
320 //\r
3ec2611d 321 mRuntime.VirtualMode = TRUE;\r
878ddf1f 322\r
323 //\r
324 // ConvertPointer() needs this mVirtualMap to do the conversion. So set up\r
325 // globals we need to parse the virtual address map.\r
326 //\r
327 mVirtualMapDescriptorSize = DescriptorSize;\r
3ec2611d 328 mVirtualMapMaxIndex = MemoryMapSize / DescriptorSize;\r
878ddf1f 329 mVirtualMap = VirtualMap;\r
330\r
878ddf1f 331 //\r
332 // Currently the bug in StatusCode/RuntimeLib has been fixed, it will\r
333 // check whether in Runtime or not (this is judged by looking at\r
334 // mEfiAtRuntime global So this ReportStatusCode will work\r
335 //\r
336 REPORT_STATUS_CODE (\r
337 EFI_PROGRESS_CODE,\r
338 (EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_RS_PC_SET_VIRTUAL_ADDRESS_MAP)\r
339 );\r
340\r
341 //\r
3ec2611d
LG
342 // Signal all the EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE events.\r
343 // All runtime events are stored in a list in Runtime AP.\r
878ddf1f 344 //\r
3ec2611d
LG
345 for (Link = mRuntime.EventHead.ForwardLink; Link != &mRuntime.EventHead; Link = Link->ForwardLink) {\r
346 RuntimeEvent = _CR (Link, EFI_RUNTIME_EVENT_ENTRY, Link);\r
878ddf1f 347 if ((RuntimeEvent->Type & EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE) == EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE) {\r
348 RuntimeEvent->NotifyFunction (\r
349 RuntimeEvent->Event,\r
350 RuntimeEvent->NotifyContext\r
351 );\r
352 }\r
353 }\r
3ec2611d 354\r
878ddf1f 355 //\r
3ec2611d 356 // Relocate runtime images. All runtime images are stored in a list in Runtime AP.\r
878ddf1f 357 //\r
3ec2611d
LG
358 for (Link = mRuntime.ImageHead.ForwardLink; Link != &mRuntime.ImageHead; Link = Link->ForwardLink) {\r
359 RuntimeImage = _CR (Link, EFI_RUNTIME_IMAGE_ENTRY, Link);\r
360 //\r
361 // We don't want to relocate our selves, as we only run in physical mode.\r
362 //\r
363 if (mMyImageBase != RuntimeImage->ImageBase) {\r
2ce31132 364\r
3ec2611d 365 VirtImageBase = (EFI_PHYSICAL_ADDRESS) (UINTN) RuntimeImage->ImageBase;\r
2ce31132 366 Status = RuntimeDriverConvertPointer (0, (VOID **) &VirtImageBase);\r
367 ASSERT_EFI_ERROR (Status);\r
368\r
369 PeCoffLoaderRelocateImageForRuntime (\r
3ec2611d 370 (EFI_PHYSICAL_ADDRESS) (UINTN) RuntimeImage->ImageBase,\r
2ce31132 371 VirtImageBase,\r
3ec2611d 372 (UINTN) RuntimeImage->ImageSize,\r
2ce31132 373 RuntimeImage->RelocationData\r
374 );\r
375 \r
3ec2611d 376 InvalidateInstructionCacheRange (RuntimeImage->ImageBase, (UINTN)RuntimeImage->ImageSize);\r
878ddf1f 377 }\r
378 }\r
3ec2611d 379\r
878ddf1f 380 //\r
381 // Convert all the Runtime Services except ConvertPointer() and SetVirtualAddressMap()\r
382 // and recompute the CRC-32\r
383 //\r
384 RuntimeDriverConvertInternalPointer ((VOID **) &gRT->GetTime);\r
385 RuntimeDriverConvertInternalPointer ((VOID **) &gRT->SetTime);\r
386 RuntimeDriverConvertInternalPointer ((VOID **) &gRT->GetWakeupTime);\r
387 RuntimeDriverConvertInternalPointer ((VOID **) &gRT->SetWakeupTime);\r
388 RuntimeDriverConvertInternalPointer ((VOID **) &gRT->ResetSystem);\r
3ec2611d
LG
389#if (EFI_SPECIFICATION_VERSION < 0x00020000)\r
390 RuntimeDriverConvertInternalPointer ((VOID **) &gRT->ReportStatusCode);\r
391#endif\r
878ddf1f 392 RuntimeDriverConvertInternalPointer ((VOID **) &gRT->GetNextHighMonotonicCount);\r
393 RuntimeDriverConvertInternalPointer ((VOID **) &gRT->GetVariable);\r
394 RuntimeDriverConvertInternalPointer ((VOID **) &gRT->SetVariable);\r
395 RuntimeDriverConvertInternalPointer ((VOID **) &gRT->GetNextVariableName);\r
045f4521 396#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
397 RuntimeDriverConvertInternalPointer ((VOID **) &gRT->QueryVariableInfo);\r
398 RuntimeDriverConvertInternalPointer ((VOID **) &gRT->UpdateCapsule);\r
399 RuntimeDriverConvertInternalPointer ((VOID **) &gRT->QueryCapsuleCapabilities);\r
400#endif\r
878ddf1f 401 RuntimeDriverCalculateEfiHdrCrc (&gRT->Hdr);\r
402\r
403 //\r
404 // Convert the UGA OS Handoff Table if it is present in the Configuration Table\r
405 //\r
406 for (Index = 0; Index < gST->NumberOfTableEntries; Index++) {\r
3ec2611d 407 if (CompareGuid (&gEfiUgaIoProtocolGuid, &(gST->ConfigurationTable[Index].VendorGuid))) {\r
878ddf1f 408 DriverOsHandoffHeader = gST->ConfigurationTable[Index].VendorTable;\r
409 for (Index1 = 0; Index1 < DriverOsHandoffHeader->NumberOfEntries; Index1++) {\r
410 DriverOsHandoff = (EFI_DRIVER_OS_HANDOFF *)\r
411 (\r
412 (UINTN) DriverOsHandoffHeader +\r
413 DriverOsHandoffHeader->HeaderSize +\r
414 Index1 *\r
415 DriverOsHandoffHeader->SizeOfEntries\r
416 );\r
417 RuntimeDriverConvertPointer (EFI_OPTIONAL_POINTER, (VOID **) &DriverOsHandoff->DevicePath);\r
418 RuntimeDriverConvertPointer (EFI_OPTIONAL_POINTER, (VOID **) &DriverOsHandoff->PciRomImage);\r
419 }\r
420\r
421 RuntimeDriverConvertPointer (EFI_OPTIONAL_POINTER, (VOID **) &(gST->ConfigurationTable[Index].VendorTable));\r
422 }\r
3ec2611d 423\r
045f4521 424#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
3ec2611d 425 if (CompareGuid (&gEfiCapsuleGuid, &(gST->ConfigurationTable[Index].VendorGuid))) {\r
045f4521 426 CapsuleTable = gST->ConfigurationTable[Index].VendorTable;\r
427 for (Index1 = 0; Index1 < CapsuleTable->CapsuleArrayNumber; Index1++) {\r
428 RuntimeDriverConvertPointer (EFI_OPTIONAL_POINTER, (VOID **) &CapsuleTable->CapsulePtr[Index1]);\r
429 } \r
430 RuntimeDriverConvertPointer (EFI_OPTIONAL_POINTER, (VOID **) &(gST->ConfigurationTable[Index].VendorTable));\r
431 }\r
432#endif\r
878ddf1f 433 }\r
434 //\r
435 // Convert the runtime fields of the EFI System Table and recompute the CRC-32\r
436 //\r
437 RuntimeDriverConvertInternalPointer ((VOID **) &gST->FirmwareVendor);\r
438 RuntimeDriverConvertInternalPointer ((VOID **) &gST->ConfigurationTable);\r
439 RuntimeDriverConvertInternalPointer ((VOID **) &gST->RuntimeServices);\r
440 RuntimeDriverCalculateEfiHdrCrc (&gST->Hdr);\r
441\r
442 //\r
443 // At this point, gRT and gST are physical pointers, but the contents of these tables\r
444 // have been converted to runtime.\r
445 //\r
446 //\r
447 // mVirtualMap is only valid during SetVirtualAddressMap() call\r
448 //\r
449 mVirtualMap = NULL;\r
450\r
451 return EFI_SUCCESS;\r
452}\r
453\r
454EFI_STATUS\r
455EFIAPI\r
456RuntimeDriverInitialize (\r
457 IN EFI_HANDLE ImageHandle,\r
458 IN EFI_SYSTEM_TABLE *SystemTable\r
459 )\r
460/*++\r
461\r
462Routine Description:\r
463 Install Runtime AP. This code includes the EfiDriverLib, but it functions at\r
464 RT in physical mode. The only Lib services are gBS, gRT, and the DEBUG and\r
465 ASSERT macros (they do ReportStatusCode).\r
466\r
467Arguments:\r
468 (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r
469\r
470Returns:\r
471\r
472 EFI_SUCEESS - Runtime Driver Architectural Protocol Installed\r
473\r
474 Other - Return value from gBS->InstallMultipleProtocolInterfaces\r
475\r
476--*/\r
477{\r
3ec2611d
LG
478 EFI_STATUS Status;\r
479 EFI_LOADED_IMAGE_PROTOCOL *MyLoadedImage;\r
878ddf1f 480\r
481 //\r
482 // This image needs to be exclued from relocation for virtual mode, so cache\r
483 // a copy of the Loaded Image protocol to test later.\r
484 //\r
485 Status = gBS->HandleProtocol (\r
486 ImageHandle,\r
487 &gEfiLoadedImageProtocolGuid,\r
ddb3d91c 488 (VOID**)&MyLoadedImage\r
878ddf1f 489 );\r
490 ASSERT_EFI_ERROR (Status);\r
3ec2611d 491 mMyImageBase = MyLoadedImage->ImageBase;\r
878ddf1f 492\r
493 //\r
494 // Initialize the table used to compute 32-bit CRCs\r
495 //\r
496 RuntimeDriverInitializeCrc32Table ();\r
497\r
498 //\r
499 // Fill in the entries of the EFI Boot Services and EFI Runtime Services Tables\r
500 //\r
3ec2611d 501 gBS->CalculateCrc32 = RuntimeDriverCalculateCrc32;\r
878ddf1f 502 gRT->SetVirtualAddressMap = RuntimeDriverSetVirtualAddressMap;\r
503 gRT->ConvertPointer = RuntimeDriverConvertPointer;\r
504\r
505 //\r
506 // Install the Runtime Architectural Protocol onto a new handle\r
507 //\r
508 Status = gBS->InstallMultipleProtocolInterfaces (\r
509 &mRuntimeHandle,\r
510 &gEfiRuntimeArchProtocolGuid,\r
511 &mRuntime,\r
512 NULL\r
513 );\r
514 ASSERT_EFI_ERROR (Status);\r
3ec2611d
LG
515 \r
516 return EFI_SUCCESS;\r
878ddf1f 517}\r