Changeset 17590 in vbox for trunk/src/VBox/Devices/PC
- Timestamp:
- Mar 9, 2009 4:15:51 PM (16 years ago)
- Location:
- trunk/src/VBox/Devices/PC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevACPI.cpp
r17572 r17590 130 130 enum 131 131 { 132 SYSTEM_INFO_INDEX_ MEMORY_LENGTH= 0,132 SYSTEM_INFO_INDEX_LOW_MEMORY_LENGTH = 0, 133 133 SYSTEM_INFO_INDEX_USE_IOAPIC = 1, 134 134 SYSTEM_INFO_INDEX_HPET_STATUS = 2, … … 139 139 SYSTEM_INFO_INDEX_CPU2_STATUS = 7, 140 140 SYSTEM_INFO_INDEX_CPU3_STATUS = 8, 141 SYSTEM_INFO_INDEX_LAST = 9, 141 SYSTEM_INFO_INDEX_HIGH_MEMORY_LENGTH= 9, 142 SYSTEM_INFO_INDEX_END = 10, 142 143 SYSTEM_INFO_INDEX_INVALID = 0x80, 143 144 SYSTEM_INFO_INDEX_VALID = 0x200 … … 184 185 unsigned int uSystemInfoIndex; 185 186 uint64_t u64RamSize; 187 /** The number of bytes above 4GB. */ 188 uint64_t cbRamHigh; 189 /** The number of bytes below 4GB. */ 190 uint32_t cbRamLow; 186 191 187 192 /** Current ACPI S* state. We support S0 and S5 */ … … 209 214 bool fShowCpu; 210 215 /** Aligning IBase. */ 211 bool afAlignment[ 2];216 bool afAlignment[6]; 212 217 213 218 /** ACPI port base interface. */ … … 1292 1297 if (s->u8IndexShift == 0) 1293 1298 { 1294 if (((u32 >> 2) < SYSTEM_INFO_INDEX_ LAST) && ((u32 & 0x3)) == 0)1299 if (((u32 >> 2) < SYSTEM_INFO_INDEX_END) && ((u32 & 0x3)) == 0) 1295 1300 { 1296 1301 s->u8IndexShift = 2; … … 1299 1304 1300 1305 u32 >>= s->u8IndexShift; 1301 Assert(u32 < SYSTEM_INFO_INDEX_ LAST);1306 Assert(u32 < SYSTEM_INFO_INDEX_END); 1302 1307 s->uSystemInfoIndex = u32; 1303 1308 } … … 1320 1325 switch (s->uSystemInfoIndex) 1321 1326 { 1322 case SYSTEM_INFO_INDEX_MEMORY_LENGTH: 1323 *pu32 = s->u64RamSize; 1327 case SYSTEM_INFO_INDEX_LOW_MEMORY_LENGTH: 1328 *pu32 = s->cbRamLow; 1329 break; 1330 1331 case SYSTEM_INFO_INDEX_HIGH_MEMORY_LENGTH: 1332 *pu32 = s->cbRamHigh; 1324 1333 break; 1325 1334 … … 1747 1756 return PDMDEV_SET_ERROR(s->pDevIns, rc, 1748 1757 N_("Configuration error: Querying \"RamHoleSize\" as integer failed")); 1758 1759 /* 1760 * Calc the sizes for the high and low regions. 1761 */ 1749 1762 const uint64_t offRamHole = _4G - cbRamHole; 1750 1751 #if 0 /** @todo 4GB: This needs adjusting fixing! I've disabled it to test big mem configs. */ 1752 if (s->u64RamSize > UINT32_C(0xffffffff) - UINT32_C(0x10000)) 1753 return PDMDEV_SET_ERROR(s->pDevIns, VERR_OUT_OF_RANGE, 1754 N_("Configuration error: Invalid \"RamSize\", maximum allowed " 1755 "value is 4095MB")); 1756 #endif 1763 s->cbRamHigh = offRamHole < s->u64RamSize ? s->u64RamSize - offRamHole : 0; 1764 uint64_t cbRamLow = offRamHole < s->u64RamSize ? offRamHole : s->u64RamSize; 1765 if (cbRamLow > UINT32_C(0xffe00000)) /* See MEM3. */ 1766 { 1767 /** @todo Do this in the E820 table/CMOS as well or things won't work right. */ 1768 LogRel(("DevACPI: Clipping cbRamLow=%#RX64 down to 0xffe00000.\n", cbRamLow)); 1769 cbRamLow = UINT32_C(0xffe00000); 1770 } 1771 s->cbRamLow = (uint32_t)cbRamLow; 1757 1772 1758 1773 rsdt_addr = 0; … … 1784 1799 1785 1800 Log(("RSDP 0x%08X\n", find_rsdp_space())); 1786 #if 1 /** @todo 4GB: Quick hack, may need revising. */ 1787 addend = (uint32_t)RT_MIN(s->u64RamSize, offRamHole) - 0x10000; 1788 #else 1789 addend = (uint32_t)s->u64RamSize - 0x10000; 1790 #endif 1801 addend = s->cbRamLow - 0x10000; 1791 1802 Log(("RSDT 0x%08X XSDT 0x%08X\n", rsdt_addr + addend, xsdt_addr + addend)); 1792 1803 Log(("FACS 0x%08X FADT 0x%08X\n", facs_addr + addend, fadt_addr + addend)); -
trunk/src/VBox/Devices/PC/vbox.dsl
r16746 r17590 130 130 Processor (CPU0, /* Name */ 131 131 0x00, /* Id */ 132 0x0, /* Processor IO ports range start */ 133 0x0 /* Processor IO ports range length */ 134 ) 132 0x0, /* Processor IO ports range start */ 133 0x0 /* Processor IO ports range length */ 134 ) 135 135 { 136 136 Method (_STA) { Return(\_SB.UCP0) } … … 138 138 Processor (CPU1, /* Name */ 139 139 0x01, /* Id */ 140 0x0, /* Processor IO ports range start */ 141 0x0 /* Processor IO ports range length */ 142 ) 140 0x0, /* Processor IO ports range start */ 141 0x0 /* Processor IO ports range length */ 142 ) 143 143 { 144 144 Method (_STA) { Return(\_SB.UCP1) } … … 146 146 Processor (CPU2, /* Name */ 147 147 0x02, /* Id */ 148 0x0, /* Processor IO ports range start */ 149 0x0 /* Processor IO ports range length */ 150 ) 148 0x0, /* Processor IO ports range start */ 149 0x0 /* Processor IO ports range length */ 150 ) 151 151 { 152 152 Method (_STA) { Return(\_SB.UCP2) } … … 154 154 Processor (CPU3, /* Name */ 155 155 0x03, /* Id */ 156 0x0, /* Processor IO ports range start */ 157 0x0 /* Processor IO ports range length */ 158 ) 156 0x0, /* Processor IO ports range start */ 157 0x0 /* Processor IO ports range length */ 158 ) 159 159 { 160 160 Method (_STA) { Return(\_SB.UCP3) } … … 183 183 UCP2, 32, 184 184 UCP3, 32, 185 MEMH, 32, 185 186 Offset (0x80), 186 187 ININ, 32, … … 204 205 DBG ("UCP0: ") 205 206 HEX4 (UCP0) 207 DBG ("MEMH: ") 208 HEX4 (MEMH) 206 209 } 207 210 … … 862 865 863 866 DwordMemory( // Consumed-and-produced resource 864 // (all of memory space)867 // (all of low memory space) 865 868 ResourceProducer, // bit 0 of general flags is 0 866 869 PosDecode, // positive Decode … … 872 875 0x00000000, // Min (calculated dynamically) 873 876 874 0xffdfffff, // 877 0xffdfffff, // Max = 4GB - 2MB 875 878 0x00000000, // Translation 876 879 0xdfdfffff, // Range Length (calculated … … 883 886 }) 884 887 888 Name (TOM, ResourceTemplate () // Memory above 4GB (aka high), appended when needed. 889 { 890 QWORDMemory( 891 ResourceProducer, // bit 0 of general flags is 0 892 PosDecode, // positive Decode 893 MinFixed, // Range is fixed 894 MaxFixed, // Range is fixed 895 Cacheable, 896 ReadWrite, 897 0x0000000000000000, // _GRA: Granularity. 898 0x0000000100000000, // _LEN: Min address, 4GB. 899 0x00000fffffffffff, // _MAX: Max possible address, 16TB. 900 0x0000000000000000, // _TRA: Translation 901 0x0000000000000000, // _LEN: Range length (calculated dynamically) 902 , // ResourceSourceIndex: Optional field left blank 903 , // ResourceSource: Optional field left blank 904 MEM4 // Name declaration for this descriptor. 905 ) 906 }) 907 885 908 Method (_CRS, 0, NotSerialized) 886 909 { 887 910 CreateDwordField (CRS, \_SB.PCI0.MEM3._MIN, RAMT) 888 911 CreateDwordField (CRS, \_SB.PCI0.MEM3._LEN, RAMR) 912 CreateDwordField (TOM, \_SB.PCI0.MEM4._LEN, TM4L) 913 889 914 Store (MEML, RAMT) 890 915 Subtract (0xffe00000, RAMT, RAMR) 916 917 If (LNotEqual (MEMH, 0x00000000)) 918 { 919 // 920 // Update the TOM resource template and append it to CRS. 921 // This way old < 4GB guest doesn't see anything different. 922 // (MEMH is the memory above 4GB specified in 64KB units.) 923 // 924 ShiftLeft (MEMH, 16, Local0) 925 Store (Local0, TM4L) 926 ConcatenateResTemplate (CRS, TOM, Local1) 927 Return (Local1) 928 } 929 891 930 Return (CRS) 892 931 } … … 915 954 }) 916 955 } 917 956 918 957 // System Management Controller 919 958 Device (SMC) … … 934 973 0x20, // Length 935 974 ) 936 // This line seriously confuses Windows ACPI driver, so not even try to 975 // This line seriously confuses Windows ACPI driver, so not even try to 937 976 // enable SMC for Windows guests 938 977 IRQNoFlags () {8}
Note:
See TracChangeset
for help on using the changeset viewer.