Changeset 16005 in vbox
- Timestamp:
- Jan 16, 2009 9:48:26 PM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevACPI.cpp
r14976 r16005 66 66 #define SYSI_DATA 0x0000404c 67 67 #define ACPI_RESET_BLK 0x00004050 68 #define FDC_STATUS 0x0000405469 68 70 69 /* PM1x status register bits */ … … 132 131 SYSTEM_INFO_INDEX_MEMORY_LENGTH = 0, 133 132 SYSTEM_INFO_INDEX_USE_IOAPIC = 1, 134 SYSTEM_INFO_INDEX_LAST = 2, 133 SYSTEM_INFO_INDEX_HPET_STATUS = 2, 134 SYSTEM_INFO_INDEX_SMC_STATUS = 3, 135 SYSTEM_INFO_INDEX_FDC_STATUS = 4, 136 SYSTEM_INFO_INDEX_LAST = 5, 135 137 SYSTEM_INFO_INDEX_INVALID = 0x80, 136 138 SYSTEM_INFO_INDEX_VALID = 0x200 … … 196 198 /** Pointer to the driver connector interface */ 197 199 R3PTRTYPE(PPDMIACPICONNECTOR) pDrv; 200 201 /* If High Precision Event Timer device should be supported */ 202 uint8_t u8UseHpet; 203 /* If System Management Controller device should be supported */ 204 uint8_t u8UseSmc; 205 206 uint32_t Alignment0; /**< Structure size alignment. */ 198 207 }; 199 208 … … 533 542 IO_WRITE_PROTO (acpiBatIndexWrite); 534 543 IO_READ_PROTO (acpiBatDataRead); 535 IO_READ_PROTO (acpiFdcStatusRead);536 544 IO_READ_PROTO (acpiSysInfoDataRead); 537 545 IO_WRITE_PROTO (acpiSysInfoDataWrite); … … 1246 1254 } 1247 1255 1248 IO_READ_PROTO (acpiFdcStatusRead)1249 {1250 ACPIState *s = (ACPIState *)pvUser;1251 1252 switch (cb)1253 {1254 case 4:1255 *pu32 = s->u8UseFdc1256 ? STA_DEVICE_PRESENT_MASK /* present */1257 | STA_DEVICE_ENABLED_MASK /* enabled and decodes its resources */1258 | STA_DEVICE_SHOW_IN_UI_MASK /* should be shown in UI */1259 | STA_DEVICE_FUNCTIONING_PROPERLY_MASK /* functioning properly */1260 : 0; /* device not present */1261 break;1262 default:1263 return VERR_IOM_IOPORT_UNUSED;1264 }1265 return VINF_SUCCESS;1266 }1267 1268 1256 IO_WRITE_PROTO (acpiSysInfoIndexWrite) 1269 1257 { … … 1277 1265 else 1278 1266 { 1267 /* see comment at the declaration of u8IndexShift */ 1268 if (s->u8IndexShift == 0) 1269 { 1270 uint32_t u32Index; 1271 for (u32Index = 0; u32Index < SYSTEM_INFO_INDEX_LAST; u32Index++) 1272 { 1273 if (u32 == (u32Index << 2)) 1274 { 1275 s->u8IndexShift = 2; 1276 break; 1277 } 1278 } 1279 } 1279 1280 u32 >>= s->u8IndexShift; 1280 1281 Assert (u32 < SYSTEM_INFO_INDEX_LAST); … … 1293 1294 { 1294 1295 ACPIState *s = (ACPIState *)pvUser; 1295 1296 1296 1297 switch (cb) 1297 1298 { 1298 case 4: 1299 case 4: 1299 1300 switch (s->uSystemInfoIndex) 1300 1301 { … … 1306 1307 *pu32 = s->u8UseIOApic; 1307 1308 break; 1309 1310 case SYSTEM_INFO_INDEX_HPET_STATUS: 1311 *pu32 = s->u8UseHpet ? 0xf : 0; 1312 break; 1308 1313 1314 case SYSTEM_INFO_INDEX_SMC_STATUS: 1315 *pu32 = s->u8UseSmc ? 0xb : 0; /* No need to show in UI */ 1316 break; 1317 1318 case SYSTEM_INFO_INDEX_FDC_STATUS: 1319 *pu32 = s->u8UseFdc ? 0xf : 0; 1320 break; 1321 1309 1322 /* Solaris 9 tries to read from this index */ 1310 1323 case SYSTEM_INFO_INDEX_INVALID: … … 1754 1767 "GCEnabled\0" 1755 1768 "R0Enabled\0" 1756 "FdcEnabled\0")) 1769 "FdcEnabled\0" 1770 "HpetEnabled\0" 1771 "SmcEnabled\0")) 1757 1772 return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES, 1758 1773 N_("Configuration error: Invalid config key for ACPI device")); … … 1767 1782 return PDMDEV_SET_ERROR(pDevIns, rc, 1768 1783 N_("Configuration error: Failed to read \"IOAPIC\"")); 1784 1785 /* query whether we are supposed to present HPET */ 1786 rc = CFGMR3QueryU8Def (pCfgHandle, "HpetEnabled", &s->u8UseHpet, 0); 1787 if (RT_FAILURE(rc)) 1788 return PDMDEV_SET_ERROR(pDevIns, rc, 1789 N_("Configuration error: Failed to read \"HpetEnabled\"")); 1790 /* query whether we are supposed to present SMC */ 1791 rc = CFGMR3QueryU8Def (pCfgHandle, "SmcEnabled", &s->u8UseSmc, 0); 1792 if (RT_FAILURE(rc)) 1793 return PDMDEV_SET_ERROR(pDevIns, rc, 1794 N_("Configuration error: Failed to read \"SmcEnabled\"")); 1769 1795 1770 1796 rc = CFGMR3QueryU16Def(pCfgHandle, "NumCPUs", &s->cCpus, 1); … … 1831 1857 R (SYSI_INDEX, 1, acpiSysInfoIndexWrite, NULL, "ACPI system info index"); 1832 1858 R (SYSI_DATA, 1, acpiSysInfoDataWrite, acpiSysInfoDataRead, "ACPI system info data"); 1833 R (FDC_STATUS, 1, NULL, acpiFdcStatusRead, "ACPI FDC status index");1834 1859 R (GPE0_BLK + L, L, acpiGpe0EnWrite, acpiGpe0EnRead, "ACPI GPE0 Enable"); 1835 1860 R (GPE0_BLK, L, acpiGpe0StsWrite, acpiGpe0StsRead, "ACPI GPE0 Status"); -
trunk/src/VBox/Devices/PC/vbox.dsl
r15008 r16005 130 130 Scope (\_SB) 131 131 { 132 OperationRegion (SYSI, SystemIO, 0x4048, 0x 08)132 OperationRegion (SYSI, SystemIO, 0x4048, 0x8) 133 133 Field (SYSI, DwordAcc, NoLock, Preserve) 134 134 { … … 141 141 MEML, 32, 142 142 UIOA, 32, 143 UHPT, 32, 144 USMC, 32, 145 UFDC, 32, 143 146 Offset (0x80), 144 147 ININ, 32, … … 154 157 DBG ("UIOA: ") 155 158 HEX4 (UIOA) 159 DBG ("UHPT: ") 160 HEX4 (UHPT) 161 DBG ("USMC: ") 162 HEX4 (USMC) 163 DBG ("UFDC: ") 164 HEX4 (UFDC) 156 165 } 157 166 … … 489 498 IRQ (Level, ActiveLow, Shared) {5,9,10,11} 490 499 }) 500 501 // High Precision Event Timer 502 Device (HPET) 503 { 504 Name (_HID, EisaId ("PNP0103")) 505 Name (_CID, 0x010CD041) 506 Name (BUF0, ResourceTemplate () 507 { 508 IRQNoFlags () 509 {2} 510 IRQNoFlags () 511 {8} 512 Memory32Fixed (ReadOnly, 513 0xFED00000, // Address Base 514 0x00000400, // Address Length 515 _Y16) 516 }) 517 Method (_STA, 0, NotSerialized) 518 { 519 Return (UHPT) 520 } 521 Method (_CRS, 0, Serialized) 522 { 523 Return (BUF0) 524 } 525 } 526 527 // System Management Controller 528 Device (SMC) 529 { 530 Name (_HID, EisaId ("APP0001")) 531 Name (_CID, "smc-napa") 532 533 Method (_STA, 0, NotSerialized) 534 { 535 Return (USMC) 536 } 537 Name (_CRS, ResourceTemplate () 538 { 539 IO (Decode16, 540 0x0300, // Range Minimum 541 0x0300, // Range Maximum 542 0x01, // Alignment 543 0x20, // Length 544 ) 545 IRQNoFlags () 546 {6} 547 }) 548 } 549 491 550 492 551 // PCI bus 0 … … 564 623 Name (_HID, EisaId ("PNP0700")) 565 624 566 OperationRegion (CFDC, SystemIO, 0x4054, 0x08)567 Field (CFDC, DwordAcc, NoLock, Preserve)568 {569 FSTA, 32,570 }571 572 625 Method (_STA, 0, NotSerialized) 573 626 { 574 Return (FSTA)627 Return (UFDC) 575 628 } 576 577 629 // Current resource settings 578 630 Name (_CRS, ResourceTemplate () -
trunk/src/VBox/Devices/testcase/tstDeviceStructSizeGC.cpp
r15879 r16005 447 447 GEN_CHECK_OFF(ACPIState, pDrvBase); 448 448 GEN_CHECK_OFF(ACPIState, pDrv); 449 GEN_CHECK_OFF(ACPIState, u8UseHpet); 450 GEN_CHECK_OFF(ACPIState, u8UseSmc); 449 451 450 452 /* PC/DevPIC.cpp */ -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r15708 r16005 558 558 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK(); 559 559 rc = CFGMR3InsertInteger(pCfg, "FdcEnabled", fFdcEnabled); RC_CHECK(); 560 rc = CFGMR3InsertInteger(pCfg, "HpetEnabled", 0); RC_CHECK(); 561 rc = CFGMR3InsertInteger(pCfg, "SmcEnabled", 0); RC_CHECK(); 560 562 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 7); RC_CHECK(); 561 563 Assert(!afPciDeviceNo[7]);
Note:
See TracChangeset
for help on using the changeset viewer.