Changeset 99452 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Apr 19, 2023 8:08:30 AM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew/OvmfPkg/Library/PlatformInitLib/MemDetect.c
r99451 r99452 44 44 #include <Library/PlatformInitLib.h> 45 45 46 #ifdef VBOX 47 # include "VBoxPkg.h" 48 # include "DevEFI.h" 49 # include "iprt/asm.h" 50 51 static UINT32 52 GetVmVariable(UINT32 Variable, CHAR8 *pbBuf, UINT32 cbBuf) 53 { 54 UINT32 cbVar, offBuf; 55 56 ASMOutU32(EFI_INFO_PORT, Variable); 57 cbVar = ASMInU32(EFI_INFO_PORT); 58 59 for (offBuf = 0; offBuf < cbVar && offBuf < cbBuf; offBuf++) 60 pbBuf[offBuf] = ASMInU8(EFI_INFO_PORT); 61 62 return cbVar; 63 } 64 #endif 65 46 66 #define MEGABYTE_SHIFT 20 47 67 … … 52 72 ) 53 73 { 74 #ifdef VBOX 75 UINT64 McfgBase = 0; 76 #endif 77 54 78 if (PlatformInfoHob->HostBridgeDevId == 0xffff /* microvm */) { 55 79 return; … … 64 88 PlatformGetSystemMemorySizeBelow4gb (PlatformInfoHob); 65 89 90 #ifdef VBOX 91 /* 92 * Need to initialize the dynamic PcdPciExpressBaseAddress here after the low memory 93 * gets known or the UC base address will become wrong. 94 * The HOBs are not created however but this is done in PlatformMemMapInitialization() 95 * which is called later. 96 */ 97 GetVmVariable(EFI_INFO_INDEX_MCFG_BASE, (CHAR8 *)&McfgBase, sizeof(McfgBase)); 98 if (PlatformInfoHob->LowMemory < BASE_2GB) 99 PlatformInfoHob->LowMemory = BASE_2GB; 100 if (McfgBase == 0) 101 McfgBase = PlatformInfoHob->LowMemory; // backward compatibilit with old DevEFI 102 103 PcdSet64S (PcdPciExpressBaseAddress, McfgBase); 104 #endif 105 66 106 if (PlatformInfoHob->HostBridgeDevId == INTEL_Q35_MCH_DEVICE_ID) { 67 107 ASSERT (PcdGet64 (PcdPciExpressBaseAddress) <= MAX_UINT32); 68 //ASSERT (PcdGet64 (PcdPciExpressBaseAddress) >= PlatformInfoHob->LowMemory);108 ASSERT (PcdGet64 (PcdPciExpressBaseAddress) >= PlatformInfoHob->LowMemory); 69 109 70 110 if (PlatformInfoHob->LowMemory <= BASE_2GB) {
Note:
See TracChangeset
for help on using the changeset viewer.