VirtualBox

Changeset 35676 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Jan 24, 2011 2:24:34 PM (14 years ago)
Author:
vboxsync
Message:

Main, VMM: PCI passthrough work

Location:
trunk/include/VBox
Files:
3 edited

Legend:

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

    r35358 r35676  
    984984    return (pDev->Int.s.uFlags & PCIDEV_FLAG_MSIX_CAPABLE) != 0;
    985985}
     986
     987DECLINLINE(void) PCISetPassthrough(PPCIDEVICE pDev)
     988{
     989    pDev->Int.s.uFlags |= PCIDEV_FLAG_PASSTHROUGH;
     990}
     991
     992DECLINLINE(void) PCIClearPassthrough(PPCIDEVICE pDev)
     993{
     994    pDev->Int.s.uFlags &= ~PCIDEV_FLAG_PASSTHROUGH;
     995}
     996
     997DECLINLINE(bool) PCIIsPassthrough(PPCIDEVICE pDev)
     998{
     999    return (pDev->Int.s.uFlags & PCIDEV_FLAG_PASSTHROUGH) != 0;
     1000}
    9861001#endif
    9871002
     
    10711086    }
    10721087
    1073     void fromLong(int32_t value)
     1088    PciBusAddress& fromLong(int32_t value)
    10741089    {
    10751090        iBus = (value >> 8) & 0xff;
    10761091        iDevice = (value & 0xff) >> 3;
    10771092        iFn = (value & 7);
     1093        return *this;
    10781094    }
    10791095};
  • trunk/include/VBox/vmm/pdmdev.h

    r35361 r35676  
    18221822#define PDM_HPETHLPR3_VERSION                   PDM_VERSION_MAKE(0xffec, 2, 0)
    18231823
    1824 
     1824typedef struct PDMPCIRAWREG
     1825{
     1826    /** Struct version+magic number (PDM_PCIRAWREG_VERSION). */
     1827     uint32_t            u32Version;
     1828} PDMPCIRAWREG;
     1829
     1830/** Pointer to a raw PCI registration structure. */
     1831typedef PDMPCIRAWREG *PPDMPCIRAWREG;
     1832/** Current PDMPCIRAWREG version number. */
     1833#define PDM_PCIRAWREG_VERSION                     PDM_VERSION_MAKE(0xffe3, 1, 0)
     1834struct PDMPCIRAWHLPRC
     1835{
     1836    uint32_t u32Version;
     1837    /** Just a safety precaution. */
     1838    uint32_t u32TheEnd;
     1839};
     1840typedef RCPTRTYPE(PDMPCIRAWHLPRC *) PPDMPCIRAWHLPRC;
     1841typedef RCPTRTYPE(const PDMPCIRAWHLPRC *) PCPDMPCIRAWHLPRC;
     1842
     1843struct PDMPCIRAWHLPR0
     1844{
     1845uint32_t u32Version;
     1846/** Just a safety precaution. */
     1847uint32_t u32TheEnd;
     1848};
     1849typedef R0PTRTYPE(PDMPCIRAWHLPR0 *) PPDMPCIRAWHLPR0;
     1850typedef R0PTRTYPE(const PDMPCIRAWHLPR0 *) PCPDMPCIRAWHLPR0;
     1851
     1852
     1853typedef struct PDMPCIRAWHLPR3
     1854{
     1855uint32_t u32Version;
     1856/**
     1857* Gets the address of the RC PCI raw helpers.
     1858*
     1859* This should be called at both construction and relocation time
     1860* to obtain the correct address of the RC helpers.
     1861*
     1862* @returns RC pointer to the PCI raw helpers.
     1863* @param   pDevIns         Device instance of the raw PCI device.
     1864*/
     1865DECLR3CALLBACKMEMBER(PCPDMPCIRAWHLPRC, pfnGetRCHelpers,(PPDMDEVINS pDevIns));
     1866
     1867/**
     1868* Gets the address of the R0 PCI raw helpers.
     1869*
     1870* This should be called at both construction and relocation time
     1871* to obtain the correct address of the R0 helpers.
     1872*
     1873* @returns R0 pointer to the PCI raw helpers.
     1874* @param   pDevIns         Device instance of the raw PCI device.
     1875*/
     1876DECLR3CALLBACKMEMBER(PCPDMPCIRAWHLPR0, pfnGetR0Helpers,(PPDMDEVINS pDevIns));
     1877
     1878/** Just a safety precaution. */
     1879uint32_t                u32TheEnd;
     1880} PDMPCIRAWHLPR3;
     1881/** Pointer to raw PCI R3 helpers. */
     1882typedef R3PTRTYPE(PDMPCIRAWHLPR3 *) PPDMPCIRAWHLPR3;
     1883/** Pointer to const raw PCI R3 helpers. */
     1884typedef R3PTRTYPE(const PDMPCIRAWHLPR3 *) PCPDMPCIRAWHLPR3;
     1885
     1886/** Current PDMPCIRAWHLPRC version number. */
     1887#define PDM_PCIRAWHLPRC_VERSION                   PDM_VERSION_MAKE(0xfff0, 1, 0)
     1888/** Current PDMPCIRAWHLPR0 version number. */
     1889#define PDM_PCIRAWHLPR0_VERSION                   PDM_VERSION_MAKE(0xfff1, 1, 0)
     1890/** Current PDMPCIRAWHLPR3 version number. */
     1891#define PDM_PCIRAWHLPR3_VERSION                   PDM_VERSION_MAKE(0xfff2, 1, 0)
    18251892
    18261893#ifdef IN_RING3
     
    29212988     */
    29222989    DECLR3CALLBACKMEMBER(int, pfnHPETRegister,(PPDMDEVINS pDevIns, PPDMHPETREG pHpetReg, PCPDMHPETHLPR3 *ppHpetHlpR3));
     2990
     2991    /**
     2992     * Register the raw PCI device.
     2993     *
     2994     * @returns VBox status code.
     2995     * @param   pDevIns             The device instance.
     2996     * @param   pHpetReg            Pointer to a raw PCI registration structure.
     2997     * @param   ppHpetHlpR3         Where to store the pointer to the raw PCI
     2998     *                              helpers.
     2999     */
     3000    DECLR3CALLBACKMEMBER(int, pfnPciRawRegister,(PPDMDEVINS pDevIns, PPDMPCIRAWREG pPciRawReg, PCPDMPCIRAWHLPR3 *ppPciRawHlpR3));
    29233001
    29243002    /**
     
    44554533}
    44564534
     4535/**
     4536 * @copydoc PDMDEVHLPR3::pfnPciRawRegister
     4537 */
     4538DECLINLINE(int) PDMDevHlpPciRawRegister(PPDMDEVINS pDevIns, PPDMPCIRAWREG pPciRawReg, PCPDMPCIRAWHLPR3 *ppPciRawHlpR3)
     4539{
     4540    return pDevIns->pHlpR3->pfnPciRawRegister(pDevIns, pPciRawReg, ppPciRawHlpR3);
     4541}
     4542
    44574543/**
    44584544 * @copydoc PDMDEVHLPR3::pfnDMACRegister
  • trunk/include/VBox/vmm/pdmdrv.h

    r35361 r35676  
    338338/** SCSI driver. */
    339339#define PDM_DRVREG_CLASS_SCSI           RT_BIT(15)
     340/** Generic raw PCI device driver. */
     341#define PDM_DRVREG_CLASS_PCIRAW         RT_BIT(16)
    340342/** @} */
    341343
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