Changeset 35738 in vbox
- Timestamp:
- Jan 27, 2011 2:17:41 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
include/VBox/pci.h (modified) (2 diffs)
-
include/VBox/vmm/pdmdev.h (modified) (5 diffs)
-
src/VBox/Devices/Bus/PCIInternal.h (modified) (4 diffs)
-
src/VBox/VMM/VMMR0/PDMR0Device.cpp (modified) (4 diffs)
-
src/VBox/VMM/VMMR3/PDMDevHlp.cpp (modified) (4 diffs)
-
src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp (modified) (2 diffs)
-
src/VBox/VMM/VMMRC/PDMRCDevice.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pci.h
r35676 r35738 920 920 921 921 #ifdef PCIDEVICEINT_DECLARED 922 /** @todo r=bird: These are internal methods and should start with lowercase 923 * prefix as well as including the 'Dev' bit: s/PCI\(Set|Get\)/pciDev\1/ 924 * 925 * Also: s/uFlags/fFlags/ 926 */ 927 922 928 DECLINLINE(void) PCISetRequestedDevfunc(PPCIDEVICE pDev) 923 929 { … … 999 1005 return (pDev->Int.s.uFlags & PCIDEV_FLAG_PASSTHROUGH) != 0; 1000 1006 } 1001 #endif 1002 1003 #ifdef __cplusplus 1007 1008 #endif /* PCIDEVICEINT_DECLARED */ 1009 1010 #if defined(__cplusplus) && defined(IN_RING3) 1011 /** 1012 * Document me. 1013 * 1014 * @remarks C++ classes (structs included) are not generally accepted in 1015 * VMM devices or drivers. An exception may be granted for this class 1016 * if it's contained to ring-3 and that this is a one time exception 1017 * which sets no precedent. 1018 */ 1004 1019 struct PciBusAddress 1005 1020 { 1021 /** @todo r=bird: Add 'm', or 'm_' to data members. This is general 1022 * practice in most of the source tree. */ 1006 1023 int iBus; 1007 1024 int iDevice; -
trunk/include/VBox/vmm/pdmdev.h
r35676 r35738 4 4 5 5 /* 6 * Copyright (C) 2006-201 0Oracle Corporation6 * Copyright (C) 2006-2011 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 1822 1822 #define PDM_HPETHLPR3_VERSION PDM_VERSION_MAKE(0xffec, 2, 0) 1823 1823 1824 1825 /** 1826 * Raw PCI device registration structure. 1827 */ 1824 1828 typedef struct PDMPCIRAWREG 1825 1829 { 1826 1830 /** Struct version+magic number (PDM_PCIRAWREG_VERSION). */ 1827 uint32_t u32Version; 1831 uint32_t u32Version; 1832 /** Just a safety precaution. */ 1833 uint32_t u32TheEnd; 1828 1834 } PDMPCIRAWREG; 1829 1830 1835 /** Pointer to a raw PCI registration structure. */ 1831 1836 typedef PDMPCIRAWREG *PPDMPCIRAWREG; 1837 1832 1838 /** Current PDMPCIRAWREG version number. */ 1833 #define PDM_PCIRAWREG_VERSION PDM_VERSION_MAKE(0xffe3, 1, 0) 1834 struct PDMPCIRAWHLPRC 1835 { 1839 #define PDM_PCIRAWREG_VERSION PDM_VERSION_MAKE(0xffe1, 1, 0) 1840 1841 /** 1842 * Raw PCI device raw-mode context helpers. 1843 */ 1844 typedef struct PDMPCIRAWHLPRC 1845 { 1846 /** Structure version and magic number (PDM_PCIRAWHLPRC_VERSION). */ 1836 1847 uint32_t u32Version; 1837 1848 /** Just a safety precaution. */ 1838 1849 uint32_t u32TheEnd; 1839 }; 1850 } PDMPCIRAWHLPRC; 1851 /** Pointer to a raw PCI deviec raw-mode context helper structure. */ 1840 1852 typedef RCPTRTYPE(PDMPCIRAWHLPRC *) PPDMPCIRAWHLPRC; 1853 /** Pointer to a const raw PCI deviec raw-mode context helper structure. */ 1841 1854 typedef RCPTRTYPE(const PDMPCIRAWHLPRC *) PCPDMPCIRAWHLPRC; 1842 1855 1843 struct PDMPCIRAWHLPR0 1844 { 1845 uint32_t u32Version; 1846 /** Just a safety precaution. */ 1847 uint32_t u32TheEnd; 1848 }; 1856 /** Current PDMPCIRAWHLPRC version number. */ 1857 #define PDM_PCIRAWHLPRC_VERSION PDM_VERSION_MAKE(0xffe0, 1, 0) 1858 1859 /** 1860 * Raw PCI device ring-0 context helpers. 1861 */ 1862 typedef struct PDMPCIRAWHLPR0 1863 { 1864 /** Structure version and magic number (PDM_PCIRAWHLPR0_VERSION). */ 1865 uint32_t u32Version; 1866 /** Just a safety precaution. */ 1867 uint32_t u32TheEnd; 1868 } PDMPCIRAWHLPR0; 1869 /** Pointer to a raw PCI deviec ring-0 context helper structure. */ 1849 1870 typedef R0PTRTYPE(PDMPCIRAWHLPR0 *) PPDMPCIRAWHLPR0; 1871 /** Pointer to a const raw PCI deviec ring-0 context helper structure. */ 1850 1872 typedef R0PTRTYPE(const PDMPCIRAWHLPR0 *) PCPDMPCIRAWHLPR0; 1851 1873 1852 1853 typedef struct PDMPCIRAWHLPR3 1854 { 1855 uint32_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 */ 1865 DECLR3CALLBACKMEMBER(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 */ 1876 DECLR3CALLBACKMEMBER(PCPDMPCIRAWHLPR0, pfnGetR0Helpers,(PPDMDEVINS pDevIns)); 1877 1878 /** Just a safety precaution. */ 1879 uint32_t u32TheEnd; 1880 } PDMPCIRAWHLPR3; 1881 /** Pointer to raw PCI R3 helpers. */ 1882 typedef R3PTRTYPE(PDMPCIRAWHLPR3 *) PPDMPCIRAWHLPR3; 1883 /** Pointer to const raw PCI R3 helpers. */ 1884 typedef 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) 1874 /** Current PDMPCIRAWHLPR0 version number. */ 1875 #define PDM_PCIRAWHLPR0_VERSION PDM_VERSION_MAKE(0xffdf, 1, 0) 1876 1877 1878 /** 1879 * Raw PCI device ring-3 context helpers. 1880 */ 1881 typedef struct PDMPCIRAWHLPR3 1882 { 1883 /** Undefined structure version and magic number. */ 1884 uint32_t u32Version; 1885 1886 /** 1887 * Gets the address of the RC raw PCI device helpers. 1888 * 1889 * This should be called at both construction and relocation time to obtain 1890 * the correct address of the RC helpers. 1891 * 1892 * @returns RC pointer to the raw PCI device helpers. 1893 * @param pDevIns Device instance of the raw PCI device. 1894 */ 1895 DECLR3CALLBACKMEMBER(PCPDMPCIRAWHLPRC, pfnGetRCHelpers,(PPDMDEVINS pDevIns)); 1896 1897 /** 1898 * Gets the address of the R0 raw PCI device helpers. 1899 * 1900 * This should be called at both construction and relocation time to obtain 1901 * the correct address of the R0 helpers. 1902 * 1903 * @returns R0 pointer to the raw PCI device helpers. 1904 * @param pDevIns Device instance of the raw PCI device. 1905 */ 1906 DECLR3CALLBACKMEMBER(PCPDMPCIRAWHLPR0, pfnGetR0Helpers,(PPDMDEVINS pDevIns)); 1907 1908 /** Just a safety precaution. */ 1909 uint32_t u32TheEnd; 1910 } PDMPCIRAWHLPR3; 1911 /** Pointer to raw PCI R3 helpers. */ 1912 typedef R3PTRTYPE(PDMPCIRAWHLPR3 *) PPDMPCIRAWHLPR3; 1913 /** Pointer to const raw PCI R3 helpers. */ 1914 typedef R3PTRTYPE(const PDMPCIRAWHLPR3 *) PCPDMPCIRAWHLPR3; 1915 1916 /** Current PDMPCIRAWHLPR3 version number. */ 1917 #define PDM_PCIRAWHLPR3_VERSION PDM_VERSION_MAKE(0xffde, 1, 0) 1918 1892 1919 1893 1920 #ifdef IN_RING3 … … 2989 3016 DECLR3CALLBACKMEMBER(int, pfnHPETRegister,(PPDMDEVINS pDevIns, PPDMHPETREG pHpetReg, PCPDMHPETHLPR3 *ppHpetHlpR3)); 2990 3017 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 pp HpetHlpR3 Where to store the pointer to the raw PCI2998 * helpers.2999 */ 3000 DECLR3CALLBACKMEMBER(int, pfnPciRawRegister,(PPDMDEVINS pDevIns, PPDMPCIRAWREG pPciRawReg, PCPDMPCIRAWHLPR3 *ppPciRawHlpR3)); 3018 /** 3019 * Register a raw PCI device. 3020 * 3021 * @returns VBox status code. 3022 * @param pDevIns The device instance. 3023 * @param pHpetReg Pointer to a raw PCI registration structure. 3024 * @param ppPciRawHlpR3 Where to store the pointer to the raw PCI 3025 * device helpers. 3026 */ 3027 DECLR3CALLBACKMEMBER(int, pfnPciRawRegister,(PPDMDEVINS pDevIns, PPDMPCIRAWREG pPciRawReg, PCPDMPCIRAWHLPR3 *ppPciRawHlpR3)); 3001 3028 3002 3029 /** … … 3360 3387 3361 3388 /** Current PDMDEVHLPR3 version number. */ 3362 #define PDM_DEVHLPR3_VERSION PDM_VERSION_MAKE(0xffe7, 3, 0)3389 #define PDM_DEVHLPR3_VERSION PDM_VERSION_MAKE(0xffe7, 4, 0) 3363 3390 3364 3391 … … 4533 4560 } 4534 4561 4535 /** 4536 * @copydoc PDMDEVHLPR3::pfnPciRawRegister 4537 */ 4538 DECLINLINE(int) PDMDevHlpPciRawRegister(PPDMDEVINS pDevIns, PPDMPCIRAWREG pPciRawReg, PCPDMPCIRAWHLPR3 *ppPciRawHlpR3) 4539 { 4540 return pDevIns->pHlpR3->pfnPciRawRegister(pDevIns, pPciRawReg, ppPciRawHlpR3); 4541 } 4562 /** 4563 * @copydoc PDMDEVHLPR3::pfnPciRawRegister 4564 */ 4565 DECLINLINE(int) PDMDevHlpPciRawRegister(PPDMDEVINS pDevIns, PPDMPCIRAWREG pPciRawReg, PCPDMPCIRAWHLPR3 *ppPciRawHlpR3) 4566 { 4567 return pDevIns->pHlpR3->pfnPciRawRegister(pDevIns, pPciRawReg, ppPciRawHlpR3); 4568 } 4542 4569 4543 4570 /** -
trunk/src/VBox/Devices/Bus/PCIInternal.h
r35676 r35738 99 99 /** I/O regions. */ 100 100 PCIIOREGION aIORegions[PCI_NUM_REGIONS]; 101 /** Pointer to the PCI bus of the device. - R3 ptr*/101 /** Pointer to the PCI bus of the device. (R3 ptr) */ 102 102 R3PTRTYPE(struct PCIBus *) pBusR3; 103 /** Pointer to the PCI bus of the device. - R0 ptr*/103 /** Pointer to the PCI bus of the device. (R0 ptr) */ 104 104 R0PTRTYPE(struct PCIBus *) pBusR0; 105 /** Pointer to the PCI bus of the device. - RC ptr*/105 /** Pointer to the PCI bus of the device. (RC ptr) */ 106 106 RCPTRTYPE(struct PCIBus *) pBusRC; 107 107 #if HC_ARCH_BITS == 64 … … 109 109 #endif 110 110 111 /* Page used for MSI-X state. - R3 ptr*/111 /** Page used for MSI-X state. (R3 ptr) */ 112 112 R3PTRTYPE(void*) pMsixPageR3; 113 /* Page used for MSI-X state. - R0 ptr*/113 /** Page used for MSI-X state. (R0 ptr) */ 114 114 R0PTRTYPE(void*) pMsixPageR0; 115 /* Page used for MSI-X state. - RC ptr*/115 /** Page used for MSI-X state. (RC ptr) */ 116 116 RCPTRTYPE(void*) pMsixPageRC; 117 117 #if HC_ARCH_BITS == 64 … … 125 125 R3PTRTYPE(PFNPCICONFIGWRITE) pfnConfigWrite; 126 126 127 /* Flags of this PCI device, see PCIDEV_FLAG_ constants */ 127 /** Flags of this PCI device, see PCIDEV_FLAG_XXX constants. 128 * @todo s/uFlags/fFlags/g */ 128 129 uint32_t uFlags; 129 130 /** Current state of the IRQ pin of the device. */ 130 131 int32_t uIrqPinState; 131 132 132 /* Offset of MSI PCI capability in config space, or 0*/133 /** Offset of MSI PCI capability in config space, or 0. */ 133 134 uint8_t u8MsiCapOffset; 134 /* Size of MSI PCI capability in config space, or 0*/135 /** Size of MSI PCI capability in config space, or 0. */ 135 136 uint8_t u8MsiCapSize; 136 /* Offset of MSI-X PCI capability in config space, or 0*/137 /** Offset of MSI-X PCI capability in config space, or 0. */ 137 138 uint8_t u8MsixCapOffset; 138 /* Size of MSI-X PCI capability in config space, or 0*/139 /** Size of MSI-X PCI capability in config space, or 0. */ 139 140 uint8_t u8MsixCapSize; 140 141 141 142 uint32_t Alignment2; 142 143 143 /* Pointer to bus specific data. - R3 ptr*/144 /** Pointer to bus specific data. (R3 ptr) */ 144 145 R3PTRTYPE(const void*) pPciBusPtrR3; 145 146 … … 155 156 } PCIDEVICEINT; 156 157 157 /* Indicate that PCIDEVICE::Int.s can be declared. */158 /** Indicate that PCIDEVICE::Int.s can be declared. */ 158 159 #define PCIDEVICEINT_DECLARED 159 160 -
trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp
r35676 r35738 5 5 6 6 /* 7 * Copyright (C) 2006-201 0Oracle Corporation7 * Copyright (C) 2006-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 669 669 * @{ 670 670 */ 671 /* none */ 671 672 672 673 /** … … 681 682 /** @} */ 682 683 684 683 685 /** @name Raw PCI Ring-0 Helpers 684 686 * @{ 685 687 */ 688 /* none */ 689 686 690 /** 687 691 * The Ring-0 PCI raw Helper Callbacks. … … 694 698 695 699 /** @} */ 700 696 701 697 702 /** @name Ring-0 Context Driver Helpers -
trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
r35676 r35738 5 5 6 6 /* 7 * Copyright (C) 2006-201 0Oracle Corporation7 * Copyright (C) 2006-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 2812 2812 } 2813 2813 2814 2814 2815 /** @interface_method_impl{PDMDEVHLPR3,pfnPciRawRegister} */ 2815 2816 static DECLCALLBACK(int) pdmR3DevHlp_PciRawRegister(PPDMDEVINS pDevIns, PPDMPCIRAWREG pPciRawReg, PCPDMPCIRAWHLPR3 *ppPciRawHlpR3) … … 2841 2842 return VINF_SUCCESS; 2842 2843 } 2844 2843 2845 2844 2846 /** @interface_method_impl{PDMDEVHLPR3,pfnDMACRegister} */ … … 3500 3502 3501 3503 /** @} */ 3504 -
trunk/src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp
r35676 r35738 5 5 6 6 /* 7 * Copyright (C) 2006-201 0Oracle Corporation7 * Copyright (C) 2006-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 651 651 /** @} */ 652 652 653 /** @interface_method_impl{PDMPCIRAWHLPR3,pfnGetRCHelpers} */ 654 static DECLCALLBACK(PCPDMPCIRAWHLPRC) pdmR3PciRawHlp_GetRCHelpers(PPDMDEVINS pDevIns) 655 { 656 PDMDEV_ASSERT_DEVINS(pDevIns); 657 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 658 RTRCPTR pRCHelpers = 0; 659 int rc = PDMR3LdrGetSymbolRC(pDevIns->Internal.s.pVMR3, NULL, "g_pdmRCPciRawHlp", &pRCHelpers); 660 AssertReleaseRC(rc); 661 AssertRelease(pRCHelpers); 662 LogFlow(("pdmR3PciRawHlp_GetGCHelpers: caller='%s'/%d: returns %RRv\n", 663 pDevIns->pReg->szName, pDevIns->iInstance, pRCHelpers)); 664 return pRCHelpers; 665 } 666 667 668 /** @interface_method_impl{PDMPCIRAWHLPR3,pfnGetR0Helpers} */ 669 static DECLCALLBACK(PCPDMPCIRAWHLPR0) pdmR3PciRawHlp_GetR0Helpers(PPDMDEVINS pDevIns) 670 { 671 PDMDEV_ASSERT_DEVINS(pDevIns); 672 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 673 PCPDMHPETHLPR0 pR0Helpers = 0; 674 int rc = PDMR3LdrGetSymbolR0(pDevIns->Internal.s.pVMR3, NULL, "g_pdmR0PciRawHlp", &pR0Helpers); 675 AssertReleaseRC(rc); 676 AssertRelease(pR0Helpers); 677 LogFlow(("pdmR3PciRawHlp_GetR0Helpers: caller='%s'/%d: returns %RHv\n", 678 pDevIns->pReg->szName, pDevIns->iInstance, pR0Helpers)); 679 return pR0Helpers; 680 } 681 682 /** 683 * Raw PCI Device Helpers. 684 */ 685 const PDMPCIRAWHLPR3 g_pdmR3DevPciRawHlp = 686 { 687 PDM_PCIRAWHLPR3_VERSION, 688 pdmR3PciRawHlp_GetRCHelpers, 689 pdmR3PciRawHlp_GetR0Helpers, 690 PDM_PCIRAWHLPR3_VERSION, /* the end */ 691 }; 653 654 /** @name Ring-3 Raw PCI Device Helpers 655 * {@ 656 */ 657 658 /** @interface_method_impl{PDMPCIRAWHLPR3,pfnGetRCHelpers} */ 659 static DECLCALLBACK(PCPDMPCIRAWHLPRC) pdmR3PciRawHlp_GetRCHelpers(PPDMDEVINS pDevIns) 660 { 661 PDMDEV_ASSERT_DEVINS(pDevIns); 662 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 663 RTRCPTR pRCHelpers = NIL_RTRCPTR; 664 int rc = PDMR3LdrGetSymbolRC(pDevIns->Internal.s.pVMR3, NULL, "g_pdmRCPciRawHlp", &pRCHelpers); 665 AssertReleaseRC(rc); 666 AssertRelease(pRCHelpers); 667 LogFlow(("pdmR3PciRawHlp_GetGCHelpers: caller='%s'/%d: returns %RRv\n", 668 pDevIns->pReg->szName, pDevIns->iInstance, pRCHelpers)); 669 return pRCHelpers; 670 } 671 672 673 /** @interface_method_impl{PDMPCIRAWHLPR3,pfnGetR0Helpers} */ 674 static DECLCALLBACK(PCPDMPCIRAWHLPR0) pdmR3PciRawHlp_GetR0Helpers(PPDMDEVINS pDevIns) 675 { 676 PDMDEV_ASSERT_DEVINS(pDevIns); 677 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 678 PCPDMHPETHLPR0 pR0Helpers = NIL_RTR0PTR; 679 int rc = PDMR3LdrGetSymbolR0(pDevIns->Internal.s.pVMR3, NULL, "g_pdmR0PciRawHlp", &pR0Helpers); 680 AssertReleaseRC(rc); 681 AssertRelease(pR0Helpers); 682 LogFlow(("pdmR3PciRawHlp_GetR0Helpers: caller='%s'/%d: returns %RHv\n", 683 pDevIns->pReg->szName, pDevIns->iInstance, pR0Helpers)); 684 return pR0Helpers; 685 } 686 687 688 /** 689 * Raw PCI Device Helpers. 690 */ 691 const PDMPCIRAWHLPR3 g_pdmR3DevPciRawHlp = 692 { 693 PDM_PCIRAWHLPR3_VERSION, 694 pdmR3PciRawHlp_GetRCHelpers, 695 pdmR3PciRawHlp_GetR0Helpers, 696 PDM_PCIRAWHLPR3_VERSION, /* the end */ 697 }; 698 699 /** @} */ 700 692 701 693 702 /* none yet */ -
trunk/src/VBox/VMM/VMMRC/PDMRCDevice.cpp
r35346 r35738 5 5 6 6 /* 7 * Copyright (C) 2006-201 0Oracle Corporation7 * Copyright (C) 2006-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 47 47 extern DECLEXPORT(const PDMHPETHLPRC) g_pdmRCHpetHlp; 48 48 extern DECLEXPORT(const PDMDRVHLPRC) g_pdmRCDrvHlp; 49 /** @todo missing PDMPCIRAWHLPRC */ 49 50 RT_C_DECLS_END 50 51
Note:
See TracChangeset
for help on using the changeset viewer.

