- Timestamp:
- Nov 2, 2019 10:11:47 PM (5 years ago)
- Location:
- trunk/src/VBox/Devices/VirtIO
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VirtIO/Virtio_1_0.cpp
r81628 r81629 411 411 412 412 pVirtio->pDevInsR3 = pDevIns; 413 pVirtio->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);414 pVirtio->pDevInsR0 = PDMDEVINS_2_R0PTR(pDevIns);415 413 } 416 414 … … 1058 1056 1059 1057 pVirtio->pDevInsR3 = pDevIns; 1060 pVirtio->pDevInsR0 = PDMDEVINS_2_R0PTR(pDevIns);1061 pVirtio->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);1062 1058 pVirtio->uDeviceStatus = 0; 1063 1059 pVirtio->cbDevSpecificCfg = cbDevSpecificCfg; -
trunk/src/VBox/Devices/VirtIO/Virtio_1_0.h
r81300 r81629 132 132 * @param cbRead Number of bytes to read 133 133 */ 134 typedef DECLCALLBACK(int) FNVIRTIODEVCAPREAD(PPDMDEVINS pDevIns, uint32_t uOffset, constvoid *pvBuf, uint32_t cbRead);134 typedef DECLCALLBACK(int) FNVIRTIODEVCAPREAD(PPDMDEVINS pDevIns, uint32_t uOffset, void *pvBuf, uint32_t cbRead); 135 135 typedef FNVIRTIODEVCAPREAD *PFNVIRTIODEVCAPREAD; 136 136 … … 140 140 typedef struct VIRTIOCALLBACKS 141 141 { 142 DECLCALLBACKMEMBER(void, pfnVirtioStatusChanged) 143 (VIRTIOHANDLE hVirtio, void *pClient, uint32_t fDriverOk); 144 DECLCALLBACKMEMBER(void, pfnVirtioQueueNotified) 145 (VIRTIOHANDLE hVirtio, void *pClient, uint16_t qIdx); 146 DECLCALLBACKMEMBER(int, pfnVirtioDevCapRead) 147 (PPDMDEVINS pDevIns, uint32_t uOffset, const void *pvBuf, uint32_t cbRead); 148 DECLCALLBACKMEMBER(int, pfnVirtioDevCapWrite) 149 (PPDMDEVINS pDevIns, uint32_t uOffset, const void *pvBuf, uint32_t cbWrite); 150 DECLCALLBACKMEMBER(int, pfnSSMDevLiveExec) 151 (PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uPass); 152 DECLCALLBACKMEMBER(int, pfnSSMDevSaveExec) 153 (PPDMDEVINS pDevIns, PSSMHANDLE pSSM); 154 DECLCALLBACKMEMBER(int, pfnSSMDevLoadExec) 155 (PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass); 156 DECLCALLBACKMEMBER(int, pfnSSMDevLoadDone) 157 (PPDMDEVINS pDevIns, PSSMHANDLE pSSM); 158 142 DECLCALLBACKMEMBER(void, pfnVirtioStatusChanged)(VIRTIOHANDLE hVirtio, void *pClient, uint32_t fDriverOk); 143 DECLCALLBACKMEMBER(void, pfnVirtioQueueNotified)(VIRTIOHANDLE hVirtio, void *pClient, uint16_t qIdx); 144 DECLCALLBACKMEMBER(int, pfnVirtioDevCapRead)(PPDMDEVINS pDevIns, uint32_t uOffset, const void *pvBuf, uint32_t cbRead); 145 DECLCALLBACKMEMBER(int, pfnVirtioDevCapWrite)(PPDMDEVINS pDevIns, uint32_t uOffset, const void *pvBuf, uint32_t cbWrite); 146 DECLCALLBACKMEMBER(int, pfnSSMDevLiveExec)(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uPass); 147 DECLCALLBACKMEMBER(int, pfnSSMDevSaveExec)(PPDMDEVINS pDevIns, PSSMHANDLE pSSM); 148 DECLCALLBACKMEMBER(int, pfnSSMDevLoadExec)(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass); 149 DECLCALLBACKMEMBER(int, pfnSSMDevLoadDone)(PPDMDEVINS pDevIns, PSSMHANDLE pSSM); 159 150 } VIRTIOCALLBACKS, *PVIRTIOCALLBACKS; 160 151 /** @} */ -
trunk/src/VBox/Devices/VirtIO/Virtio_1_0_impl.h
r81628 r81629 127 127 struct virtio_pci_cap pciCap; /**< Notification MMIO mapping capability */ 128 128 uint32_t uNotifyOffMultiplier; /**< notify_off_multiplier */ 129 } VIRTIO_PCI_NOTIFY_CAP_T,*PVIRTIO_PCI_NOTIFY_CAP_T;129 } VIRTIO_PCI_NOTIFY_CAP_T, *PVIRTIO_PCI_NOTIFY_CAP_T; 130 130 131 131 typedef struct virtio_pci_cfg_cap … … 133 133 struct virtio_pci_cap pciCap; /**< Cap. defines the BAR/off/len to access */ 134 134 uint8_t uPciCfgData[4]; /**< I/O buf for above cap. */ 135 } VIRTIO_PCI_CFG_CAP_T, 135 } VIRTIO_PCI_CFG_CAP_T, *PVIRTIO_PCI_CFG_CAP_T; 136 136 137 137 /** … … 142 142 typedef struct VIRTIOSTATE 143 143 { 144 char szInstance[16]; /**< Instance name, e.g. "VIRTIOSCSI0" */ 145 void * pClientContext; /**< Client callback returned on callbacks */ 146 147 PPDMDEVINSR3 pDevInsR3; /**< Device instance - R3 */ 148 PPDMDEVINSR0 pDevInsR0; /**< Device instance - R0 */ 149 PPDMDEVINSRC pDevInsRC; /**< Device instance - RC */ 150 151 RTGCPHYS pGcPhysPciCapBase; /**< Pointer to MMIO mapped capability data */ 152 RTGCPHYS pGcPhysCommonCfg; /**< Pointer to MMIO mapped capability data */ 153 RTGCPHYS pGcPhysNotifyCap; /**< Pointer to MMIO mapped capability data */ 154 RTGCPHYS pGcPhysIsrCap; /**< Pointer to MMIO mapped capability data */ 155 RTGCPHYS pGcPhysDeviceCap; /**< Pointer to MMIO mapped capability data */ 156 157 RTGCPHYS pGcPhysQueueDesc[VIRTQ_MAX_CNT]; /**< (MMIO) PhysAdr per-Q desc structs GUEST */ 158 RTGCPHYS pGcPhysQueueAvail[VIRTQ_MAX_CNT]; /**< (MMIO) PhysAdr per-Q avail structs GUEST */ 159 RTGCPHYS pGcPhysQueueUsed[VIRTQ_MAX_CNT]; /**< (MMIO) PhysAdr per-Q used structs GUEST */ 160 uint16_t uQueueNotifyOff[VIRTQ_MAX_CNT]; /**< (MMIO) per-Q notify offset HOST */ 161 uint16_t uQueueMsixVector[VIRTQ_MAX_CNT]; /**< (MMIO) Per-queue vector for MSI-X GUEST */ 162 uint16_t uQueueEnable[VIRTQ_MAX_CNT]; /**< (MMIO) Per-queue enable GUEST */ 163 uint16_t uQueueSize[VIRTQ_MAX_CNT]; /**< (MMIO) Per-queue size HOST/GUEST */ 164 uint16_t uQueueSelect; /**< (MMIO) queue selector GUEST */ 165 uint16_t padding; 166 uint64_t uDeviceFeatures; /**< (MMIO) Host features offered HOST */ 167 uint64_t uDriverFeatures; /**< (MMIO) Host features accepted GUEST */ 168 uint32_t uDeviceFeaturesSelect; /**< (MMIO) hi/lo select uDeviceFeatures GUEST */ 169 uint32_t uDriverFeaturesSelect; /**< (MMIO) hi/lo select uDriverFeatures GUEST */ 170 uint32_t uMsixConfig; /**< (MMIO) MSI-X vector GUEST */ 171 uint32_t uNumQueues; /**< (MMIO) Actual number of queues GUEST */ 172 uint8_t uDeviceStatus; /**< (MMIO) Device Status GUEST */ 173 uint8_t uPrevDeviceStatus; /**< (MMIO) Prev Device Status GUEST */ 174 uint8_t uConfigGeneration; /**< (MMIO) Device config sequencer HOST */ 175 176 VIRTQSTATE virtqState[VIRTQ_MAX_CNT]; /**< Local impl-specific queue context */ 177 VIRTIOCALLBACKS virtioCallbacks; /**< Callback vectors to client */ 178 179 PVIRTIO_PCI_CFG_CAP_T pPciCfgCap; /**< Pointer to struct in configuration area */ 180 PVIRTIO_PCI_NOTIFY_CAP_T pNotifyCap; /**< Pointer to struct in configuration area */ 181 PVIRTIO_PCI_CAP_T pCommonCfgCap; /**< Pointer to struct in configuration area */ 182 PVIRTIO_PCI_CAP_T pIsrCap; /**< Pointer to struct in configuration area */ 183 PVIRTIO_PCI_CAP_T pDeviceCap; /**< Pointer to struct in configuration area */ 184 185 uint32_t cbDevSpecificCfg; /**< Size of client's dev-specific config data */ 186 void *pDevSpecificCfg; /**< Pointer to client's struct */ 187 void *pPrevDevSpecificCfg; /**< Previous read dev-specific cfg of client */ 188 bool fGenUpdatePending; /**< If set, update cfg gen after driver reads */ 189 uint8_t uPciCfgDataOff; 190 uint8_t uISR; /**< Interrupt Status Register. */ 191 uint8_t fMsiSupport; 144 char szInstance[16]; /**< Instance name, e.g. "VIRTIOSCSI0" */ 145 R3PTRTYPE(void *) pClientContext; /**< Client callback returned on callbacks */ 146 147 PPDMDEVINSR3 pDevInsR3; /**< Device instance - R3 */ 148 149 RTGCPHYS pGcPhysPciCapBase; /**< Pointer to MMIO mapped capability data */ 150 RTGCPHYS pGcPhysCommonCfg; /**< Pointer to MMIO mapped capability data */ 151 RTGCPHYS pGcPhysNotifyCap; /**< Pointer to MMIO mapped capability data */ 152 RTGCPHYS pGcPhysIsrCap; /**< Pointer to MMIO mapped capability data */ 153 RTGCPHYS pGcPhysDeviceCap; /**< Pointer to MMIO mapped capability data */ 154 155 RTGCPHYS pGcPhysQueueDesc[VIRTQ_MAX_CNT]; /**< (MMIO) PhysAdr per-Q desc structs GUEST */ 156 RTGCPHYS pGcPhysQueueAvail[VIRTQ_MAX_CNT]; /**< (MMIO) PhysAdr per-Q avail structs GUEST */ 157 RTGCPHYS pGcPhysQueueUsed[VIRTQ_MAX_CNT]; /**< (MMIO) PhysAdr per-Q used structs GUEST */ 158 uint16_t uQueueNotifyOff[VIRTQ_MAX_CNT]; /**< (MMIO) per-Q notify offset HOST */ 159 uint16_t uQueueMsixVector[VIRTQ_MAX_CNT]; /**< (MMIO) Per-queue vector for MSI-X GUEST */ 160 uint16_t uQueueEnable[VIRTQ_MAX_CNT]; /**< (MMIO) Per-queue enable GUEST */ 161 uint16_t uQueueSize[VIRTQ_MAX_CNT]; /**< (MMIO) Per-queue size HOST/GUEST */ 162 uint16_t uQueueSelect; /**< (MMIO) queue selector GUEST */ 163 uint16_t padding; 164 uint64_t uDeviceFeatures; /**< (MMIO) Host features offered HOST */ 165 uint64_t uDriverFeatures; /**< (MMIO) Host features accepted GUEST */ 166 uint32_t uDeviceFeaturesSelect; /**< (MMIO) hi/lo select uDeviceFeatures GUEST */ 167 uint32_t uDriverFeaturesSelect; /**< (MMIO) hi/lo select uDriverFeatures GUEST */ 168 uint32_t uMsixConfig; /**< (MMIO) MSI-X vector GUEST */ 169 uint32_t uNumQueues; /**< (MMIO) Actual number of queues GUEST */ 170 uint8_t uDeviceStatus; /**< (MMIO) Device Status GUEST */ 171 uint8_t uPrevDeviceStatus; /**< (MMIO) Prev Device Status GUEST */ 172 uint8_t uConfigGeneration; /**< (MMIO) Device config sequencer HOST */ 173 174 VIRTQSTATE virtqState[VIRTQ_MAX_CNT]; /**< Local impl-specific queue context */ 175 VIRTIOCALLBACKS virtioCallbacks; /**< Callback vectors to client */ 176 177 PVIRTIO_PCI_CFG_CAP_T pPciCfgCap; /**< Pointer to struct in configuration area */ 178 PVIRTIO_PCI_NOTIFY_CAP_T pNotifyCap; /**< Pointer to struct in configuration area */ 179 PVIRTIO_PCI_CAP_T pCommonCfgCap; /**< Pointer to struct in configuration area */ 180 PVIRTIO_PCI_CAP_T pIsrCap; /**< Pointer to struct in configuration area */ 181 PVIRTIO_PCI_CAP_T pDeviceCap; /**< Pointer to struct in configuration area */ 182 183 uint32_t cbDevSpecificCfg; /**< Size of client's dev-specific config data */ 184 void *pDevSpecificCfg; /**< Pointer to client's struct */ 185 void *pPrevDevSpecificCfg; /**< Previous read dev-specific cfg of client */ 186 bool fGenUpdatePending; /**< If set, update cfg gen after driver reads */ 187 uint8_t uPciCfgDataOff; 188 uint8_t uISR; /**< Interrupt Status Register. */ 189 uint8_t fMsiSupport; 192 190 193 191 } VIRTIOSTATE, *PVIRTIOSTATE;
Note:
See TracChangeset
for help on using the changeset viewer.