VirtualBox

Changeset 10372 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Jul 8, 2008 2:14:29 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
33012
Message:

disable the floppy controller in the ACPI tables if necessary

Location:
trunk/src/VBox/Devices/PC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevACPI.cpp

    r9212 r10372  
    6767#define SYSI_DATA       0x0000404c
    6868#define ACPI_RESET_BLK  0x00004050
     69#define FDC_STATUS      0x00004054
    6970
    7071/* PM1x status register bits */
     
    185186    uint8_t             u8IndexShift;
    186187    uint8_t             u8UseIOApic;
     188    uint8_t             u8UseFdc;
    187189    bool                fPowerButtonHandled;
    188190
     
    424426IO_WRITE_PROTO (acpiBatIndexWrite);
    425427IO_READ_PROTO  (acpiBatDataRead);
     428IO_READ_PROTO  (acpiFdcStatusRead);
    426429IO_READ_PROTO  (acpiSysInfoDataRead);
    427430IO_WRITE_PROTO (acpiSysInfoDataWrite);
     
    10811084}
    10821085
     1086IO_READ_PROTO (acpiFdcStatusRead)
     1087{
     1088    ACPIState *s = (ACPIState *)pvUser;
     1089
     1090    switch (cb)
     1091    {
     1092        case 4:
     1093            *pu32 = s->u8UseFdc
     1094                ?   STA_DEVICE_PRESENT_MASK                 /* present */
     1095                  | STA_DEVICE_ENABLED_MASK                 /* enabled and decodes its resources */
     1096                  | STA_DEVICE_SHOW_IN_UI_MASK              /* should be shown in UI */
     1097                  | STA_DEVICE_FUNCTIONING_PROPERLY_MASK    /* functioning properly */
     1098                : 0;                                        /* device not present */
     1099            break;
     1100        default:
     1101            return VERR_IOM_IOPORT_UNUSED;
     1102    }
     1103    return VINF_SUCCESS;
     1104}
     1105
    10831106IO_WRITE_PROTO (acpiSysInfoIndexWrite)
    10841107{
     
    15511574
    15521575    /* Validate and read the configuration. */
    1553     if (!CFGMR3AreValuesValid (pCfgHandle, "RamSize\0IOAPIC\0GCEnabled\0R0Enabled\0"))
     1576    if (!CFGMR3AreValuesValid (pCfgHandle, "RamSize\0IOAPIC\0GCEnabled\0R0Enabled\0FdcEnabled\0"))
    15541577        return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES,
    15551578                                N_("Configuration error: Invalid config key for ACPI device"));
     
    15641587        return PDMDEV_SET_ERROR(pDevIns, rc,
    15651588                                N_("Configuration error: Failed to read \"IOAPIC\""));
     1589
     1590    /* query whether we are supposed to present an FDC controller */
     1591    rc = CFGMR3QueryU8 (pCfgHandle, "FdcEnabled", &s->u8UseFdc);
     1592    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
     1593        s->u8UseFdc = 1;
     1594    else if (VBOX_FAILURE (rc))
     1595        return PDMDEV_SET_ERROR(pDevIns, rc,
     1596                                N_("Configuration error: Failed to read \"FdcEnabled\""));
    15661597
    15671598    rc = CFGMR3QueryBool (pCfgHandle, "GCEnabled", &fGCEnabled);
     
    16151646    R (SYSI_INDEX,     1, acpiSysInfoIndexWrite, NULL,                "ACPI system info index");
    16161647    R (SYSI_DATA,      1, acpiSysInfoDataWrite,  acpiSysInfoDataRead, "ACPI system info data");
     1648    R (FDC_STATUS,     1, NULL,                  acpiFdcStatusRead,   "ACPI FDC status index");
    16171649    R (GPE0_BLK + L,   L, acpiGpe0EnWrite,       acpiGpe0EnRead,      "ACPI GPE0 Enable");
    16181650    R (GPE0_BLK,       L, acpiGpe0StsWrite,      acpiGpe0StsRead,     "ACPI GPE0 Status");
  • trunk/src/VBox/Devices/PC/vbox.dsl

    r8207 r10372  
    378378                    Name (_HID, EisaId ("PNP0700"))
    379379
     380                    OperationRegion (CFDC, SystemIO, 0x4054, 0x08)
     381                    Field (CFDC, DwordAcc, NoLock, Preserve)
     382                    {
     383                        FSTA, 32,
     384                    }
     385
     386                    Method (_STA, 0, NotSerialized)
     387                    {
     388                        Return (FSTA)
     389                    }
     390
    380391                    // Current resource settings
    381392                    Name (_CRS, ResourceTemplate ()
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette