3 Copyright (c) 1998 Intel Corporation
11 EFI Hell to remap runtime address into the new virual address space
12 that was registered by the OS for RT calls.
14 So the code image needs to be relocated. All pointers need to be
15 manually fixed up since the address map changes.
17 GOOD LUCK NOT HAVING BUGS IN YOUR CODE! PLEASE TEST A LOT. MAKE SURE
18 EXIT BOOTSERVICES OVER WRITES ALL BOOTSERVICE MEMORY & DATA SPACES WHEN
28 #pragma RUNTIME_CODE(RtLibEnableVirtualMappings)
32 RtLibEnableVirtualMappings (
36 EFI_CONVERT_POINTER ConvertPointer;
39 // If this copy of the lib is linked into the firmware, then
40 // do not update the pointers yet.
46 // Different components are updating to the new virtual
47 // mappings at differnt times. The only function that
48 // is safe to call at this notification is ConvertAddress
51 ConvertPointer = RT->ConvertPointer;
54 // Fix any pointers that the lib created, that may be needed
58 ConvertPointer (EFI_INTERNAL_PTR, (VOID **)&RT);
59 ConvertPointer (EFI_OPTIONAL_PTR, (VOID **)&LibRuntimeDebugOut);
61 ConvertPointer (EFI_INTERNAL_PTR, (VOID **)&LibRuntimeRaiseTPL);
62 ConvertPointer (EFI_INTERNAL_PTR, (VOID **)&LibRuntimeRestoreTPL);
70 #pragma RUNTIME_CODE(RtConvertList)
75 IN UINTN DebugDisposition,
76 IN OUT LIST_ENTRY *ListHead
81 EFI_CONVERT_POINTER ConvertPointer;
83 ConvertPointer = RT->ConvertPointer;
86 // Convert all the Flink & Blink pointers in the list
91 NextLink = Link->Flink;
94 Link->Flink == ListHead ? DebugDisposition : 0,
99 Link->Blink == ListHead ? DebugDisposition : 0,
100 (VOID **)&Link->Blink
104 } while (Link != ListHead);