Changeset 81375 in vbox for trunk/include/VBox
- Timestamp:
- Oct 19, 2019 1:57:55 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 134088
- Location:
- trunk/include/VBox/vmm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/iom.h
r81333 r81375 462 462 VMMDECL(int) IOMMMIOResetRegion(PVMCC pVM, RTGCPHYS GCPhys); 463 463 464 VMM_INT_DECL(VBOXSTRICTRC) IOMMmioPhysHandler (PVMCC pVM, PVMCPUCC pVCpu, uint32_t uErrorCode, RTGCPHYS GCPhysFault);464 VMM_INT_DECL(VBOXSTRICTRC) IOMMmioPhysHandlerNew(PVMCC pVM, PVMCPUCC pVCpu, uint32_t uErrorCode, RTGCPHYS GCPhysFault); 465 465 VMM_INT_DECL(int) IOMMmioMapMmio2Page(PVMCC pVM, PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion, RTGCPHYS offRegion, 466 466 uint64_t hMmio2, RTGCPHYS offMmio2, uint64_t fPageFlags); … … 493 493 VMMR3_INT_DECL(int) IOMR3IoPortMap(PVM pVM, PPDMDEVINS pDevIns, IOMIOPORTHANDLE hIoPorts, RTIOPORT Port); 494 494 VMMR3_INT_DECL(int) IOMR3IoPortUnmap(PVM pVM, PPDMDEVINS pDevIns, IOMIOPORTHANDLE hIoPorts); 495 VMMR3_INT_DECL(int) IOMR3IoPortValidateHandle(PVM pVM, PPDMDEVINS pDevIns, IOMIOPORTHANDLE hIoPorts); 495 496 496 497 VMMR3_INT_DECL(int) IOMR3MmioCreate(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS cbRegion, uint32_t fFlags, PPDMPCIDEV pPciDev, … … 500 501 VMMR3_INT_DECL(int) IOMR3MmioUnmap(PVM pVM, PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion); 501 502 VMMR3_INT_DECL(int) IOMR3MmioReduce(PVM pVM, PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion, RTGCPHYS cbRegion); 503 VMMR3_INT_DECL(int) IOMR3MmioValidateHandle(PVM pVM, PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion); 502 504 503 505 /** @name obsolete -
trunk/include/VBox/vmm/pdmdev.h
r81333 r81375 857 857 * @param iRegion The region number. 858 858 * @param cbRegion Size of the region. 859 * @param enmType PCI_ADDRESS_SPACE_MEM, PCI_ADDRESS_SPACE_IO or PCI_ADDRESS_SPACE_MEM_PREFETCH. 860 * @param pfnCallback Callback for doing the mapping. 859 * @param enmType PCI_ADDRESS_SPACE_MEM, PCI_ADDRESS_SPACE_IO or 860 * PCI_ADDRESS_SPACE_MEM_PREFETCH, optionally with 861 * PCI_ADDRESS_SPACE_BAR64 or'ed in. 862 * @param fFlags PDMPCIDEV_IORGN_F_XXX. 863 * @param hHandle An I/O port, MMIO or MMIO2 handle according to 864 * @a fFlags, UINT64_MAX if no handle is passed 865 * (old style). 866 * @param pfnCallback Callback for doing the mapping. Optional if a handle 867 * is given. 861 868 * @remarks Caller enters the PDM critical section. 862 869 */ 863 DECLR3CALLBACKMEMBER(int, pfnIORegionRegisterR3,(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, int iRegion, RTGCPHYS cbRegion, 864 PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnCallback)); 870 DECLR3CALLBACKMEMBER(int, pfnIORegionRegisterR3,(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion, 871 RTGCPHYS cbRegion, PCIADDRESSSPACE enmType, uint32_t fFlags, 872 uint64_t hHandle, PFNPCIIOREGIONMAP pfnCallback)); 865 873 866 874 /** … … 930 938 typedef PDMPCIBUSREGR3 *PPDMPCIBUSREGR3; 931 939 /** Current PDMPCIBUSREGR3 version number. */ 932 #define PDM_PCIBUSREGR3_VERSION PDM_VERSION_MAKE(0xff86, 1, 0)940 #define PDM_PCIBUSREGR3_VERSION PDM_VERSION_MAKE(0xff86, 2, 0) 933 941 934 942 /** … … 2223 2231 2224 2232 2233 /** @name Flags for PCI I/O region registration 2234 * @{ */ 2235 /** No handle is passed. */ 2236 #define PDMPCIDEV_IORGN_F_NO_HANDLE UINT32_C(0x00000000) 2237 /** An I/O port handle is passed. */ 2238 #define PDMPCIDEV_IORGN_F_IOPORT_HANDLE UINT32_C(0x00000001) 2239 /** An MMIO range handle is passed. */ 2240 #define PDMPCIDEV_IORGN_F_MMIO_HANDLE UINT32_C(0x00000002) 2241 /** An MMIO2 handle is passed. */ 2242 #define PDMPCIDEV_IORGN_F_MMIO2_HANDLE UINT32_C(0x00000003) 2243 /** Handle type mask. */ 2244 #define PDMPCIDEV_IORGN_F_HANDLE_MASK UINT32_C(0x00000003) 2245 /** Mask of valid flags. */ 2246 #define PDMPCIDEV_IORGN_F_VALID_MASK UINT32_C(0x00000003) 2247 /** @} */ 2248 2249 2225 2250 #ifdef IN_RING3 2226 2251 2227 2252 /** @name Special values for PDMDEVHLPR3::pfnPCIRegister parameters. 2228 * @{ 2253 * @{ */ 2229 2254 /** Same device number (and bus) as the previous PCI device registered with the PDM device. 2230 2255 * This is handy when registering multiple PCI device functions and the device … … 2244 2269 /** Valid flag mask. */ 2245 2270 # define PDMPCIDEVREG_F_VALID_MASK UINT32_C(0x00000003) 2246 /** @} 2271 /** @} */ 2247 2272 2248 2273 /** Current PDMDEVHLPR3 version number. */ 2249 #define PDM_DEVHLPR3_VERSION PDM_VERSION_MAKE_PP(0xffe7, 2 4, 0)2274 #define PDM_DEVHLPR3_VERSION PDM_VERSION_MAKE_PP(0xffe7, 25, 0) 2250 2275 2251 2276 /** … … 3446 3471 * @param cbRegion Size of the region. 3447 3472 * @param enmType PCI_ADDRESS_SPACE_MEM, PCI_ADDRESS_SPACE_IO or PCI_ADDRESS_SPACE_MEM_PREFETCH. 3448 * @param pfnCallback Callback for doing the mapping. 3449 * @remarks The callback will be invoked holding the PDM lock. The device lock 3450 * is NOT take because that is very likely be a lock order violation. 3451 */ 3452 DECLR3CALLBACKMEMBER(int, pfnPCIIORegionRegister,(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion, RTGCPHYS cbRegion, 3453 PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnCallback)); 3473 * @param fFlags PDMPCIDEV_IORGN_F_XXX. 3474 * @param hHandle An I/O port, MMIO or MMIO2 handle according to 3475 * @a fFlags, UINT64_MAX if no handle is passed 3476 * (old style). 3477 * @param pfnCallback Callback for doing the mapping, optional when a 3478 * handle is specified. The callback will be 3479 * invoked holding only the PDM lock. The device 3480 * lock will _not_ be taken (due to lock order). 3481 */ 3482 DECLR3CALLBACKMEMBER(int, pfnPCIIORegionRegister,(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion, 3483 RTGCPHYS cbRegion, PCIADDRESSSPACE enmType, uint32_t fFlags, 3484 uint64_t hHandle, PFNPCIIOREGIONMAP pfnCallback)); 3454 3485 3455 3486 /** … … 5118 5149 typedef struct PDMDEVINSR3 5119 5150 { 5120 /** Structure version. PDM_DEVINS _VERSION defines the current version. */5151 /** Structure version. PDM_DEVINSR3_VERSION defines the current version. */ 5121 5152 uint32_t u32Version; 5122 5153 /** Device instance number. */ … … 5206 5237 5207 5238 /** Current PDMDEVINSR3 version number. */ 5208 #define PDM_DEVINSR3_VERSION PDM_VERSION_MAKE(0xff82, 3, 0)5239 #define PDM_DEVINSR3_VERSION PDM_VERSION_MAKE(0xff82, 4, 0) 5209 5240 5210 5241 /** Converts a pointer to the PDMDEVINSR3::IBase to a pointer to PDMDEVINS. */ … … 5284 5315 5285 5316 /** Current PDMDEVINSR0 version number. */ 5286 #define PDM_DEVINSR0_VERSION PDM_VERSION_MAKE(0xff83, 3, 0)5317 #define PDM_DEVINSR0_VERSION PDM_VERSION_MAKE(0xff83, 4, 0) 5287 5318 5288 5319 … … 5344 5375 5345 5376 /** Current PDMDEVINSR0 version number. */ 5346 #define PDM_DEVINSRC_VERSION PDM_VERSION_MAKE(0xff84, 3, 0)5377 #define PDM_DEVINSRC_VERSION PDM_VERSION_MAKE(0xff84, 4, 0) 5347 5378 5348 5379 … … 5930 5961 { 5931 5962 return pDevIns->pHlpR3->pfnSSMRegister(pDevIns, uVersion, cbGuess, NULL /*pszBefore*/, 5932 5933 5934 5963 NULL /*pfnLivePrep*/, NULL /*pfnLiveExec*/, NULL /*pfnLiveDone*/, 5964 NULL /*pfnSavePrep*/, pfnSaveExec, NULL /*pfnSaveDone*/, 5965 NULL /*pfnLoadPrep*/, pfnLoadExec, NULL /*pfnLoadDone*/); 5935 5966 } 5936 5967 … … 5951 5982 { 5952 5983 return pDevIns->pHlpR3->pfnSSMRegister(pDevIns, uVersion, cbGuess, NULL /*pszBefore*/, 5953 5954 5955 5984 NULL /*pfnLivePrep*/, pfnLiveExec, NULL /*pfnLiveDone*/, 5985 NULL /*pfnSavePrep*/, pfnSaveExec, NULL /*pfnSaveDone*/, 5986 NULL /*pfnLoadPrep*/, pfnLoadExec, NULL /*pfnLoadDone*/); 5956 5987 } 5957 5988 … … 6435 6466 6436 6467 /** 6468 * Initialize MSI emulation support for the first PCI device. 6469 * 6470 * @returns VBox status code. 6471 * @param pDevIns The device instance. 6472 * @param pMsiReg MSI emulation registration structure. 6473 */ 6474 DECLINLINE(int) PDMDevHlpPCIRegisterMsi(PPDMDEVINS pDevIns, PPDMMSIREG pMsiReg) 6475 { 6476 return pDevIns->pHlpR3->pfnPCIRegisterMsi(pDevIns, NULL, pMsiReg); 6477 } 6478 6479 /** 6480 * @copydoc PDMDEVHLPR3::pfnPCIRegisterMsi 6481 */ 6482 DECLINLINE(int) PDMDevHlpPCIRegisterMsiEx(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, PPDMMSIREG pMsiReg) 6483 { 6484 return pDevIns->pHlpR3->pfnPCIRegisterMsi(pDevIns, pPciDev, pMsiReg); 6485 } 6486 6487 /** 6437 6488 * Registers a I/O region (memory mapped or I/O ports) for the default PCI 6438 6489 * device. … … 6447 6498 * is NOT take because that is very likely be a lock order violation. 6448 6499 */ 6449 DECLINLINE(int) PDMDevHlpPCIIORegionRegister(PPDMDEVINS pDevIns, int iRegion, RTGCPHYS cbRegion,6500 DECLINLINE(int) PDMDevHlpPCIIORegionRegister(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS cbRegion, 6450 6501 PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnCallback) 6451 6502 { 6452 return pDevIns->pHlpR3->pfnPCIIORegionRegister(pDevIns, NULL, iRegion, cbRegion, enmType, pfnCallback); 6503 return pDevIns->pHlpR3->pfnPCIIORegionRegister(pDevIns, NULL, iRegion, cbRegion, enmType, 6504 PDMPCIDEV_IORGN_F_NO_HANDLE, UINT64_MAX, pfnCallback); 6453 6505 } 6454 6506 … … 6456 6508 * @copydoc PDMDEVHLPR3::pfnPCIIORegionRegister 6457 6509 */ 6458 DECLINLINE(int) PDMDevHlpPCIIORegionRegisterEx(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, int iRegion, RTGCPHYS cbRegion,6510 DECLINLINE(int) PDMDevHlpPCIIORegionRegisterEx(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion, RTGCPHYS cbRegion, 6459 6511 PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnCallback) 6460 6512 { 6461 return pDevIns->pHlpR3->pfnPCIIORegionRegister(pDevIns, pPciDev, iRegion, cbRegion, enmType, pfnCallback); 6462 } 6463 6464 /** 6465 * Initialize MSI emulation support for the first PCI device. 6513 return pDevIns->pHlpR3->pfnPCIIORegionRegister(pDevIns, pPciDev, iRegion, cbRegion, enmType, 6514 PDMPCIDEV_IORGN_F_NO_HANDLE, UINT64_MAX, pfnCallback); 6515 } 6516 6517 /** 6518 * Registers a I/O port region for the default PCI device. 6466 6519 * 6467 6520 * @returns VBox status code. 6468 * @param pDevIns The device instance. 6469 * @param pMsiReg MSI emulation registration structure. 6470 */ 6471 DECLINLINE(int) PDMDevHlpPCIRegisterMsi(PPDMDEVINS pDevIns, PPDMMSIREG pMsiReg) 6472 { 6473 return pDevIns->pHlpR3->pfnPCIRegisterMsi(pDevIns, NULL, pMsiReg); 6474 } 6475 6476 /** 6477 * @copydoc PDMDEVHLPR3::pfnPCIRegisterMsi 6478 */ 6479 DECLINLINE(int) PDMDevHlpPCIRegisterMsiEx(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, PPDMMSIREG pMsiReg) 6480 { 6481 return pDevIns->pHlpR3->pfnPCIRegisterMsi(pDevIns, pPciDev, pMsiReg); 6482 } 6521 * @param pDevIns The device instance. 6522 * @param iRegion The region number. 6523 * @param cbRegion Size of the region. 6524 * @param hIoPorts Handle to the I/O port region. 6525 * @param pfnCallback Callback for doing the mapping, optional. The 6526 * callback will be invoked holding only the PDM lock. 6527 * The device lock will _not_ be taken (due to lock 6528 * order). 6529 */ 6530 DECLINLINE(int) PDMDevHlpPCIIORegionRegisterIo(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS cbRegion, 6531 IOMIOPORTHANDLE hIoPorts, PFNPCIIOREGIONMAP pfnCallback) 6532 { 6533 return pDevIns->pHlpR3->pfnPCIIORegionRegister(pDevIns, NULL, iRegion, cbRegion, PCI_ADDRESS_SPACE_IO, 6534 PDMPCIDEV_IORGN_F_IOPORT_HANDLE, hIoPorts, pfnCallback); 6535 } 6536 6537 /** 6538 * Registers an MMIO port region for the default PCI device. 6539 * 6540 * @returns VBox status code. 6541 * @param pDevIns The device instance. 6542 * @param iRegion The region number. 6543 * @param cbRegion Size of the region. 6544 * @param enmType PCI_ADDRESS_SPACE_MEM or 6545 * PCI_ADDRESS_SPACE_MEM_PREFETCH, optionally or-ing in 6546 * PCI_ADDRESS_SPACE_BAR64 or PCI_ADDRESS_SPACE_BAR32. 6547 * @param hMmioRegion Handle to the MMIO region. 6548 * @param pfnCallback Callback for doing the mapping, optional. The 6549 * callback will be invoked holding only the PDM lock. 6550 * The device lock will _not_ be taken (due to lock 6551 * order). 6552 */ 6553 DECLINLINE(int) PDMDevHlpPCIIORegionRegisterMmio(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS cbRegion, PCIADDRESSSPACE enmType, 6554 IOMMMIOHANDLE hMmioRegion, PFNPCIIOREGIONMAP pfnCallback) 6555 { 6556 return pDevIns->pHlpR3->pfnPCIIORegionRegister(pDevIns, NULL, iRegion, cbRegion, enmType, 6557 PDMPCIDEV_IORGN_F_MMIO_HANDLE, hMmioRegion, pfnCallback); 6558 } 6559 6483 6560 6484 6561 /** -
trunk/include/VBox/vmm/pdmpcidev.h
r81031 r81375 91 91 * Callback function for mapping an PCI I/O region. 92 92 * 93 * This is called when a PCI I/O region is mapped, and for new-style devices 94 * also when unmapped (address set to NIL_RTGCPHYS). For new-style devices, 95 * this callback is optional as the PCI bus calls IOM to map and unmap the 96 * regions. 97 * 98 * Old style devices have to call IOM to map the region themselves, while 99 * unmapping is done by the PCI bus like with the new style devices. 100 * 93 101 * @returns VBox status code. 94 102 * @param pDevIns Pointer to the device instance the PCI device … … 96 104 * @param pPciDev Pointer to the PCI device. 97 105 * @param iRegion The region number. 98 * @param GCPhysAddress Physical address of the region. If enmType is PCI_ADDRESS_SPACE_IO, this 99 * is an I/O port, otherwise it's a physical address. 100 * 101 * NIL_RTGCPHYS indicates that a MMIO2 mapping is about to be unmapped and 102 * that the device deregister access handlers for it and update its internal 103 * state to reflect this. 106 * @param GCPhysAddress Physical address of the region. If @a enmType is 107 * PCI_ADDRESS_SPACE_IO, this is an I/O port, otherwise 108 * it's a physical address. 109 * 110 * NIL_RTGCPHYS indicates that a mapping is about to be 111 * unmapped and that the device deregister access 112 * handlers for it and update its internal state to 113 * reflect this. 104 114 * 105 115 * @param cb Size of the region in bytes. … … 213 223 PFNPCIIOREGIONSWAP pfnSwapRegion)); 214 224 225 /** Reserved for future stuff. */ 226 uint64_t au64Reserved[4 + (R3_ARCH_BITS == 32 ? 1 : 0)]; 227 215 228 /** Internal data. */ 216 229 union … … 219 232 PDMPCIDEVINT s; 220 233 #endif 221 uint8_t padding[ HC_ARCH_BITS == 32 ? 0x60 + 8 : 0x140];234 uint8_t padding[0x180]; 222 235 } Int; 223 236 -
trunk/include/VBox/vmm/pdmpcidevint.h
r81035 r81375 49 49 typedef struct PCIIOREGION 50 50 { 51 /** Current PCI mapping address, 0xffffffffmeans not mapped. */51 /** Current PCI mapping address, INVALID_PCI_ADDRESS (0xffffffff) means not mapped. */ 52 52 uint64_t addr; 53 /** The region size. Power of 2. */ 53 54 uint64_t size; 54 uint8_t type; /* PCIADDRESSSPACE */ 55 uint8_t padding[HC_ARCH_BITS == 32 ? 3 : 7]; 56 /** Callback called when the region is mapped. */ 57 R3PTRTYPE(PFNPCIIOREGIONMAP) map_func; 58 } PCIIOREGION, PCIIORegion; 59 /** Pointer to PCI I/O region. */ 55 /** Handle or UINT64_MAX (see PDMPCIDEV_IORGN_F_HANDLE_MASK in fFlags). */ 56 uint64_t hHandle; 57 /** PDMPCIDEV_IORGN_F_XXXX. */ 58 uint32_t fFlags; 59 /** PCIADDRESSSPACE */ 60 uint8_t type; 61 uint8_t abPadding0[3]; 62 /** Callback called when the region is mapped or unmapped (new style devs). */ 63 R3PTRTYPE(PFNPCIIOREGIONMAP) pfnMap; 64 #if R3_ARCH_BITS == 32 65 uint32_t u32Padding2; 66 #endif 67 } PCIIOREGION; 68 AssertCompileSize(PCIIOREGION, 5*8); 69 /** Pointer to a PCI I/O region. */ 60 70 typedef PCIIOREGION *PPCIIOREGION; 71 /** Pointer to a const PCI I/O region. */ 72 typedef PCIIOREGION const *PCPCIIOREGION; 61 73 62 74 /** … … 200 212 } PDMPCIDEVINT; 201 213 AssertCompileMemberAlignment(PDMPCIDEVINT, aIORegions, 8); 202 AssertCompileSize(PDMPCIDEVINT, HC_ARCH_BITS == 32 ? 0x 60 : 0x140);214 AssertCompileSize(PDMPCIDEVINT, HC_ARCH_BITS == 32 ? 0x98 : 0x178); 203 215 204 216 /** Indicate that PDMPCIDEV::Int.s can be declared. */
Note:
See TracChangeset
for help on using the changeset viewer.