Changeset 16039 in vbox
- Timestamp:
- Jan 19, 2009 11:06:41 AM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevACPI.cpp
r16033 r16039 66 66 #define SYSI_DATA 0x0000404c 67 67 #define ACPI_RESET_BLK 0x00004050 68 #define FDC_STATUS 0x00004054 68 69 69 70 /* PM1x status register bits */ … … 131 132 SYSTEM_INFO_INDEX_MEMORY_LENGTH = 0, 132 133 SYSTEM_INFO_INDEX_USE_IOAPIC = 1, 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, 134 SYSTEM_INFO_INDEX_LAST = 2, 137 135 SYSTEM_INFO_INDEX_INVALID = 0x80, 138 136 SYSTEM_INFO_INDEX_VALID = 0x200 … … 145 143 #define BAT_TECH_SECONDARY 2 146 144 147 #define STA_DEVICE_PRESENT_MASK RT_BIT(0) /**< present */148 #define STA_DEVICE_ENABLED_MASK RT_BIT(1) /**< enabled and decodes its resources */149 #define STA_DEVICE_SHOW_IN_UI_MASK RT_BIT(2) /**< should be shown in UI */150 #define STA_DEVICE_FUNCTIONING_PROPERLY_MASK RT_BIT(3) /**< functioning properly */151 #define STA_BATTERY_PRESENT_MASK RT_BIT(4) /**< the battery is present */145 #define STA_DEVICE_PRESENT_MASK RT_BIT(0) 146 #define STA_DEVICE_ENABLED_MASK RT_BIT(1) 147 #define STA_DEVICE_SHOW_IN_UI_MASK RT_BIT(2) 148 #define STA_DEVICE_FUNCTIONING_PROPERLY_MASK RT_BIT(3) 149 #define STA_BATTERY_PRESENT_MASK RT_BIT(4) 152 150 153 151 struct ACPIState … … 198 196 /** Pointer to the driver connector interface */ 199 197 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. */207 198 }; 208 199 … … 542 533 IO_WRITE_PROTO (acpiBatIndexWrite); 543 534 IO_READ_PROTO (acpiBatDataRead); 535 IO_READ_PROTO (acpiFdcStatusRead); 544 536 IO_READ_PROTO (acpiSysInfoDataRead); 545 537 IO_WRITE_PROTO (acpiSysInfoDataWrite); … … 1254 1246 } 1255 1247 1248 IO_READ_PROTO (acpiFdcStatusRead) 1249 { 1250 ACPIState *s = (ACPIState *)pvUser; 1251 1252 switch (cb) 1253 { 1254 case 4: 1255 *pu32 = s->u8UseFdc 1256 ? 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 1256 1268 IO_WRITE_PROTO (acpiSysInfoIndexWrite) 1257 1269 { … … 1265 1277 else 1266 1278 { 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 }1280 1279 u32 >>= s->u8IndexShift; 1281 1280 Assert (u32 < SYSTEM_INFO_INDEX_LAST); … … 1294 1293 { 1295 1294 ACPIState *s = (ACPIState *)pvUser; 1296 1295 1297 1296 switch (cb) 1298 1297 { 1299 case 4: 1298 case 4: 1300 1299 switch (s->uSystemInfoIndex) 1301 1300 { … … 1307 1306 *pu32 = s->u8UseIOApic; 1308 1307 break; 1309 1310 case SYSTEM_INFO_INDEX_HPET_STATUS:1311 *pu32 = s->u8UseHpet ? ( STA_DEVICE_PRESENT_MASK1312 | STA_DEVICE_ENABLED_MASK1313 | STA_DEVICE_SHOW_IN_UI_MASK1314 | STA_DEVICE_FUNCTIONING_PROPERLY_MASK)1315 : 0;1316 break;1317 1308 1318 case SYSTEM_INFO_INDEX_SMC_STATUS:1319 *pu32 = s->u8UseSmc ? ( STA_DEVICE_PRESENT_MASK1320 | STA_DEVICE_ENABLED_MASK1321 /* no need to show this device in the UI */1322 | STA_DEVICE_FUNCTIONING_PROPERLY_MASK)1323 : 0;1324 break;1325 1326 case SYSTEM_INFO_INDEX_FDC_STATUS:1327 *pu32 = s->u8UseFdc ? ( STA_DEVICE_PRESENT_MASK1328 | STA_DEVICE_ENABLED_MASK1329 | STA_DEVICE_SHOW_IN_UI_MASK1330 | STA_DEVICE_FUNCTIONING_PROPERLY_MASK)1331 : 0;1332 break;1333 1334 1309 /* Solaris 9 tries to read from this index */ 1335 1310 case SYSTEM_INFO_INDEX_INVALID: … … 1779 1754 "GCEnabled\0" 1780 1755 "R0Enabled\0" 1781 "FdcEnabled\0" 1782 "HpetEnabled\0" 1783 "SmcEnabled\0")) 1756 "FdcEnabled\0")) 1784 1757 return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES, 1785 1758 N_("Configuration error: Invalid config key for ACPI device")); … … 1794 1767 return PDMDEV_SET_ERROR(pDevIns, rc, 1795 1768 N_("Configuration error: Failed to read \"IOAPIC\"")); 1796 1797 /* query whether we are supposed to present HPET */1798 rc = CFGMR3QueryU8Def (pCfgHandle, "HpetEnabled", &s->u8UseHpet, 0);1799 if (RT_FAILURE(rc))1800 return PDMDEV_SET_ERROR(pDevIns, rc,1801 N_("Configuration error: Failed to read \"HpetEnabled\""));1802 /* query whether we are supposed to present SMC */1803 rc = CFGMR3QueryU8Def (pCfgHandle, "SmcEnabled", &s->u8UseSmc, 0);1804 if (RT_FAILURE(rc))1805 return PDMDEV_SET_ERROR(pDevIns, rc,1806 N_("Configuration error: Failed to read \"SmcEnabled\""));1807 1769 1808 1770 rc = CFGMR3QueryU16Def(pCfgHandle, "NumCPUs", &s->cCpus, 1); … … 1869 1831 R (SYSI_INDEX, 1, acpiSysInfoIndexWrite, NULL, "ACPI system info index"); 1870 1832 R (SYSI_DATA, 1, acpiSysInfoDataWrite, acpiSysInfoDataRead, "ACPI system info data"); 1833 R (FDC_STATUS, 1, NULL, acpiFdcStatusRead, "ACPI FDC status index"); 1871 1834 R (GPE0_BLK + L, L, acpiGpe0EnWrite, acpiGpe0EnRead, "ACPI GPE0 Enable"); 1872 1835 R (GPE0_BLK, L, acpiGpe0StsWrite, acpiGpe0StsRead, "ACPI GPE0 Status"); … … 1904 1867 1905 1868 dev = &s->dev; 1906 PCIDevSetVendorId(dev, 0x8086); /* Intel */ 1907 PCIDevSetDeviceId(dev, 0x7113); /* 82371AB */ 1908 1909 dev->config[0x04] = 0x01; /* command */ 1869 dev->config[0x00] = 0x86; 1870 dev->config[0x01] = 0x80; 1871 1872 dev->config[0x02] = 0x13; 1873 dev->config[0x03] = 0x71; 1874 1875 dev->config[0x04] = 0x01; 1910 1876 dev->config[0x05] = 0x00; 1911 1877 1912 dev->config[0x06] = 0x80; /* status */1878 dev->config[0x06] = 0x80; 1913 1879 dev->config[0x07] = 0x02; 1914 1880 dev->config[0x08] = 0x08; -
trunk/src/VBox/Devices/PC/vbox.dsl
r16005 r16039 130 130 Scope (\_SB) 131 131 { 132 OperationRegion (SYSI, SystemIO, 0x4048, 0x 8)132 OperationRegion (SYSI, SystemIO, 0x4048, 0x08) 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,146 143 Offset (0x80), 147 144 ININ, 32, … … 157 154 DBG ("UIOA: ") 158 155 HEX4 (UIOA) 159 DBG ("UHPT: ")160 HEX4 (UHPT)161 DBG ("USMC: ")162 HEX4 (USMC)163 DBG ("UFDC: ")164 HEX4 (UFDC)165 156 } 166 157 … … 239 230 Package (0x04) {0x000FFFFF, 0x03, LNKB, 0x00,}, 240 231 232 /* Disabled atm because Vista wants a reactivation 241 233 Package (0x04) {0x0010FFFF, 0x00, LNKD, 0x00,}, 242 234 Package (0x04) {0x0010FFFF, 0x01, LNKA, 0x00,}, … … 318 310 Package (0x04) {0x001FFFFF, 0x02, LNKA, 0x00,}, 319 311 Package (0x04) {0x001FFFFF, 0x03, LNKB, 0x00,} 312 */ 320 313 }) 321 314 … … 394 387 Package (0x04) {0x000FFFFF, 0x03, 0x00, 0x12,}, 395 388 389 /* Disabled atm because Vista wants a reactivation 396 390 Package (0x04) {0x0010FFFF, 0x00, 0x00, 0x10,}, 397 391 Package (0x04) {0x0010FFFF, 0x01, 0x00, 0x11,}, … … 473 467 Package (0x04) {0x001FFFFF, 0x02, 0x00, 0x11,}, 474 468 Package (0x04) {0x001FFFFF, 0x03, 0x00, 0x12,} 469 */ 475 470 }) 476 471 … … 498 493 IRQ (Level, ActiveLow, Shared) {5,9,10,11} 499 494 }) 500 501 // High Precision Event Timer502 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 Base514 0x00000400, // Address Length515 _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 Controller528 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 Minimum541 0x0300, // Range Maximum542 0x01, // Alignment543 0x20, // Length544 )545 IRQNoFlags ()546 {6}547 })548 }549 550 495 551 496 // PCI bus 0 … … 623 568 Name (_HID, EisaId ("PNP0700")) 624 569 570 OperationRegion (CFDC, SystemIO, 0x4054, 0x08) 571 Field (CFDC, DwordAcc, NoLock, Preserve) 572 { 573 FSTA, 32, 574 } 575 625 576 Method (_STA, 0, NotSerialized) 626 577 { 627 Return (UFDC)578 Return (FSTA) 628 579 } 580 629 581 // Current resource settings 630 582 Name (_CRS, ResourceTemplate () -
trunk/src/VBox/Devices/testcase/tstDeviceStructSizeGC.cpp
r16022 r16039 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);451 449 452 450 /* PC/DevPIC.cpp */ -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r16016 r16039 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();562 560 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 7); RC_CHECK(); 563 561 Assert(!afPciDeviceNo[7]);
Note:
See TracChangeset
for help on using the changeset viewer.