VirtualBox

Changeset 16170 in vbox


Ignore:
Timestamp:
Jan 22, 2009 2:40:08 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
41913
Message:

More device work

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/log.h

    r16065 r16170  
    104104    /** KeyBoard Controller Device group. */
    105105    LOG_GROUP_DEV_KBD,
     106    /** Low Pin Count Device group. */
     107    LOG_GROUP_DEV_LPC,
    106108    /** LsiLogic SCSI controller Device group. */
    107109    LOG_GROUP_DEV_LSILOGICSCSI,
     
    359361    "DEV_INIP",     \
    360362    "DEV_KBD",      \
     363    "DEV_LPC",      \
    361364    "DEV_LSILOGICSCSI", \
    362365    "DEV_NE2000",   \
     
    470473/** @} */
    471474#endif
    472 
  • trunk/src/VBox/Devices/Builtins.cpp

    r15963 r16170  
    8484        return rc;
    8585#endif
     86#ifdef VBOX_WITH_SMC
     87    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceSMC);
     88    if (RT_FAILURE(rc))
     89        return rc;
     90#endif
     91#ifdef VBOX_WITH_LPC
     92    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceLPC);
     93    if (RT_FAILURE(rc))
     94        return rc;
     95#endif
    8696    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceMC146818);
    8797    if (RT_FAILURE(rc))
     
    303313}
    304314#endif
    305 
  • trunk/src/VBox/Devices/Builtins.h

    r16031 r16170  
    7676extern const PDMDEVREG g_DeviceSMC;
    7777#endif
     78#ifdef VBOX_WITH_LPC
     79extern const PDMDEVREG g_DeviceLPC;
     80#endif
    7881
    7982extern const PDMDRVREG g_DrvMouseQueue;
  • trunk/src/VBox/Devices/Makefile.kmk

    r16064 r16170  
    338338endif
    339339
     340ifdef VBOX_WITH_LPC
     341DevicesR3_DEFS          += VBOX_WITH_LPC
     342DevicesR3_SOURCES       += PC/DevLPC.cpp
     343endif
     344
    340345ifdef VBOX_WITH_USB
    341346DevicesR3_DEFS         += VBOX_WITH_USB IN_USB_R3
  • trunk/src/VBox/Devices/PC/DevACPI.cpp

    r16042 r16170  
    6666#define SYSI_DATA       0x0000404c
    6767#define ACPI_RESET_BLK  0x00004050
    68 #define FDC_STATUS      0x00004054
    6968
    7069/* PM1x status register bits */
     
    132131    SYSTEM_INFO_INDEX_MEMORY_LENGTH     = 0,
    133132    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,
    135137    SYSTEM_INFO_INDEX_INVALID           = 0x80,
    136138    SYSTEM_INFO_INDEX_VALID             = 0x200
     
    184186    uint8_t             u8UseIOApic;
    185187    uint8_t             u8UseFdc;
     188    /* If High Precision Event Timer device should be supported */
     189    uint8_t             u8UseHpet;
     190    /* If System Management Controller device should be supported */
     191    uint8_t             u8UseSmc;
     192
    186193    bool                fPowerButtonHandled;
    187 
    188194    /** ACPI port base interface. */
    189195    PDMIBASE            IBase;
     
    196202    /** Pointer to the driver connector interface */
    197203    R3PTRTYPE(PPDMIACPICONNECTOR) pDrv;
     204
     205    uint32_t            Alignment0; /**< Structure size alignment. */
     206
    198207};
    199208
     
    533542IO_WRITE_PROTO (acpiBatIndexWrite);
    534543IO_READ_PROTO  (acpiBatDataRead);
    535 IO_READ_PROTO  (acpiFdcStatusRead);
    536544IO_READ_PROTO  (acpiSysInfoDataRead);
    537545IO_WRITE_PROTO (acpiSysInfoDataWrite);
     
    12461254}
    12471255
    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 
    12681256IO_WRITE_PROTO (acpiSysInfoIndexWrite)
    12691257{
     
    12771265        else
    12781266        {
     1267            /* see comment at the declaration of u8IndexShift */
     1268            if (s->u8IndexShift == 0)
     1269            {
     1270                if (((u32 >> 2) < SYSTEM_INFO_INDEX_LAST) && ((u32 & 0x3)) == 0)
     1271                {
     1272                    s->u8IndexShift = 2;
     1273                }
     1274            }
     1275
    12791276            u32 >>= s->u8IndexShift;
    12801277            Assert (u32 < SYSTEM_INFO_INDEX_LAST);
     
    13061303                    *pu32 = s->u8UseIOApic;
    13071304                    break;
    1308  
     1305
     1306                case SYSTEM_INFO_INDEX_HPET_STATUS:
     1307                    *pu32 = s->u8UseHpet ? (  STA_DEVICE_PRESENT_MASK
     1308                                            | STA_DEVICE_ENABLED_MASK
     1309                                            | STA_DEVICE_SHOW_IN_UI_MASK
     1310                                            | STA_DEVICE_FUNCTIONING_PROPERLY_MASK)
     1311                            : 0;
     1312                    break;
     1313
     1314                case SYSTEM_INFO_INDEX_SMC_STATUS:
     1315                    *pu32 = s->u8UseSmc ? (  STA_DEVICE_PRESENT_MASK
     1316                                           | STA_DEVICE_ENABLED_MASK
     1317                                           /* no need to show this device in the UI */
     1318                                           | STA_DEVICE_FUNCTIONING_PROPERLY_MASK)
     1319                            : 0;
     1320                    break;
     1321
     1322                case SYSTEM_INFO_INDEX_FDC_STATUS:
     1323                    *pu32 = s->u8UseFdc ? (  STA_DEVICE_PRESENT_MASK
     1324                                           | STA_DEVICE_ENABLED_MASK
     1325                                           | STA_DEVICE_SHOW_IN_UI_MASK
     1326                                           | STA_DEVICE_FUNCTIONING_PROPERLY_MASK)
     1327                            : 0;
     1328                    break;
     1329
     1330
    13091331                /* Solaris 9 tries to read from this index */
    13101332                case SYSTEM_INFO_INDEX_INVALID:
    13111333                    *pu32 = 0;
    13121334                    break;
    1313                    
     1335
    13141336                default:
    13151337                    AssertMsgFailed (("Invalid system info index %d\n", s->uSystemInfoIndex));
     
    17541776                               "GCEnabled\0"
    17551777                               "R0Enabled\0"
    1756                                "FdcEnabled\0"))
     1778                               "HpetEnabled\0"
     1779                               "SmcEnabled\0"
     1780                               "FdcEnabled\0"
     1781                               ))
    17571782        return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES,
    17581783                                N_("Configuration error: Invalid config key for ACPI device"));
     
    17801805        return PDMDEV_SET_ERROR(pDevIns, rc,
    17811806                                N_("Configuration error: Failed to read \"FdcEnabled\""));
     1807
     1808    /* query whether we are supposed to present HPET */
     1809    rc = CFGMR3QueryU8Def (pCfgHandle, "HpetEnabled", &s->u8UseHpet, 0);
     1810    if (RT_FAILURE(rc))
     1811        return PDMDEV_SET_ERROR(pDevIns, rc,
     1812                                N_("Configuration error: Failed to read \"HpetEnabled\""));
     1813    /* query whether we are supposed to present SMC */
     1814    rc = CFGMR3QueryU8Def (pCfgHandle, "SmcEnabled", &s->u8UseSmc, 0);
     1815    if (RT_FAILURE(rc))
     1816        return PDMDEV_SET_ERROR(pDevIns, rc,
     1817                                N_("Configuration error: Failed to read \"SmcEnabled\""));
    17821818
    17831819    rc = CFGMR3QueryBool (pCfgHandle, "GCEnabled", &fGCEnabled);
     
    18311867    R (SYSI_INDEX,     1, acpiSysInfoIndexWrite, NULL,                "ACPI system info index");
    18321868    R (SYSI_DATA,      1, acpiSysInfoDataWrite,  acpiSysInfoDataRead, "ACPI system info data");
    1833     R (FDC_STATUS,     1, NULL,                  acpiFdcStatusRead,   "ACPI FDC status index");
    18341869    R (GPE0_BLK + L,   L, acpiGpe0EnWrite,       acpiGpe0EnRead,      "ACPI GPE0 Enable");
    18351870    R (GPE0_BLK,       L, acpiGpe0StsWrite,      acpiGpe0StsRead,     "ACPI GPE0 Status");
     
    20212056#endif /* IN_RING3 */
    20222057#endif /* !VBOX_DEVICE_STRUCT_TESTCASE */
    2023 
  • trunk/src/VBox/Devices/PC/vbox.dsl

    r16042 r16170  
    141141            MEML, 32,
    142142            UIOA, 32,
     143            UHPT, 32,
     144            USMC, 32,
     145            UFDC, 32,
    143146            Offset (0x80),
    144147            ININ, 32,
     
    154157            DBG ("UIOA: ")
    155158            HEX4 (UIOA)
     159            DBG ("UHPT: ")
     160            HEX4 (UHPT)
     161            DBG ("USMC: ")
     162            HEX4 (USMC)
     163            DBG ("UFDC: ")
     164            HEX4 (UFDC)
    156165        }
    157166
     
    564573                    Name (_HID, EisaId ("PNP0700"))
    565574
    566                     OperationRegion (CFDC, SystemIO, 0x4054, 0x08)
    567                     Field (CFDC, DwordAcc, NoLock, Preserve)
    568                     {
    569                         FSTA, 32,
    570                     }
    571 
    572575                    Method (_STA, 0, NotSerialized)
    573576                    {
    574                         Return (FSTA)
     577                        Return (UFDC)
    575578                    }
    576579
     
    852855    Scope (\_SB)
    853856    {
     857         // High Precision Event Timer
     858        Device(HPET) {
     859            Name(_HID,  EISAID("PNP0103"))
     860            Name(_UID, 0)
     861            Method (_STA, 0, NotSerialized) {
     862                    Return(UHPT)
     863            }
     864            Name(_CRS, ResourceTemplate() {
     865                DWordMemory(
     866                    ResourceConsumer, PosDecode, MinFixed, MaxFixed,
     867                    NonCacheable, ReadWrite,
     868                    0x00000000,
     869                    0xFED00000,
     870                    0xFED003FF,
     871                    0x00000000,
     872                    0x00000400 /* 1K memory: FED00000 - FED003FF */
     873                )
     874            })
     875        }
     876 
     877       // System Management Controller
     878       Device (SMC)
     879       {
     880            Name (_HID, EisaId ("APP0001"))
     881            Name (_CID, "smc-napa")
     882
     883            Method (_STA, 0, NotSerialized)
     884            {
     885                Return (USMC)
     886            }
     887            Name (_CRS, ResourceTemplate ()
     888            {
     889                IO (Decode16,
     890                    0x0300,             // Range Minimum
     891                    0x0300,             // Range Maximum
     892                    0x01,               // Alignment
     893                    0x20,               // Length
     894                    )
     895                //IRQNoFlags () {8}
     896            })
     897        }
     898
    854899        // Fields within PIIX3 configuration[0x60..0x63] with
    855900        // IRQ mappings
  • trunk/src/VBox/Devices/testcase/Makefile.kmk

    r15478 r16170  
    7070tstDeviceStructSizeGC_DEFS     += VBOX_WITH_LSILOGIC
    7171endif
     72ifdef VBOX_WITH_HPET
     73tstDeviceStructSizeGC_DEFS     += VBOX_WITH_HPET
     74endif
    7275tstDeviceStructSizeGC_SOURCES   = tstDeviceStructSizeGC.cpp
    7376tstDeviceStructSizeGC_INCS      = \
     
    9699ifdef VBOX_WITH_LSILOGIC
    97100tstDeviceStructSize_DEFS     += VBOX_WITH_LSILOGIC
     101endif
     102ifdef VBOX_WITH_HPET
     103tstDeviceStructSize_DEFS     += VBOX_WITH_HPET
     104endif
     105ifdef VBOX_WITH_SMC
     106tstDeviceStructSize_DEFS     += VBOX_WITH_SMC
     107endif
     108ifdef VBOX_WITH_LPC
     109tstDeviceStructSize_DEFS     += VBOX_WITH_LPC
    98110endif
    99111tstDeviceStructSize_INCS     = \
  • trunk/src/VBox/Devices/testcase/tstDeviceStructSize.cpp

    r15475 r16170  
    7575# undef LOG_GROUP
    7676# include "../Storage/DevLsiLogicSCSI.cpp"
     77#endif
     78#ifdef VBOX_WITH_HPET
     79# undef LOG_GROUP
     80# include "../PC/DevHPET.cpp"
     81#endif
     82#ifdef VBOX_WITH_LPC
     83# undef LOG_GROUP
     84# include "../PC/DevLPC.cpp"
     85#endif
     86#ifdef VBOX_WITH_SMC
     87# undef LOG_GROUP
     88# include "../PC/DevSMC.cpp"
    7789#endif
    7890
     
    264276    return rc;
    265277}
    266 
  • trunk/src/VBox/Devices/testcase/tstDeviceStructSizeGC.cpp

    r16042 r16170  
    8585# undef LOG_GROUP
    8686# include "../Storage/DevLsiLogicSCSI.cpp"
     87#endif
     88#ifdef VBOX_WITH_HPET
     89# undef LOG_GROUP
     90# include "../PC/DevHPET.cpp"
    8791#endif
    8892
     
    442446    GEN_CHECK_OFF(ACPIState, u8IndexShift);
    443447    GEN_CHECK_OFF(ACPIState, u8UseIOApic);
     448    GEN_CHECK_OFF(ACPIState, u8UseFdc);
     449    GEN_CHECK_OFF(ACPIState, u8UseHpet);
     450    GEN_CHECK_OFF(ACPIState, u8UseSmc);
    444451    GEN_CHECK_OFF(ACPIState, IBase);
    445452    GEN_CHECK_OFF(ACPIState, IACPIPort);
     
    14211428#endif /* VBOX_WITH_LSILOGIC */
    14221429
     1430#ifdef VBOX_WITH_HPET
     1431    GEN_CHECK_SIZE(HPETState);
     1432    GEN_CHECK_OFF(HPETState, pDevInsR3);
     1433    GEN_CHECK_OFF(HPETState, pDevInsR0);
     1434    GEN_CHECK_OFF(HPETState, pDevInsRC);
     1435    GEN_CHECK_OFF(HPETState, hpet_offset);
     1436    GEN_CHECK_OFF(HPETState, capability);
     1437    GEN_CHECK_OFF(HPETState, config);
     1438    GEN_CHECK_OFF(HPETState, isr);
     1439    GEN_CHECK_OFF(HPETState, hpet_counter);
     1440
     1441    GEN_CHECK_SIZE(HPETTimer);
     1442    GEN_CHECK_OFF(HPETTimer, pTimerR3);
     1443    GEN_CHECK_OFF(HPETTimer, pHpetR3);
     1444    GEN_CHECK_OFF(HPETTimer, pTimerR0);
     1445    GEN_CHECK_OFF(HPETTimer, pHpetR0);
     1446    GEN_CHECK_OFF(HPETTimer, pTimerRC);
     1447    GEN_CHECK_OFF(HPETTimer, pHpetRC);
     1448    GEN_CHECK_OFF(HPETTimer, tn);
     1449    GEN_CHECK_OFF(HPETTimer, config);
     1450    GEN_CHECK_OFF(HPETTimer, cmp);
     1451    GEN_CHECK_OFF(HPETTimer, fsb);
     1452    GEN_CHECK_OFF(HPETTimer, period);
     1453    GEN_CHECK_OFF(HPETTimer, wrap_flag);
     1454#endif
     1455
    14231456    return (0);
    14241457}
    1425 
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r16049 r16170  
    473473    fLpcEnabled = false;
    474474#endif
     475
     476    if (fLpcEnabled)
     477    {
     478        rc = CFGMR3InsertNode(pDevices, "lpc", &pDev);                       RC_CHECK();
     479        rc = CFGMR3InsertNode(pDev,     "0", &pInst);                        RC_CHECK();
     480        rc = CFGMR3InsertInteger(pInst, "Trusted",   1);     /* boolean */   RC_CHECK();
     481    }
    475482
    476483    /*
  • trunk/src/VBox/Runtime/VBox/log-vbox.cpp

    r16079 r16170  
    213213    ASSERT_LOG_GROUP(DEV_IDE);
    214214    ASSERT_LOG_GROUP(DEV_KBD);
     215    ASSERT_LOG_GROUP(DEV_LPC);
    215216    ASSERT_LOG_GROUP(DEV_NE2000);
    216217    ASSERT_LOG_GROUP(DEV_PC);
     
    435436    return g_pLogger = RT_SUCCESS(rc) ? pLogger : NULL;
    436437}
    437 
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