VirtualBox

Changeset 32342 in vbox


Ignore:
Timestamp:
Sep 9, 2010 12:08:48 PM (14 years ago)
Author:
vboxsync
Message:

PCI: typos, first functional version

Location:
trunk/src/VBox/Devices
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Builtins.cpp

    r30976 r32342  
    6060    if (RT_FAILURE(rc))
    6161        return rc;
     62    rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePciIch9);
     63    if (RT_FAILURE(rc))
     64        return rc;
    6265    rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePcArch);
    6366    if (RT_FAILURE(rc))
     
    165168#endif
    166169    rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePCIBridge);
     170    if (RT_FAILURE(rc))
     171        return rc;
     172    rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePciIch9Bridge);
    167173    if (RT_FAILURE(rc))
    168174        return rc;
  • trunk/src/VBox/Devices/Builtins.h

    r30976 r32342  
    3636
    3737extern const PDMDEVREG g_DevicePCI;
     38extern const PDMDEVREG g_DevicePciIch9;
    3839extern const PDMDEVREG g_DevicePcArch;
    3940extern const PDMDEVREG g_DevicePcBios;
     
    7778#endif
    7879extern const PDMDEVREG g_DevicePCIBridge;
     80extern const PDMDEVREG g_DevicePciIch9Bridge;
    7981#ifdef VBOX_WITH_LSILOGIC
    8082extern const PDMDEVREG g_DeviceLsiLogicSCSI;
  • trunk/src/VBox/Devices/Bus/DevPciIch9.cpp

    r32280 r32342  
    800800    int rc = ich9pciDataRead(pGlobals, addr & 3, len, &u32Val);
    801801    AssertRC(rc);
     802    switch (len)
     803    {
     804        case 1:
     805            u32Val &= 0xff;
     806            break;
     807        case 2:
     808            u32Val &= 0xffff;
     809            break;
     810    }
    802811    return u32Val;
    803812}
     
    912921{
    913922    uint32_t *paddr;
    914     int i, pin, pic_irq;
    915923    uint16_t uDevClass, uVendor, uDevice;
    916924
     
    923931        return;
    924932
    925     switch (uDevice)
     933    switch (uDevClass)
    926934    {
    927935        case 0x0101:
     
    10051013                    u32Size = (~u32Size) + 1;
    10061014
    1007                 Log(("%s: Size of region %u for device %d on bus %d is %u\n", __FUNCTION__, i, uDevFn, uBus, u32Size));
     1015                Log(("%s: Size of region %u for device %d on bus %d is %u\n", __FUNCTION__, iRegion, uDevFn, uBus, u32Size));
    10081016
    10091017                if (u32Size)
     
    10111019                    paddr = fIsPio ? &pGlobals->uPciBiosIo : &pGlobals->uPciBiosMmio;
    10121020                    *paddr = (*paddr + u32Size - 1) & ~(u32Size - 1);
    1013                     Log(("%s: Start address of %s region %u is %#x\n", __FUNCTION__, (fIsPio ? "I/O" : "MMIO"), i, *paddr));
    1014                     ich9pciSetRegionAddress(pGlobals, uBus, uDevFn, i, *paddr);
     1021                    Log(("%s: Start address of %s region %u is %#x\n", __FUNCTION__, (fIsPio ? "I/O" : "MMIO"), iRegion, *paddr));
     1022                    ich9pciSetRegionAddress(pGlobals, uBus, uDevFn, iRegion, *paddr);
    10151023                    *paddr += u32Size;
    10161024                    Log(("%s: New address is %#x\n", __FUNCTION__, *paddr));
     
    15051513
    15061514    pBus->aPciDev.pDevIns               = pDevIns;
    1507     pBus->aPciDev.Int.s.fRequestedDevFn = true;
    15081515    /* We register Host<->PCI controller on the bus */
    1509     ich9pciRegisterInternal(pBus, 0, &pBus->aPciDev, "i82801");
    1510 
    1511     /** @todo: ther chipset devices shall be registered too */
    1512     /** @todo: bridges? */
     1516    ich9pciRegisterInternal(pBus, -1, &pBus->aPciDev, "i82801");
     1517
     1518    /** @todo: other chipset devices shall be registered too */
     1519    /** @todo: what to with bridges? */
    15131520
    15141521    return VINF_SUCCESS;
     
    15741581static DECLCALLBACK(void) ich9pcibridgeReset(PPDMDEVINS pDevIns)
    15751582{
     1583    PPCIBUS pBus = PDMINS_2_DATA(pDevIns, PPCIBUS);
     1584
     1585    /* Reset config space to default values. */
     1586    pBus->aPciDev.config[VBOX_PCI_PRIMARY_BUS] = 0;
     1587    pBus->aPciDev.config[VBOX_PCI_SECONDARY_BUS] = 0;
     1588    pBus->aPciDev.config[VBOX_PCI_SUBORDINATE_BUS] = 0;
    15761589}
    15771590
     
    15821595static DECLCALLBACK(void) ich9pcibridgeRelocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
    15831596{
     1597    PPCIBUS pBus = PDMINS_2_DATA(pDevIns, PPCIBUS);
     1598    pBus->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
     1599
     1600    /* Relocate RC pointers for the attached pci devices. */
     1601    for (uint32_t i = 0; i < RT_ELEMENTS(pBus->apDevices); i++)
     1602    {
     1603        if (pBus->apDevices[i])
     1604            pBus->apDevices[i]->Int.s.pBusRC += offDelta;
     1605    }
     1606
    15841607}
    15851608
  • trunk/src/VBox/Devices/Makefile.kmk

    r32241 r32342  
    298298        Input/UsbMouse.cpp \
    299299        Bus/DevPCI.cpp \
    300         $(if $(VBOX_WITH_NEWPCI),Bus/DevPciIch9.cpp,) \
     300        Bus/DevPciIch9.cpp \
    301301        Graphics/DevVGA.cpp \
    302302        Storage/DevATA.cpp \
     
    551551 VBoxDDGC_SOURCES        = \
    552552        Bus/DevPCI.cpp \
    553         $(if $(VBOX_WITH_NEWPCI),Bus/DevPciIch9.cpp,) \
     553        Bus/DevPciIch9.cpp \
    554554        Graphics/DevVGA.cpp \
    555555        Input/DevPS2.cpp \
     
    663663VBoxDDR0_SOURCES        = \
    664664        Bus/DevPCI.cpp \
    665         $(if $(VBOX_WITH_NEWPCI),Bus/DevPciIch9.cpp,) \
     665        Bus/DevPciIch9.cpp \
    666666        Graphics/DevVGA.cpp \
    667667        Input/DevPS2.cpp \
Note: See TracChangeset for help on using the changeset viewer.

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