Changeset 80960 in vbox
- Timestamp:
- Sep 23, 2019 8:54:03 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 133547
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/iom.h
r80679 r80960 243 243 typedef FNIOMIOPORTOUTSTRING *PFNIOMIOPORTOUTSTRING; 244 244 245 246 /** 247 * Port I/O Handler for IN operations. 248 * 249 * @returns VINF_SUCCESS or VINF_EM_*. 250 * @returns VERR_IOM_IOPORT_UNUSED if the port is really unused and a ~0 value should be returned. 251 * 252 * @param pDevIns The device instance. 253 * @param pvUser User argument. 254 * @param uPort Port number used for the IN operation. 255 * @param pu32 Where to store the result. This is always a 32-bit 256 * variable regardless of what @a cb might say. 257 * @param cb Number of bytes read. 258 * @remarks Caller enters the device critical section. 259 */ 260 typedef DECLCALLBACK(VBOXSTRICTRC) FNIOMIOPORTNEWIN(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t *pu32, unsigned cb); 261 /** Pointer to a FNIOMIOPORTNEWIN(). */ 262 typedef FNIOMIOPORTNEWIN *PFNIOMIOPORTNEWIN; 263 264 /** 265 * Port I/O Handler for string IN operations. 266 * 267 * @returns VINF_SUCCESS or VINF_EM_*. 268 * @returns VERR_IOM_IOPORT_UNUSED if the port is really unused and a ~0 value should be returned. 269 * 270 * @param pDevIns The device instance. 271 * @param pvUser User argument. 272 * @param uPort Port number used for the IN operation. 273 * @param pbDst Pointer to the destination buffer. 274 * @param pcTransfers Pointer to the number of transfer units to read, on 275 * return remaining transfer units. 276 * @param cb Size of the transfer unit (1, 2 or 4 bytes). 277 * @remarks Caller enters the device critical section. 278 */ 279 typedef DECLCALLBACK(VBOXSTRICTRC) FNIOMIOPORTNEWINSTRING(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint8_t *pbDst, 280 uint32_t *pcTransfers, unsigned cb); 281 /** Pointer to a FNIOMIOPORTNEWINSTRING(). */ 282 typedef FNIOMIOPORTNEWINSTRING *PFNIOMIOPORTNEWINSTRING; 283 284 /** 285 * Port I/O Handler for OUT operations. 286 * 287 * @returns VINF_SUCCESS or VINF_EM_*. 288 * 289 * @param pDevIns The device instance. 290 * @param pvUser User argument. 291 * @param uPort Port number used for the OUT operation. 292 * @param u32 The value to output. 293 * @param cb The value size in bytes. 294 * @remarks Caller enters the device critical section. 295 */ 296 typedef DECLCALLBACK(VBOXSTRICTRC) FNIOMIOPORTNEWOUT(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb); 297 /** Pointer to a FNIOMIOPORTNEWOUT(). */ 298 typedef FNIOMIOPORTNEWOUT *PFNIOMIOPORTNEWOUT; 299 300 /** 301 * Port I/O Handler for string OUT operations. 302 * 303 * @returns VINF_SUCCESS or VINF_EM_*. 304 * 305 * @param pDevIns The device instance. 306 * @param pvUser User argument. 307 * @param uPort Port number used for the OUT operation. 308 * @param pbSrc Pointer to the source buffer. 309 * @param pcTransfers Pointer to the number of transfer units to write, on 310 * return remaining transfer units. 311 * @param cb Size of the transfer unit (1, 2 or 4 bytes). 312 * @remarks Caller enters the device critical section. 313 */ 314 typedef DECLCALLBACK(VBOXSTRICTRC) FNIOMIOPORTNEWOUTSTRING(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, const uint8_t *pbSrc, 315 uint32_t *pcTransfers, unsigned cb); 316 /** Pointer to a FNIOMIOPORTNEWOUTSTRING(). */ 317 typedef FNIOMIOPORTNEWOUTSTRING *PFNIOMIOPORTNEWOUTSTRING; 318 245 319 /** 246 320 * I/O port description. … … 338 412 339 413 VMMR3_INT_DECL(int) IOMR3IoPortCreate(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT cPorts, uint32_t fFlags, PPDMPCIDEV pPciDev, 340 uint32_t iPciRegion, PFNIOMIOPORT OUT pfnOut, PFNIOMIOPORTIN pfnIn,341 PFNIOMIOPORT OUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, RTR3PTR pvUser,414 uint32_t iPciRegion, PFNIOMIOPORTNEWOUT pfnOut, PFNIOMIOPORTNEWIN pfnIn, 415 PFNIOMIOPORTNEWOUTSTRING pfnOutStr, PFNIOMIOPORTNEWINSTRING pfnInStr, RTR3PTR pvUser, 342 416 const char *pszDesc, PCIOMIOPORTDESC paExtDescs, PIOMIOPORTHANDLE phIoPorts); 343 417 VMMR3_INT_DECL(int) IOMR3IoPortMap(PVM pVM, PPDMDEVINS pDevIns, IOMIOPORTHANDLE hIoPorts, RTIOPORT Port); … … 409 483 VMMR0_INT_DECL(void) IOMR0CleanupVM(PGVM pGVM); 410 484 VMMR0_INT_DECL(int) IOMR0IoPortSetUpContext(PGVM pGVM, PPDMDEVINS pDevIns, IOMIOPORTHANDLE hIoPorts, 411 PFNIOMIOPORT OUT pfnOut, PFNIOMIOPORTIN pfnIn,412 PFNIOMIOPORT OUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, void *pvUser);485 PFNIOMIOPORTNEWOUT pfnOut, PFNIOMIOPORTNEWIN pfnIn, 486 PFNIOMIOPORTNEWOUTSTRING pfnOutStr, PFNIOMIOPORTNEWINSTRING pfnInStr, void *pvUser); 413 487 VMMR0_INT_DECL(int) IOMR0IoPortGrowRegistrationTables(PGVM pGVM, uint64_t cMinEntries); 414 488 VMMR0_INT_DECL(int) IOMR0IoPortGrowStatisticsTable(PGVM pGVM, uint64_t cMinEntries); -
trunk/include/VBox/vmm/pdmdev.h
r80943 r80960 1058 1058 DECLRCCALLBACKMEMBER(void, pfnUnlock,(PPDMDEVINS pDevIns)); 1059 1059 1060 /** 1061 * Gets a bus by it's PDM ordinal (typically the parent bus). 1062 * 1063 * @returns Pointer to the device instance of the bus. 1064 * @param pDevIns The PCI bus device instance. 1065 * @param idxPdmBus The PDM ordinal value of the bus to get. 1066 */ 1067 DECLRCCALLBACKMEMBER(PPDMDEVINS, pfnGetBusByNo,(PPDMDEVINS pDevIns, uint32_t idxPdmBus)); 1068 1060 1069 /** Just a safety precaution. */ 1061 1070 uint32_t u32TheEnd; … … 1111 1120 DECLR0CALLBACKMEMBER(void, pfnIoApicSendMsi,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, uint32_t uValue, uint32_t uTagSrc)); 1112 1121 1113 1114 1122 /** 1115 1123 * Acquires the PDM lock. … … 1128 1136 */ 1129 1137 DECLR0CALLBACKMEMBER(void, pfnUnlock,(PPDMDEVINS pDevIns)); 1138 1139 /** 1140 * Gets a bus by it's PDM ordinal (typically the parent bus). 1141 * 1142 * @returns Pointer to the device instance of the bus. 1143 * @param pDevIns The PCI bus device instance. 1144 * @param idxPdmBus The PDM ordinal value of the bus to get. 1145 */ 1146 DECLR0CALLBACKMEMBER(PPDMDEVINS, pfnGetBusByNo,(PPDMDEVINS pDevIns, uint32_t idxPdmBus)); 1130 1147 1131 1148 /** Just a safety precaution. */ … … 1138 1155 1139 1156 /** Current PDMPCIHLPR0 version number. */ 1140 #define PDM_PCIHLPR0_VERSION PDM_VERSION_MAKE(0xfffc, 3, 0)1157 #define PDM_PCIHLPR0_VERSION PDM_VERSION_MAKE(0xfffc, 4, 0) 1141 1158 1142 1159 /** … … 1190 1207 1191 1208 /** 1192 * Gets the address of the RC PCI Bus helpers.1193 *1194 * This should be called at both construction and relocation time1195 * to obtain the correct address of the RC helpers.1196 *1197 * @returns RC pointer to the PCI Bus helpers.1198 * @param pDevIns Device instance of the PCI Bus.1199 * @thread EMT only.1200 */1201 DECLR3CALLBACKMEMBER(PCPDMPCIHLPRC, pfnGetRCHelpers,(PPDMDEVINS pDevIns));1202 1203 /**1204 * Gets the address of the R0 PCI Bus helpers.1205 *1206 * This should be called at both construction and relocation time1207 * to obtain the correct address of the R0 helpers.1208 *1209 * @returns R0 pointer to the PCI Bus helpers.1210 * @param pDevIns Device instance of the PCI Bus.1211 * @thread EMT only.1212 */1213 DECLR3CALLBACKMEMBER(PCPDMPCIHLPR0, pfnGetR0Helpers,(PPDMDEVINS pDevIns));1214 1215 /**1216 1209 * Acquires the PDM lock. 1217 1210 * … … 1229 1222 */ 1230 1223 DECLR3CALLBACKMEMBER(void, pfnUnlock,(PPDMDEVINS pDevIns)); 1224 1225 /** 1226 * Gets a bus by it's PDM ordinal (typically the parent bus). 1227 * 1228 * @returns Pointer to the device instance of the bus. 1229 * @param pDevIns The PCI bus device instance. 1230 * @param idxPdmBus The PDM ordinal value of the bus to get. 1231 */ 1232 DECLR3CALLBACKMEMBER(PPDMDEVINS, pfnGetBusByNo,(PPDMDEVINS pDevIns, uint32_t idxPdmBus)); 1231 1233 1232 1234 /** Just a safety precaution. */ … … 1239 1241 1240 1242 /** Current PDMPCIHLPR3 version number. */ 1241 #define PDM_PCIHLPR3_VERSION PDM_VERSION_MAKE(0xfffb, 3, 1)1243 #define PDM_PCIHLPR3_VERSION PDM_VERSION_MAKE(0xfffb, 4, 0) 1242 1244 1243 1245 … … 2297 2299 */ 2298 2300 DECLR3CALLBACKMEMBER(int, pfnIoPortCreateEx,(PPDMDEVINS pDevIns, RTIOPORT cPorts, uint32_t fFlags, PPDMPCIDEV pPciDev, 2299 uint32_t iPciRegion, PFNIOMIOPORT OUT pfnOut, PFNIOMIOPORTIN pfnIn,2300 PFNIOMIOPORT OUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, RTR3PTR pvUser,2301 uint32_t iPciRegion, PFNIOMIOPORTNEWOUT pfnOut, PFNIOMIOPORTNEWIN pfnIn, 2302 PFNIOMIOPORTNEWOUTSTRING pfnOutStr, PFNIOMIOPORTNEWINSTRING pfnInStr, RTR3PTR pvUser, 2301 2303 const char *pszDesc, PCIOMIOPORTDESC paExtDescs, PIOMIOPORTHANDLE phIoPorts)); 2302 2304 … … 4410 4412 */ 4411 4413 DECLRCCALLBACKMEMBER(int, pfnIoPortSetUpContextEx,(PPDMDEVINS pDevIns, IOMIOPORTHANDLE hIoPorts, 4412 PFNIOMIOPORT OUT pfnOut, PFNIOMIOPORTIN pfnIn,4413 PFNIOMIOPORT OUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr,4414 PFNIOMIOPORTNEWOUT pfnOut, PFNIOMIOPORTNEWIN pfnIn, 4415 PFNIOMIOPORTNEWOUTSTRING pfnOutStr, PFNIOMIOPORTNEWINSTRING pfnInStr, 4414 4416 void *pvUser)); 4415 4417 … … 4766 4768 */ 4767 4769 DECLR0CALLBACKMEMBER(int, pfnIoPortSetUpContextEx,(PPDMDEVINS pDevIns, IOMIOPORTHANDLE hIoPorts, 4768 PFNIOMIOPORT OUT pfnOut, PFNIOMIOPORTIN pfnIn,4769 PFNIOMIOPORT OUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr,4770 PFNIOMIOPORTNEWOUT pfnOut, PFNIOMIOPORTNEWIN pfnIn, 4771 PFNIOMIOPORTNEWOUTSTRING pfnOutStr, PFNIOMIOPORTNEWINSTRING pfnInStr, 4770 4772 void *pvUser)); 4771 4773 … … 5532 5534 * Combines PDMDevHlpIoPortCreate() & PDMDevHlpIoPortMap(). 5533 5535 */ 5534 DECLINLINE(int) PDMDevHlpIoPortCreateAndMap(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts, PFNIOMIOPORT OUT pfnOut,5535 PFNIOMIOPORT IN pfnIn, const char *pszDesc, PCIOMIOPORTDESC paExtDescs,5536 DECLINLINE(int) PDMDevHlpIoPortCreateAndMap(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts, PFNIOMIOPORTNEWOUT pfnOut, 5537 PFNIOMIOPORTNEWIN pfnIn, const char *pszDesc, PCIOMIOPORTDESC paExtDescs, 5536 5538 PIOMIOPORTHANDLE phIoPorts) 5537 5539 { … … 5547 5549 */ 5548 5550 DECLINLINE(int) PDMDevHlpIoPortCreate(PPDMDEVINS pDevIns, RTIOPORT cPorts, PPDMPCIDEV pPciDev, uint32_t iPciRegion, 5549 PFNIOMIOPORT OUT pfnOut, PFNIOMIOPORTIN pfnIn, void *pvUser, const char *pszDesc,5551 PFNIOMIOPORTNEWOUT pfnOut, PFNIOMIOPORTNEWIN pfnIn, void *pvUser, const char *pszDesc, 5550 5552 PCIOMIOPORTDESC paExtDescs, PIOMIOPORTHANDLE phIoPorts) 5551 5553 { … … 5558 5560 */ 5559 5561 DECLINLINE(int) PDMDevHlpIoPortCreateEx(PPDMDEVINS pDevIns, RTIOPORT cPorts, uint32_t fFlags, PPDMPCIDEV pPciDev, 5560 uint32_t iPciRegion, PFNIOMIOPORT OUT pfnOut, PFNIOMIOPORTIN pfnIn,5561 PFNIOMIOPORT OUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, void *pvUser,5562 uint32_t iPciRegion, PFNIOMIOPORTNEWOUT pfnOut, PFNIOMIOPORTNEWIN pfnIn, 5563 PFNIOMIOPORTNEWOUTSTRING pfnOutStr, PFNIOMIOPORTNEWINSTRING pfnInStr, void *pvUser, 5562 5564 const char *pszDesc, PCIOMIOPORTDESC paExtDescs, PIOMIOPORTHANDLE phIoPorts) 5563 5565 { … … 5589 5591 */ 5590 5592 DECLINLINE(int) PDMDevHlpIoPortSetUpContext(PPDMDEVINS pDevIns, IOMIOPORTHANDLE hIoPorts, 5591 PFNIOMIOPORT OUT pfnOut, PFNIOMIOPORTIN pfnIn, void *pvUser)5593 PFNIOMIOPORTNEWOUT pfnOut, PFNIOMIOPORTNEWIN pfnIn, void *pvUser) 5592 5594 { 5593 5595 return pDevIns->CTX_SUFF(pHlp)->pfnIoPortSetUpContextEx(pDevIns, hIoPorts, pfnOut, pfnIn, NULL, NULL, pvUser); … … 5598 5600 */ 5599 5601 DECLINLINE(int) PDMDevHlpIoPortSetUpContextEx(PPDMDEVINS pDevIns, IOMIOPORTHANDLE hIoPorts, 5600 PFNIOMIOPORT OUT pfnOut, PFNIOMIOPORTIN pfnIn,5601 PFNIOMIOPORT OUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, void *pvUser)5602 PFNIOMIOPORTNEWOUT pfnOut, PFNIOMIOPORTNEWIN pfnIn, 5603 PFNIOMIOPORTNEWOUTSTRING pfnOutStr, PFNIOMIOPORTNEWINSTRING pfnInStr, void *pvUser) 5602 5604 { 5603 5605 return pDevIns->CTX_SUFF(pHlp)->pfnIoPortSetUpContextEx(pDevIns, hIoPorts, pfnOut, pfnIn, pfnOutStr, pfnInStr, pvUser); -
trunk/include/VBox/vmm/pdmpcidevint.h
r80943 r80960 178 178 R3PTRTYPE(PFNPCIBRIDGECONFIGWRITE) pfnBridgeConfigWrite; 179 179 180 /** Pointer to the PCI bus of the device. (R0 ptr)181 * @note Only used by ich9pcibridgeSetIrq to find the host (root) bus. */182 R0PTRTYPE(struct DEVPCIBUS *) pBusR0;183 180 /** Page used for MSI-X state. (R0 ptr) */ 184 181 R0PTRTYPE(void *) pMsixPageR0; 185 186 /** Pointer to the PCI bus of the device. (RC ptr)187 * @note Only used by ich9pcibridgeSetIrq to find the host (root) bus. */188 RCPTRTYPE(struct DEVPCIBUS *) pBusRC;189 182 /** Page used for MSI-X state. (RC ptr) */ 190 183 RCPTRTYPE(void *) pMsixPageRC; … … 211 204 /** Offset to the PBA for MSI-X. */ 212 205 uint16_t offMsixPba; 213 #if HC_ARCH_BITS == 32 214 /** Add padding to align aIORegions to an 8 byte boundary. */ 215 uint8_t abPadding2[12]; 216 #endif 206 /** Add padding to align aIORegions to an 16 byte boundary. */ 207 uint8_t abPadding2[HC_ARCH_BITS == 32 ? 4+8 : 4+8]; 217 208 218 209 /** Pointer to bus specific data. (R3 ptr) */ -
trunk/src/VBox/Devices/Bus/DevPCI.cpp
r80944 r80960 85 85 86 86 static DECLCALLBACK(void) pcibridgeSetIrq(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, int iIrq, int iLevel, uint32_t uTag); 87 PDMBOTHCBDECL(int) pciIOPortAddressWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb);88 PDMBOTHCBDECL(int) pciIOPortAddressRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb);89 PDMBOTHCBDECL(int) pciIOPortDataWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb);90 PDMBOTHCBDECL(int) pciIOPortDataRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb);91 87 92 88 #ifdef IN_RING3 … … 290 286 * Set the IRQ for a PCI device on the host bus - shared by host bus and bridge. 291 287 * 292 * @param p PdmDevThe PDM device instance for the PCI bus.288 * @param pDevIns The PDM device instance for the PCI bus. 293 289 * @param pGlobals Device instance of the host PCI bus. 294 290 * @param pBusCC Context specific data for the PCI bus. … … 807 803 808 804 /** 809 * @callback_method_impl{FNIOMIOPORT OUT, PCI address}810 */ 811 PDMBOTHCBDECL(int) pciIOPortAddressWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb)805 * @callback_method_impl{FNIOMIOPORTNEWOUT, PCI address} 806 */ 807 static DECLCALLBACK(VBOXSTRICTRC) pciIOPortAddressWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb) 812 808 { 813 809 LogFunc(("Port=%#x u32=%#x cb=%d\n", Port, u32, cb)); … … 827 823 828 824 /** 829 * @callback_method_impl{FNIOMIOPORT IN, PCI address}830 */ 831 PDMBOTHCBDECL(int) pciIOPortAddressRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb)825 * @callback_method_impl{FNIOMIOPORTNEWIN, PCI address} 826 */ 827 static DECLCALLBACK(VBOXSTRICTRC) pciIOPortAddressRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb) 832 828 { 833 829 RT_NOREF2(Port, pvUser); … … 849 845 850 846 /** 851 * @callback_method_impl{FNIOMIOPORT OUT, PCI data}852 */ 853 PDMBOTHCBDECL(int) pciIOPortDataWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb)847 * @callback_method_impl{FNIOMIOPORTNEWOUT, PCI data} 848 */ 849 static DECLCALLBACK(VBOXSTRICTRC) pciIOPortDataWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb) 854 850 { 855 851 LogFunc(("Port=%#x u32=%#x cb=%d\n", Port, u32, cb)); … … 864 860 else 865 861 AssertMsgFailed(("Write to port %#x u32=%#x cb=%d\n", Port, u32, cb)); 866 return VBOXSTRICTRC_TODO(rcStrict);867 } 868 869 870 /** 871 * @callback_method_impl{FNIOMIOPORT IN, PCI data}872 */ 873 PDMBOTHCBDECL(int) pciIOPortDataRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb)862 return rcStrict; 863 } 864 865 866 /** 867 * @callback_method_impl{FNIOMIOPORTNEWIN, PCI data} 868 */ 869 static DECLCALLBACK(VBOXSTRICTRC) pciIOPortDataRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb) 874 870 { 875 871 NOREF(pvUser); … … 880 876 PCI_UNLOCK(pDevIns); 881 877 LogFunc(("Port=%#x cb=%#x -> %#x (%Rrc)\n", Port, cb, *pu32, VBOXSTRICTRC_VAL(rcStrict))); 882 return VBOXSTRICTRC_TODO(rcStrict);878 return rcStrict; 883 879 } 884 880 AssertMsgFailed(("Read from port %#x cb=%d\n", Port, cb)); … … 889 885 890 886 /** 891 * @callback_method_impl{FNIOMIOPORTOUT, PCI data} 892 */ 893 DECLCALLBACK(int) pciR3IOPortMagicPCIWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb) 887 * @callback_method_impl{FNIOMIOPORTNEWOUT, PCI data} 888 */ 889 static DECLCALLBACK(VBOXSTRICTRC) 890 pciR3IOPortMagicPCIWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb) 894 891 { 895 892 RT_NOREF2(pvUser, Port); … … 908 905 909 906 /** 910 * @callback_method_impl{FNIOMIOPORTIN, PCI data} 911 */ 912 DECLCALLBACK(int) pciR3IOPortMagicPCIRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb) 907 * @callback_method_impl{FNIOMIOPORTNEWIN, PCI data} 908 */ 909 static DECLCALLBACK(VBOXSTRICTRC) 910 pciR3IOPortMagicPCIRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb) 913 911 { 914 912 RT_NOREF5(pDevIns, pvUser, Port, pu32, cb); … … 1269 1267 * Validate and read configuration. 1270 1268 */ 1271 if (!CFGMR3AreValuesValid(pCfg, "IOAPIC\0" "GCEnabled\0" "R0Enabled\0")) 1272 return VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES; 1269 PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "IOAPIC", ""); 1273 1270 1274 1271 /* query whether we got an IOAPIC */ … … 1279 1276 N_("Configuration error: Failed to query boolean value \"IOAPIC\"")); 1280 1277 1281 /* check if RC code is enabled. */ 1282 bool fGCEnabled; 1283 rc = CFGMR3QueryBoolDef(pCfg, "GCEnabled", &fGCEnabled, true); 1284 if (RT_FAILURE(rc)) 1285 return PDMDEV_SET_ERROR(pDevIns, rc, 1286 N_("Configuration error: Failed to query boolean value \"GCEnabled\"")); 1287 1288 /* check if R0 code is enabled. */ 1289 bool fR0Enabled; 1290 rc = CFGMR3QueryBoolDef(pCfg, "R0Enabled", &fR0Enabled, true); 1291 if (RT_FAILURE(rc)) 1292 return PDMDEV_SET_ERROR(pDevIns, rc, 1293 N_("Configuration error: Failed to query boolean value \"R0Enabled\"")); 1294 Log(("PCI: fUseIoApic=%RTbool fGCEnabled=%RTbool fR0Enabled=%RTbool\n", fUseIoApic, fGCEnabled, fR0Enabled)); 1295 1278 Log(("PCI: fUseIoApic=%RTbool fR0Enabled=%RTbool fRCEnabled=%RTbool\n", fUseIoApic, pDevIns->fR0Enabled, pDevIns->fRCEnabled)); 1279 1280 /* 1281 * Init data and register the PCI bus. 1282 */ 1296 1283 PDEVPCIBUSCC pBusCC = PDMINS_2_DATA_CC(pDevIns, PDEVPCIBUSCC); 1297 1284 PDEVPCIROOT pGlobals = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 1298 1285 1299 /*1300 * Init data and register the PCI bus.1301 */1302 1286 pGlobals->uPciBiosIo = 0xc000; 1303 1287 pGlobals->uPciBiosMmio = 0xf0000000; … … 1368 1352 * Register I/O ports and save state. 1369 1353 */ 1370 rc = PDMDevHlpIOPortRegister(pDevIns, 0x0cf8, 1, NULL, pciIOPortAddressWrite, pciIOPortAddressRead, NULL, NULL, "i440FX (PCI)"); 1371 if (RT_FAILURE(rc)) 1372 return rc; 1373 rc = PDMDevHlpIOPortRegister(pDevIns, 0x0cfc, 4, NULL, pciIOPortDataWrite, pciIOPortDataRead, NULL, NULL, "i440FX (PCI)"); 1374 if (RT_FAILURE(rc)) 1375 return rc; 1376 if (fGCEnabled) 1377 { 1378 rc = PDMDevHlpIOPortRegisterRC(pDevIns, 0x0cf8, 1, NIL_RTGCPTR, "pciIOPortAddressWrite", "pciIOPortAddressRead", NULL, NULL, "i440FX (PCI)"); 1379 if (RT_FAILURE(rc)) 1380 return rc; 1381 rc = PDMDevHlpIOPortRegisterRC(pDevIns, 0x0cfc, 4, NIL_RTGCPTR, "pciIOPortDataWrite", "pciIOPortDataRead", NULL, NULL, "i440FX (PCI)"); 1382 if (RT_FAILURE(rc)) 1383 return rc; 1384 } 1385 if (fR0Enabled) 1386 { 1387 rc = PDMDevHlpIOPortRegisterR0(pDevIns, 0x0cf8, 1, NIL_RTR0PTR, "pciIOPortAddressWrite", "pciIOPortAddressRead", NULL, NULL, "i440FX (PCI)"); 1388 if (RT_FAILURE(rc)) 1389 return rc; 1390 rc = PDMDevHlpIOPortRegisterR0(pDevIns, 0x0cfc, 4, NIL_RTR0PTR, "pciIOPortDataWrite", "pciIOPortDataRead", NULL, NULL, "i440FX (PCI)"); 1391 if (RT_FAILURE(rc)) 1392 return rc; 1393 } 1394 1395 rc = PDMDevHlpIOPortRegister(pDevIns, 0x0410, 1, NULL, pciR3IOPortMagicPCIWrite, pciR3IOPortMagicPCIRead, NULL, NULL, "i440FX (Fake PCI BIOS trigger)"); 1396 if (RT_FAILURE(rc)) 1397 return rc; 1354 static const IOMIOPORTDESC s_aAddrDesc[] = { { "PCI address", "PCI address", NULL, NULL }, { NULL, NULL, NULL, NULL } }; 1355 rc = PDMDevHlpIoPortCreateAndMap(pDevIns, 0x0cf8, 1, pciIOPortAddressWrite, pciIOPortAddressRead, "i440FX (PCI)", s_aAddrDesc, 1356 &pGlobals->hIoPortAddress); 1357 AssertLogRelRCReturn(rc, rc); 1358 1359 static const IOMIOPORTDESC s_aDataDesc[] = { { "PCI data", "PCI data", NULL, NULL }, { NULL, NULL, NULL, NULL } }; 1360 rc = PDMDevHlpIoPortCreateAndMap(pDevIns, 0x0cfc, 4, pciIOPortDataWrite, pciIOPortDataRead, "i440FX (PCI)", s_aDataDesc, 1361 &pGlobals->hIoPortData); 1362 AssertLogRelRCReturn(rc, rc); 1363 1364 static const IOMIOPORTDESC s_aMagicDesc[] = { { "PCI magic", NULL, NULL, NULL }, { NULL, NULL, NULL, NULL } }; 1365 rc = PDMDevHlpIoPortCreateAndMap(pDevIns, 0x0410, 1, pciR3IOPortMagicPCIWrite, pciR3IOPortMagicPCIRead, 1366 "i440FX (Fake PCI BIOS trigger)", s_aMagicDesc, &pGlobals->hIoPortMagic); 1367 AssertLogRelRCReturn(rc, rc); 1398 1368 1399 1369 … … 1402 1372 NULL, pciR3SaveExec, NULL, 1403 1373 NULL, pciR3LoadExec, NULL); 1404 if (RT_FAILURE(rc)) 1405 return rc; 1374 AssertLogRelRCReturn(rc, rc); 1406 1375 1407 1376 PDMDevHlpDBGFInfoRegister(pDevIns, "pci", … … 1426 1395 PDEVPCIBUSCC pBusCC = PDMINS_2_DATA_CC(pDevIns, PDEVPCIBUSCC); 1427 1396 1397 /* Mirror the ring-3 device lock disabling: */ 1398 int rc = PDMDevHlpSetDeviceCritSect(pDevIns, PDMDevHlpCritSectGetNop(pDevIns)); 1399 AssertRCReturn(rc, rc); 1400 1401 /* Set up the RZ PCI bus callbacks: */ 1428 1402 PDMPCIBUSREGCC PciBusReg; 1429 1403 PciBusReg.u32Version = PDM_PCIBUSREGCC_VERSION; … … 1431 1405 PciBusReg.pfnSetIrq = pciSetIrq; 1432 1406 PciBusReg.u32EndVersion = PDM_PCIBUSREGCC_VERSION; 1433 int rc = PDMDevHlpPCIBusSetUpContext(pDevIns, &PciBusReg, &pBusCC->CTX_SUFF(pPciHlp)); 1434 AssertRC(rc); 1407 rc = PDMDevHlpPCIBusSetUpContext(pDevIns, &PciBusReg, &pBusCC->CTX_SUFF(pPciHlp)); 1408 AssertRCReturn(rc, rc); 1409 1410 /* Set up I/O port callbacks, except for the magic port: */ 1411 rc = PDMDevHlpIoPortSetUpContext(pDevIns, pGlobals->hIoPortAddress, pciIOPortAddressWrite, pciIOPortAddressRead, NULL); 1412 AssertLogRelRCReturn(rc, rc); 1413 1414 rc = PDMDevHlpIoPortSetUpContext(pDevIns, pGlobals->hIoPortData, pciIOPortDataWrite, pciIOPortDataRead, NULL); 1415 AssertLogRelRCReturn(rc, rc); 1435 1416 1436 1417 return rc; … … 1447 1428 /* .uReserved0 = */ 0, 1448 1429 /* .szName = */ "pci", 1449 /* .fFlags = */ PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0 ,1430 /* .fFlags = */ PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0 | PDM_DEVREG_FLAGS_NEW_STYLE, 1450 1431 /* .fClass = */ PDM_DEVREG_CLASS_BUS_PCI | PDM_DEVREG_CLASS_BUS_ISA, 1451 1432 /* .cMaxInstances = */ 1, … … 1531 1512 * of our parent passing the device which asserted the interrupt instead of the device of the bridge. 1532 1513 */ 1514 #if 1 1515 PDEVPCIBUSCC const pBridgeBusCC = PDMINS_2_DATA_CC(pDevIns, PDEVPCIBUSCC); /* For keep using our own pcihlp. */ 1516 PPDMDEVINS const pBridgeDevIns = pDevIns; /* ditto */ 1517 1518 PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS); 1519 PPDMDEVINS pDevInsBus; 1520 PPDMPCIDEV pPciDevBus = &pBus->PciDev; 1521 uint8_t uDevFnBridge = pPciDevBus->uDevFn; 1522 int iIrqPinBridge = ((pPciDev->uDevFn >> 3) + iIrq) & 3; 1523 1524 /* Walk the chain until we reach the host bus. */ 1525 Assert(pBus->iBus != 0); 1526 for (;;) 1527 { 1528 /* Get the parent. */ 1529 pDevInsBus = pBridgeBusCC->CTX_SUFF(pPciHlp)->pfnGetBusByNo(pBridgeDevIns, pPciDevBus->Int.s.idxPdmBus); 1530 AssertLogRelReturnVoid(pDevInsBus); 1531 1532 pBus = PDMINS_2_DATA(pDevInsBus, PDEVPCIBUS); 1533 pPciDevBus = &pBus->PciDev; 1534 if (pBus->iBus == 0) 1535 break; 1536 1537 uDevFnBridge = pPciDevBus->uDevFn; 1538 iIrqPinBridge = ((uDevFnBridge >> 3) + iIrqPinBridge) & 3; 1539 } 1540 1541 AssertMsg(pBus->iBus == 0, ("This is not the host pci bus iBus=%d\n", pBus->iBus)); 1542 Assert(pDevInsBus->pReg == &g_DevicePCI); 1543 pciSetIrqInternal(pDevInsBus, DEVPCIBUS_2_DEVPCIROOT(pBus), PDMINS_2_DATA_CC(pDevInsBus, PDEVPCIBUSCC), 1544 uDevFnBridge, pPciDev, iIrqPinBridge, iLevel, uTagSrc); 1545 #else /* (old code for reference) */ 1533 1546 PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS); 1534 1547 PDEVPCIBUSCC pBusCC = PDMINS_2_DATA_CC(pDevIns, PDEVPCIBUSCC); … … 1550 1563 AssertMsg(pBus->iBus == 0, ("This is not the host pci bus iBus=%d\n", pBus->iBus)); 1551 1564 pciSetIrqInternal(pDevIns, DEVPCIBUS_2_DEVPCIROOT(pBus), pBusCC, uDevFnBridge, pPciDev, iIrqPinBridge, iLevel, uTagSrc); 1565 #endif 1552 1566 } 1553 1567 … … 1830 1844 /* .uReserved0 = */ 0, 1831 1845 /* .szName = */ "pcibridge", 1832 /* .fFlags = */ PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0 ,1846 /* .fFlags = */ PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0 | PDM_DEVREG_FLAGS_NEW_STYLE, 1833 1847 /* .fClass = */ PDM_DEVREG_CLASS_BUS_PCI, 1834 1848 /* .cMaxInstances = */ ~0U, -
trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
r80950 r80960 122 122 } 123 123 124 PDMBOTHCBDECL(void)ich9pciSetIrq(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, int iIrq, int iLevel, uint32_t uTagSrc)124 static void ich9pciSetIrq(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, int iIrq, int iLevel, uint32_t uTagSrc) 125 125 { 126 126 LogFlowFunc(("invoked by %p/%d: iIrq=%d iLevel=%d uTagSrc=%#x\n", pDevIns, pDevIns->iInstance, iIrq, iLevel, uTagSrc)); … … 129 129 } 130 130 131 PDMBOTHCBDECL(void)ich9pcibridgeSetIrq(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, int iIrq, int iLevel, uint32_t uTagSrc)131 static void ich9pcibridgeSetIrq(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, int iIrq, int iLevel, uint32_t uTagSrc) 132 132 { 133 133 /* … … 138 138 * of our parent passing the device which asserted the interrupt instead of the device of the bridge. 139 139 */ 140 #if 1 141 PDEVPCIBUSCC const pBridgeBusCC = PDMINS_2_DATA_CC(pDevIns, PDEVPCIBUSCC); /* For keep using our own pcihlp. */ 142 PPDMDEVINS const pBridgeDevIns = pDevIns; /* ditto */ 143 144 PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS); 145 PPDMDEVINS pDevInsBus; 146 PPDMPCIDEV pPciDevBus = &pBus->PciDev; 147 uint8_t uDevFnBridge = pPciDevBus->uDevFn; 148 int iIrqPinBridge = ((pPciDev->uDevFn >> 3) + iIrq) & 3; 149 150 /* Walk the chain until we reach the host bus. */ 151 Assert(pBus->iBus != 0); 152 for (;;) 153 { 154 /* Get the parent. */ 155 pDevInsBus = pBridgeBusCC->CTX_SUFF(pPciHlp)->pfnGetBusByNo(pBridgeDevIns, pPciDevBus->Int.s.idxPdmBus); 156 AssertLogRelReturnVoid(pDevInsBus); 157 158 pBus = PDMINS_2_DATA(pDevInsBus, PDEVPCIBUS); 159 pPciDevBus = &pBus->PciDev; 160 if (pBus->iBus == 0) 161 break; 162 163 uDevFnBridge = pPciDevBus->uDevFn; 164 iIrqPinBridge = ((uDevFnBridge >> 3) + iIrqPinBridge) & 3; 165 } 166 167 AssertMsg(pBus->iBus == 0, ("This is not the host pci bus iBus=%d\n", pBus->iBus)); 168 Assert(pDevInsBus->pReg == &g_DevicePciIch9); 169 170 /* 171 * For MSI/MSI-X enabled devices the iIrq doesn't denote the pin but rather a vector which is completely 172 * orthogonal to the pin based approach. The vector is not subject to the pin based routing with PCI bridges. 173 */ 174 int iIrqPinVector = iIrqPinBridge; 175 if ( MsiIsEnabled(pPciDev) 176 || MsixIsEnabled(pPciDev)) 177 iIrqPinVector = iIrq; 178 ich9pciSetIrqInternal(pDevInsBus, DEVPCIBUS_2_DEVPCIROOT(pBus), PDMINS_2_DATA_CC(pDevInsBus, PDEVPCIBUSCC), 179 uDevFnBridge, pPciDev, iIrqPinVector, iLevel, uTagSrc); 180 #else /* (old code for reference) */ 140 181 PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS); 141 182 PPDMPCIDEV pPciDevBus = pPciDev; … … 166 207 ich9pciSetIrqInternal(pDevIns, DEVPCIBUS_2_DEVPCIROOT(pBus), PDMINS_2_DATA_CC(pDevIns, PDEVPCIBUSCC), 167 208 uDevFnBridge, pPciDev, iIrqPinVector, iLevel, uTagSrc); 209 #endif 168 210 } 169 211 … … 182 224 * @param cb The value size in bytes. 183 225 */ 184 DECLCALLBACK(int) ich9pciR3IOPortMagicPCIWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb) 226 static DECLCALLBACK(VBOXSTRICTRC) 227 ich9pciR3IOPortMagicPCIWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb) 185 228 { 186 229 RT_NOREF2(pvUser, uPort); … … 210 253 * @param cb Number of bytes read. 211 254 */ 212 DECLCALLBACK(int) ich9pciR3IOPortMagicPCIRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t *pu32, unsigned cb) 255 static DECLCALLBACK(VBOXSTRICTRC) 256 ich9pciR3IOPortMagicPCIRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t *pu32, unsigned cb) 213 257 { 214 258 RT_NOREF5(pDevIns, pvUser, uPort, pu32, cb); … … 234 278 * @param cb The value size in bytes. 235 279 */ 236 PDMBOTHCBDECL(int) ich9pciIOPortAddressWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb) 280 static DECLCALLBACK(VBOXSTRICTRC) 281 ich9pciIOPortAddressWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb) 237 282 { 238 283 LogFlowFunc(("Port=%#x u32=%#x cb=%d\n", uPort, u32, cb)); … … 258 303 259 304 /** 260 * Port I/O Handler for PCI address IN operations. 305 * @callback_method_impl{FNIOMIOPORTNEWIN, 306 * Port I/O Handler for PCI data IN operations. 261 307 * 262 * Emulates reads from Configuration Address Port at 0CF8h for 263 * Configuration Mechanism #1. 264 * 265 * @returns VBox status code. 266 * 267 * @param pDevIns ICH9 device instance. 268 * @param pvUser User argument - ignored. 269 * @param uPort Port number used for the IN operation. 270 * @param pu32 Where to store the result. 271 * @param cb Number of bytes read. 272 */ 273 PDMBOTHCBDECL(int) ich9pciIOPortAddressRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t *pu32, unsigned cb) 308 * Emulates reads from Configuration Address Port at 0CF8h for Configuration 309 * Mechanism \#1. 310 */ 311 static DECLCALLBACK(VBOXSTRICTRC) 312 ich9pciIOPortAddressRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t *pu32, unsigned cb) 274 313 { 275 314 RT_NOREF2(uPort, pvUser); … … 291 330 292 331 293 /* 332 /** 294 333 * Perform configuration space write. 295 334 */ … … 344 383 345 384 /** 346 * Port I/O Handler for PCI data OUT operations. 385 * @callback_method_impl{FNIOMIOPORTNEWOUT, 386 * Port I/O Handler for PCI data OUT operations. 347 387 * 348 * Emulates writes to Configuration Data Port at 0CFCh for 349 * Configuration Mechanism #1. 350 * 351 * @returns VBox status code. 352 * 353 * @param pDevIns ICH9 device instance. 354 * @param pvUser User argument - ignored. 355 * @param uPort Port number used for the OUT operation. 356 * @param u32 The value to output. 357 * @param cb The value size in bytes. 358 */ 359 PDMBOTHCBDECL(int) ich9pciIOPortDataWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb) 388 * Emulates writes to Configuration Data Port at 0CFCh for Configuration 389 * Mechanism \#1. 390 */ 391 static DECLCALLBACK(VBOXSTRICTRC) 392 ich9pciIOPortDataWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb) 360 393 { 361 394 PDEVPCIROOT pThis = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 362 395 LogFlowFunc(("Port=%#x u32=%#x cb=%d (config=%#10x)\n", uPort, u32, cb, pThis->uConfigReg)); 363 396 NOREF(pvUser); 397 364 398 VBOXSTRICTRC rcStrict = VINF_SUCCESS; 365 399 if (!(uPort % cb)) … … 367 401 PCI_LOCK(pDevIns, VINF_IOM_R3_IOPORT_WRITE); 368 402 369 do /* do-brain-dead-while-false-utter-stupidity-loop */ 370 { 371 /* Configuration space mapping enabled? */ 372 if (!(pThis->uConfigReg & (1 << 31))) 373 break; 403 if (pThis->uConfigReg & (1 << 31)) 404 { 374 405 375 406 /* Decode target device from Configuration Address Port */ … … 379 410 /* Perform configuration space write */ 380 411 rcStrict = ich9pciConfigWrite(pDevIns, pThis, &aPciAddr, u32, cb, VINF_IOM_R3_IOPORT_WRITE); 381 } while (0);412 } 382 413 383 414 PCI_UNLOCK(pDevIns); … … 385 416 else 386 417 AssertMsgFailed(("Unaligned write to port %#x u32=%#x cb=%d\n", uPort, u32, cb)); 387 return VBOXSTRICTRC_TODO(rcStrict); 388 } 389 390 391 /* 418 419 return rcStrict; 420 } 421 422 423 /** 392 424 * Perform configuration space read. 393 425 */ … … 449 481 450 482 /** 451 * Port I/O Handler for PCI data IN operations. 483 * @callback_method_impl{FNIOMIOPORTNEWIN, 484 * Port I/O Handler for PCI data IN operations. 452 485 * 453 * Emulates reads from Configuration Data Port at 0CFCh for 454 * Configuration Mechanism #1. 455 * 456 * @returns VBox status code. 457 * 458 * @param pDevIns ICH9 device instance. 459 * @param pvUser User argument - ignored. 460 * @param uPort Port number used for the IN operation. 461 * @param pu32 Where to store the result. 462 * @param cb Number of bytes read. 463 */ 464 PDMBOTHCBDECL(int) ich9pciIOPortDataRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t *pu32, unsigned cb) 486 * Emulates reads from Configuration Data Port at 0CFCh for Configuration 487 * Mechanism \#1. 488 */ 489 static DECLCALLBACK(VBOXSTRICTRC) 490 ich9pciIOPortDataRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t *pu32, unsigned cb) 465 491 { 466 492 NOREF(pvUser); … … 489 515 490 516 LogFlowFunc(("Port=%#x cb=%#x (config=%#10x) -> %#x (%Rrc)\n", uPort, cb, *pu32, pThis->uConfigReg, VBOXSTRICTRC_VAL(rcStrict))); 491 return VBOXSTRICTRC_TODO(rcStrict);517 return rcStrict; 492 518 } 493 519 AssertMsgFailed(("Unaligned read from port %#x cb=%d\n", uPort, cb)); … … 3027 3053 PDMDEV_CHECK_VERSIONS_RETURN(pDevIns); 3028 3054 3055 PDEVPCIBUSCC pBusCC = PDMINS_2_DATA_CC(pDevIns, PDEVPCIBUSCC); 3056 PDEVPCIROOT pPciRoot = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 3057 PDEVPCIBUS pBus = &pPciRoot->PciBus; 3058 Assert(ASMMemIsZero(pPciRoot, sizeof(*pPciRoot))); /* code used to memset it for some funny reason. just temp insurance. */ 3059 3029 3060 /* 3030 3061 * Validate and read configuration. 3031 3062 */ 3032 if (!CFGMR3AreValuesValid(pCfg, 3033 "IOAPIC\0" 3034 "GCEnabled\0" 3035 "R0Enabled\0" 3036 "McfgBase\0" 3037 "McfgLength\0" 3038 )) 3039 return VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES; 3063 PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "IOAPIC|McfgBase|McfgLength", ""); 3040 3064 3041 3065 /* query whether we got an IOAPIC */ 3042 bool fUseIoApic; 3043 int rc = CFGMR3QueryBoolDef(pCfg, "IOAPIC", &fUseIoApic, false); 3044 if (RT_FAILURE(rc)) 3045 return PDMDEV_SET_ERROR(pDevIns, rc, 3046 N_("Configuration error: Failed to query boolean value \"IOAPIC\"")); 3047 3048 /* check if RC code is enabled. */ 3049 bool fGCEnabled; 3050 rc = CFGMR3QueryBoolDef(pCfg, "GCEnabled", &fGCEnabled, true); 3051 if (RT_FAILURE(rc)) 3052 return PDMDEV_SET_ERROR(pDevIns, rc, 3053 N_("Configuration error: Failed to query boolean value \"GCEnabled\"")); 3054 /* check if R0 code is enabled. */ 3055 bool fR0Enabled; 3056 rc = CFGMR3QueryBoolDef(pCfg, "R0Enabled", &fR0Enabled, true); 3057 if (RT_FAILURE(rc)) 3058 return PDMDEV_SET_ERROR(pDevIns, rc, 3059 N_("Configuration error: Failed to query boolean value \"R0Enabled\"")); 3060 3061 Log(("PCI: fUseIoApic=%RTbool fGCEnabled=%RTbool fR0Enabled=%RTbool\n", fUseIoApic, fGCEnabled, fR0Enabled)); 3066 int rc = CFGMR3QueryBoolDef(pCfg, "IOAPIC", &pPciRoot->fUseIoApic, false /** @todo default to true? */); 3067 AssertRCReturn(rc, PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to query boolean value \"IOAPIC\""))); 3068 3069 if (!pPciRoot->fUseIoApic) 3070 return PDMDEV_SET_ERROR(pDevIns, rc, N_("Must use IO-APIC with ICH9 chipset")); 3071 3072 rc = CFGMR3QueryU64Def(pCfg, "McfgBase", &pPciRoot->u64PciConfigMMioAddress, 0); 3073 AssertRCReturn(rc, PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to read \"McfgBase\""))); 3074 3075 rc = CFGMR3QueryU64Def(pCfg, "McfgLength", &pPciRoot->u64PciConfigMMioLength, 0); 3076 AssertRCReturn(rc, PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to read \"McfgLength\""))); 3077 3078 Log(("PCI: fUseIoApic=%RTbool McfgBase=%#RX64 McfgLength=%#RX64 fR0Enabled=%RTbool fRCEnabled=%RTbool\n", pPciRoot->fUseIoApic, 3079 pPciRoot->u64PciConfigMMioAddress, pPciRoot->u64PciConfigMMioLength, pDevIns->fR0Enabled, pDevIns->fRCEnabled)); 3062 3080 3063 3081 /* 3064 3082 * Init data. 3065 3083 */ 3066 PDEVPCIROOT pPciRoot = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);3067 PDEVPCIBUS pBus = &pPciRoot->PciBus;3068 PDEVPCIBUSCC pBusCC = PDMINS_2_DATA_CC(pDevIns, PDEVPCIBUSCC);3069 3070 /* Zero out everything */3071 Assert(ASMMemIsZero(pPciRoot, sizeof(*pPciRoot)));3072 memset(pPciRoot, 0, sizeof(*pPciRoot)); /** @todo unnecessary as instance data is always set to zero by the allocator, see assertion above. */3073 3074 3084 /* And fill values */ 3075 if (!fUseIoApic)3076 return PDMDEV_SET_ERROR(pDevIns, rc,3077 N_("Must use IO-APIC with ICH9 chipset"));3078 rc = CFGMR3QueryU64Def(pCfg, "McfgBase", &pPciRoot->u64PciConfigMMioAddress, 0);3079 if (RT_FAILURE(rc))3080 return PDMDEV_SET_ERROR(pDevIns, rc,3081 N_("Configuration error: Failed to read \"McfgBase\""));3082 rc = CFGMR3QueryU64Def(pCfg, "McfgLength", &pPciRoot->u64PciConfigMMioLength, 0);3083 if (RT_FAILURE(rc))3084 return PDMDEV_SET_ERROR(pDevIns, rc,3085 N_("Configuration error: Failed to read \"McfgLength\""));3086 3087 3085 pBusCC->pDevInsR3 = pDevIns; 3088 pPciRoot->fUseIoApic = fUseIoApic;3089 3086 pPciRoot->PciBus.fTypePiix3 = false; 3090 3087 pPciRoot->PciBus.fTypeIch9 = true; … … 3092 3089 pPciRoot->PciBus.papBridgesR3 = (PPDMPCIDEV *)PDMDevHlpMMHeapAllocZ(pDevIns, sizeof(PPDMPCIDEV) * RT_ELEMENTS(pPciRoot->PciBus.apDevices)); 3093 3090 AssertLogRelReturn(pPciRoot->PciBus.papBridgesR3, VERR_NO_MEMORY); 3091 3092 /* 3093 * Disable default device locking. 3094 */ 3095 rc = PDMDevHlpSetDeviceCritSect(pDevIns, PDMDevHlpCritSectGetNop(pDevIns)); 3096 AssertRCReturn(rc, rc); 3094 3097 3095 3098 /* … … 3140 3143 3141 3144 /* 3142 * Register I/O ports and save state.3145 * Register I/O ports. 3143 3146 */ 3144 rc = PDMDevHlpIOPortRegister(pDevIns, 0x0cf8, 1, NULL, ich9pciIOPortAddressWrite, ich9pciIOPortAddressRead, NULL, NULL, "ICH9 (PCI)"); 3145 if (RT_FAILURE(rc)) 3146 return rc; 3147 rc = PDMDevHlpIOPortRegister(pDevIns, 0x0cfc, 4, NULL, ich9pciIOPortDataWrite, ich9pciIOPortDataRead, NULL, NULL, "ICH9 (PCI)"); 3148 if (RT_FAILURE(rc)) 3149 return rc; 3150 if (fGCEnabled) 3151 { 3152 rc = PDMDevHlpIOPortRegisterRC(pDevIns, 0x0cf8, 1, NIL_RTGCPTR, "ich9pciIOPortAddressWrite", "ich9pciIOPortAddressRead", NULL, NULL, "ICH9 (PCI)"); 3153 if (RT_FAILURE(rc)) 3154 return rc; 3155 rc = PDMDevHlpIOPortRegisterRC(pDevIns, 0x0cfc, 4, NIL_RTGCPTR, "ich9pciIOPortDataWrite", "ich9pciIOPortDataRead", NULL, NULL, "ICH9 (PCI)"); 3156 if (RT_FAILURE(rc)) 3157 return rc; 3158 } 3159 if (fR0Enabled) 3160 { 3161 rc = PDMDevHlpIOPortRegisterR0(pDevIns, 0x0cf8, 1, NIL_RTR0PTR, "ich9pciIOPortAddressWrite", "ich9pciIOPortAddressRead", NULL, NULL, "ICH9 (PCI)"); 3162 if (RT_FAILURE(rc)) 3163 return rc; 3164 rc = PDMDevHlpIOPortRegisterR0(pDevIns, 0x0cfc, 4, NIL_RTR0PTR, "ich9pciIOPortDataWrite", "ich9pciIOPortDataRead", NULL, NULL, "ICH9 (PCI)"); 3165 if (RT_FAILURE(rc)) 3166 return rc; 3167 } 3168 3169 rc = PDMDevHlpIOPortRegister(pDevIns, 0x0410, 1, NULL, ich9pciR3IOPortMagicPCIWrite, ich9pciR3IOPortMagicPCIRead, NULL, NULL, "ICH9 (Fake PCI BIOS trigger)"); 3170 if (RT_FAILURE(rc)) 3171 return rc; 3172 3147 static const IOMIOPORTDESC s_aAddrDesc[] = { { "PCI address", "PCI address", NULL, NULL }, { NULL, NULL, NULL, NULL } }; 3148 rc = PDMDevHlpIoPortCreateAndMap(pDevIns, 0x0cf8, 1, ich9pciIOPortAddressWrite, ich9pciIOPortAddressRead, 3149 "ICH9 (PCI)", s_aAddrDesc, &pPciRoot->hIoPortAddress); 3150 AssertLogRelRCReturn(rc, rc); 3151 3152 static const IOMIOPORTDESC s_aDataDesc[] = { { "PCI data", "PCI data", NULL, NULL }, { NULL, NULL, NULL, NULL } }; 3153 rc = PDMDevHlpIoPortCreateAndMap(pDevIns, 0x0cfc, 4, ich9pciIOPortDataWrite, ich9pciIOPortDataRead, 3154 "ICH9 (PCI)", s_aDataDesc, &pPciRoot->hIoPortData); 3155 AssertLogRelRCReturn(rc, rc); 3156 3157 static const IOMIOPORTDESC s_aMagicDesc[] = { { "PCI magic", NULL, NULL, NULL }, { NULL, NULL, NULL, NULL } }; 3158 rc = PDMDevHlpIoPortCreateAndMap(pDevIns, 0x0410, 1, ich9pciR3IOPortMagicPCIWrite, ich9pciR3IOPortMagicPCIRead, 3159 "ICH9 (Fake PCI BIOS trigger)", s_aMagicDesc, &pPciRoot->hIoPortMagic); 3160 AssertLogRelRCReturn(rc, rc); 3161 3162 /* 3163 * MMIO handlers. 3164 */ 3173 3165 if (pPciRoot->u64PciConfigMMioAddress != 0) 3174 3166 { 3167 /** @todo implement new-style MMIO */ 3175 3168 rc = PDMDevHlpMMIORegister(pDevIns, pPciRoot->u64PciConfigMMioAddress, pPciRoot->u64PciConfigMMioLength, NULL /*pvUser*/, 3176 3169 IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU, … … 3178 3171 AssertMsgRCReturn(rc, ("rc=%Rrc %#llx/%#llx\n", rc, pPciRoot->u64PciConfigMMioAddress, pPciRoot->u64PciConfigMMioLength), rc); 3179 3172 3180 if ( fGCEnabled)3173 if (pDevIns->fRCEnabled) 3181 3174 { 3182 3175 rc = PDMDevHlpMMIORegisterRC(pDevIns, pPciRoot->u64PciConfigMMioAddress, pPciRoot->u64PciConfigMMioLength, … … 3186 3179 3187 3180 3188 if ( fR0Enabled)3181 if (pDevIns->fR0Enabled) 3189 3182 { 3190 3183 rc = PDMDevHlpMMIORegisterR0(pDevIns, pPciRoot->u64PciConfigMMioAddress, pPciRoot->u64PciConfigMMioLength, … … 3194 3187 } 3195 3188 3189 /* 3190 * Saved state and info handlers. 3191 */ 3196 3192 rc = PDMDevHlpSSMRegisterEx(pDevIns, VBOX_ICH9PCI_SAVED_STATE_VERSION, 3197 3193 sizeof(*pBus) + 16*128, "pgm", … … 3199 3195 NULL, ich9pciR3SaveExec, NULL, 3200 3196 NULL, ich9pciR3LoadExec, NULL); 3201 if (RT_FAILURE(rc)) 3202 return rc; 3203 3197 AssertRCReturn(rc, rc); 3204 3198 3205 3199 /** @todo other chipset devices shall be registered too */ … … 3293 3287 if (!RTStrCmp(pszExpressPortType, "EndPtDev")) 3294 3288 return VBOX_PCI_EXP_TYPE_ENDPOINT; 3295 elseif (!RTStrCmp(pszExpressPortType, "LegEndPtDev"))3289 if (!RTStrCmp(pszExpressPortType, "LegEndPtDev")) 3296 3290 return VBOX_PCI_EXP_TYPE_LEG_END; 3297 elseif (!RTStrCmp(pszExpressPortType, "RootCmplxRootPort"))3291 if (!RTStrCmp(pszExpressPortType, "RootCmplxRootPort")) 3298 3292 return VBOX_PCI_EXP_TYPE_ROOT_PORT; 3299 elseif (!RTStrCmp(pszExpressPortType, "ExpressSwUpstream"))3293 if (!RTStrCmp(pszExpressPortType, "ExpressSwUpstream")) 3300 3294 return VBOX_PCI_EXP_TYPE_UPSTREAM; 3301 elseif (!RTStrCmp(pszExpressPortType, "ExpressSwDownstream"))3295 if (!RTStrCmp(pszExpressPortType, "ExpressSwDownstream")) 3302 3296 return VBOX_PCI_EXP_TYPE_DOWNSTREAM; 3303 elseif (!RTStrCmp(pszExpressPortType, "Express2PciBridge"))3297 if (!RTStrCmp(pszExpressPortType, "Express2PciBridge")) 3304 3298 return VBOX_PCI_EXP_TYPE_PCI_BRIDGE; 3305 elseif (!RTStrCmp(pszExpressPortType, "Pci2ExpressBridge"))3299 if (!RTStrCmp(pszExpressPortType, "Pci2ExpressBridge")) 3306 3300 return VBOX_PCI_EXP_TYPE_PCIE_BRIDGE; 3307 elseif (!RTStrCmp(pszExpressPortType, "RootCmplxIntEp"))3301 if (!RTStrCmp(pszExpressPortType, "RootCmplxIntEp")) 3308 3302 return VBOX_PCI_EXP_TYPE_ROOT_INT_EP; 3309 elseif (!RTStrCmp(pszExpressPortType, "RootCmplxEc"))3303 if (!RTStrCmp(pszExpressPortType, "RootCmplxEc")) 3310 3304 return VBOX_PCI_EXP_TYPE_ROOT_EC; 3311 3305 … … 3371 3365 if (pDev) 3372 3366 { 3373 pDev->Int.s.pBusRC += offDelta;3374 3367 if (pDev->Int.s.pMsixPageRC) 3375 3368 pDev->Int.s.pMsixPageRC += offDelta; … … 3402 3395 } 3403 3396 3397 3404 3398 /** 3405 3399 * @interface_method_impl{PDMDEVREG,pfnDestruct} … … 3427 3421 * Validate and read configuration. 3428 3422 */ 3429 if (!CFGMR3AreValuesValid(pCfg, "GCEnabled\0" "R0Enabled\0" "ExpressEnabled\0" "ExpressPortType\0")) 3430 return VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES; 3431 3432 /* check if RC code is enabled. */ 3433 bool fGCEnabled; 3434 int rc = CFGMR3QueryBoolDef(pCfg, "GCEnabled", &fGCEnabled, true); 3435 if (RT_FAILURE(rc)) 3436 return PDMDEV_SET_ERROR(pDevIns, rc, 3437 N_("Configuration error: Failed to query boolean value \"GCEnabled\"")); 3438 3439 /* check if R0 code is enabled. */ 3440 bool fR0Enabled; 3441 rc = CFGMR3QueryBoolDef(pCfg, "R0Enabled", &fR0Enabled, true); 3442 if (RT_FAILURE(rc)) 3443 return PDMDEV_SET_ERROR(pDevIns, rc, 3444 N_("Configuration error: Failed to query boolean value \"R0Enabled\"")); 3445 Log(("PCI: fGCEnabled=%RTbool fR0Enabled=%RTbool\n", fGCEnabled, fR0Enabled)); 3423 PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "ExpressEnabled|ExpressPortType", ""); 3446 3424 3447 3425 /* check if we're supposed to implement a PCIe bridge. */ 3448 3426 bool fExpress; 3449 rc = CFGMR3QueryBoolDef(pCfg, "ExpressEnabled", &fExpress, false); 3450 if (RT_FAILURE(rc)) 3451 return PDMDEV_SET_ERROR(pDevIns, rc, 3452 N_("Configuration error: Failed to query boolean value \"ExpressEnabled\"")); 3453 3454 char *pszExpressPortType; 3455 rc = CFGMR3QueryStringAllocDef(pCfg, "ExpressPortType", 3456 &pszExpressPortType, "RootCmplxIntEp"); 3457 if (RT_FAILURE(rc)) 3458 return PDMDEV_SET_ERROR(pDevIns, rc, 3459 N_("LsiLogic configuration error: failed to read \"ExpressPortType\" as string")); 3460 3461 uint8_t uExpressPortType = ich9pcibridgeR3GetExpressPortTypeFromString(pszExpressPortType); 3462 MMR3HeapFree(pszExpressPortType); 3463 3464 pDevIns->IBase.pfnQueryInterface = ich9pcibridgeQueryInterface; 3427 int rc = CFGMR3QueryBoolDef(pCfg, "ExpressEnabled", &fExpress, false); 3428 AssertRCReturn(rc, PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to query boolean value \"ExpressEnabled\""))); 3429 3430 char szExpressPortType[80]; 3431 rc = CFGMR3QueryStringDef(pCfg, "ExpressPortType", szExpressPortType, sizeof(szExpressPortType), "RootCmplxIntEp"); 3432 AssertRCReturn(rc, PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: failed to read \"ExpressPortType\" as string"))); 3433 3434 uint8_t const uExpressPortType = ich9pcibridgeR3GetExpressPortTypeFromString(szExpressPortType); 3435 Log(("PCI/bridge#%u: fR0Enabled=%RTbool fRCEnabled=%RTbool fExpress=%RTbool uExpressPortType=%u (%s)\n", 3436 iInstance, pDevIns->fR0Enabled, pDevIns->fRCEnabled, fExpress, uExpressPortType, szExpressPortType)); 3465 3437 3466 3438 /* 3467 3439 * Init data and register the PCI bus. 3468 3440 */ 3441 pDevIns->IBase.pfnQueryInterface = ich9pcibridgeQueryInterface; 3442 3469 3443 PDEVPCIBUSCC pBusCC = PDMINS_2_DATA_CC(pDevIns, PDEVPCIBUSCC); 3470 3444 PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS); 3445 3471 3446 pBus->fTypePiix3 = false; 3472 3447 pBus->fTypeIch9 = true; … … 3474 3449 pBusCC->pDevInsR3 = pDevIns; 3475 3450 /** @todo r=klaus figure out how to extend this to allow PCIe config space 3476 * extension, which increases the config space from 256 bytes to 4K. */ 3451 * extension, which increases the config space from 256 bytes to 4K. 3452 * bird: What does this allocation have to do with PCIe config space?!? */ 3477 3453 pBus->papBridgesR3 = (PPDMPCIDEV *)PDMDevHlpMMHeapAllocZ(pDevIns, sizeof(PPDMPCIDEV) * RT_ELEMENTS(pBus->apDevices)); 3478 3454 AssertLogRelReturn(pBus->papBridgesR3, VERR_NO_MEMORY); … … 3595 3571 rc = PDMDevHlpPCIRegisterEx(pDevIns, &pBus->PciDev, PDMPCIDEVREG_CFG_PRIMARY, PDMPCIDEVREG_F_PCI_BRIDGE, 3596 3572 PDMPCIDEVREG_DEV_NO_FIRST_UNUSED, PDMPCIDEVREG_FUN_NO_FIRST_UNUSED, "ich9pcibridge"); 3597 if (RT_FAILURE(rc))3598 return rc; 3573 AssertLogRelRCReturn(rc, rc); 3574 3599 3575 pBus->PciDev.Int.s.pfnBridgeConfigRead = ich9pcibridgeConfigRead; 3600 3576 pBus->PciDev.Int.s.pfnBridgeConfigWrite = ich9pcibridgeConfigWrite; … … 3610 3586 NULL, ich9pcibridgeR3SaveExec, NULL, 3611 3587 NULL, ich9pcibridgeR3LoadExec, NULL); 3612 if (RT_FAILURE(rc)) 3613 return rc; 3614 3588 AssertLogRelRCReturn(rc, rc); 3615 3589 3616 3590 return VINF_SUCCESS; … … 3625 3599 { 3626 3600 PDMDEV_CHECK_VERSIONS_RETURN(pDevIns); 3627 PDEVPCIROOT p Globals= PDMINS_2_DATA(pDevIns, PDEVPCIROOT);3601 PDEVPCIROOT pPciRoot = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 3628 3602 PDEVPCIBUSCC pBusCC = PDMINS_2_DATA_CC(pDevIns, PDEVPCIBUSCC); 3629 3603 3604 /* Mirror the ring-3 device lock disabling: */ 3605 int rc = PDMDevHlpSetDeviceCritSect(pDevIns, PDMDevHlpCritSectGetNop(pDevIns)); 3606 AssertRCReturn(rc, rc); 3607 3608 /* Set up the RZ PCI bus callbacks: */ 3630 3609 PDMPCIBUSREGCC PciBusReg; 3631 3610 PciBusReg.u32Version = PDM_PCIBUSREGCC_VERSION; 3632 PciBusReg.iBus = p Globals->PciBus.iBus;3611 PciBusReg.iBus = pPciRoot->PciBus.iBus; 3633 3612 PciBusReg.pfnSetIrq = ich9pciSetIrq; 3634 3613 PciBusReg.u32EndVersion = PDM_PCIBUSREGCC_VERSION; 3635 int rc = PDMDevHlpPCIBusSetUpContext(pDevIns, &PciBusReg, &pBusCC->CTX_SUFF(pPciHlp)); 3636 AssertRC(rc); 3637 3638 /* Disable default device locking. */ 3639 rc = PDMDevHlpSetDeviceCritSect(pDevIns, PDMDevHlpCritSectGetNop(pDevIns)); 3614 rc = PDMDevHlpPCIBusSetUpContext(pDevIns, &PciBusReg, &pBusCC->CTX_SUFF(pPciHlp)); 3640 3615 AssertRCReturn(rc, rc); 3616 3617 /* Set up I/O port callbacks, except for the magic port: */ 3618 rc = PDMDevHlpIoPortSetUpContext(pDevIns, pPciRoot->hIoPortAddress, ich9pciIOPortAddressWrite, ich9pciIOPortAddressRead, NULL); 3619 AssertLogRelRCReturn(rc, rc); 3620 3621 rc = PDMDevHlpIoPortSetUpContext(pDevIns, pPciRoot->hIoPortData, ich9pciIOPortDataWrite, ich9pciIOPortDataRead, NULL); 3622 AssertLogRelRCReturn(rc, rc); 3623 3624 /* Set up MMIO callbacks: */ 3625 /** @todo new-style MMIO */ 3641 3626 3642 3627 return rc; … … 3653 3638 PDEVPCIBUSCC pBusCC = PDMINS_2_DATA_CC(pDevIns, PDEVPCIBUSCC); 3654 3639 3640 /* Mirror the ring-3 device lock disabling: */ 3641 int rc = PDMDevHlpSetDeviceCritSect(pDevIns, PDMDevHlpCritSectGetNop(pDevIns)); 3642 AssertRCReturn(rc, rc); 3643 3644 /* Set up the RZ PCI bus callbacks: */ 3655 3645 PDMPCIBUSREGCC PciBusReg; 3656 3646 PciBusReg.u32Version = PDM_PCIBUSREGCC_VERSION; … … 3658 3648 PciBusReg.pfnSetIrq = ich9pcibridgeSetIrq; 3659 3649 PciBusReg.u32EndVersion = PDM_PCIBUSREGCC_VERSION; 3660 int rc = PDMDevHlpPCIBusSetUpContext(pDevIns, &PciBusReg, &pBusCC->CTX_SUFF(pPciHlp)); 3661 AssertRC(rc); 3662 3663 /* Disable default device locking. */ 3664 rc = PDMDevHlpSetDeviceCritSect(pDevIns, PDMDevHlpCritSectGetNop(pDevIns)); 3650 rc = PDMDevHlpPCIBusSetUpContext(pDevIns, &PciBusReg, &pBusCC->CTX_SUFF(pPciHlp)); 3665 3651 AssertRCReturn(rc, rc); 3666 3652 … … 3678 3664 /* .uReserved0 = */ 0, 3679 3665 /* .szName = */ "ich9pci", 3680 /* .fFlags = */ PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0 ,3666 /* .fFlags = */ PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0 | PDM_DEVREG_FLAGS_NEW_STYLE, 3681 3667 /* .fClass = */ PDM_DEVREG_CLASS_BUS_PCI | PDM_DEVREG_CLASS_BUS_ISA, 3682 3668 /* .cMaxInstances = */ 1, … … 3752 3738 /* .uReserved0 = */ 0, 3753 3739 /* .szName = */ "ich9pcibridge", 3754 /* .fFlags = */ PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0 ,3740 /* .fFlags = */ PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0 | PDM_DEVREG_FLAGS_NEW_STYLE, 3755 3741 /* .fClass = */ PDM_DEVREG_CLASS_BUS_PCI, 3756 3742 /* .cMaxInstances = */ ~0U, -
trunk/src/VBox/Devices/Bus/DevPciInternal.h
r80943 r80960 169 169 } Piix3; 170 170 171 /** The address I/O port handle. */ 172 IOMIOPORTHANDLE hIoPortAddress; 173 /** The data I/O port handle. */ 174 IOMIOPORTHANDLE hIoPortData; 175 /** The magic I/O port handle. */ 176 IOMIOPORTHANDLE hIoPortMagic; 177 171 178 #if 1 /* Will be moved into the BIOS "soon". */ 172 179 /** Current bus number - obsolete (still used by DevPCI, but merge will fix that). */ -
trunk/src/VBox/Devices/Bus/DevPciMerge1.cpp.h
r80943 r80960 192 192 pPciDev->Int.s.pBusR3 = pBus; 193 193 Assert(pBus == PDMINS_2_DATA(pDevIns, PDEVPCIBUS)); 194 pPciDev->Int.s.pBusR0 = PDMINS_2_DATA_R0PTR(pDevIns);195 pPciDev->Int.s.pBusRC = PDMINS_2_DATA_RCPTR(pDevIns);196 194 pPciDev->Int.s.pfnConfigRead = NULL; 197 195 pPciDev->Int.s.pfnConfigWrite = NULL; -
trunk/src/VBox/Devices/PC/DevRTC.cpp
r80704 r80960 348 348 * @callback_method_impl{FNIOMIOPORTIN} 349 349 */ 350 PDMBOTHCBDECL( int) rtcIOPortRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t *pu32, unsigned cb)350 PDMBOTHCBDECL(VBOXSTRICTRC) rtcIOPortRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t *pu32, unsigned cb) 351 351 { 352 352 NOREF(pvUser); … … 406 406 * @callback_method_impl{FNIOMIOPORTOUT} 407 407 */ 408 PDMBOTHCBDECL( int) rtcIOPortWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb)408 PDMBOTHCBDECL(VBOXSTRICTRC) rtcIOPortWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb) 409 409 { 410 410 NOREF(pvUser); -
trunk/src/VBox/VMM/VMMAll/IOMAll.cpp
r80679 r80960 104 104 * Found an entry, get the data so we can leave the IOM lock. 105 105 */ 106 PFNIOMIOPORT IN pfnInCallback = pRegEntry->pfnInCallback;107 PPDMDEVINS pDevIns = pRegEntry->pDevIns;106 PFNIOMIOPORTNEWIN pfnInCallback = pRegEntry->pfnInCallback; 107 PPDMDEVINS pDevIns = pRegEntry->pDevIns; 108 108 #ifndef IN_RING3 109 109 if ( pfnInCallback … … 349 349 * Found an entry, get the data so we can leave the IOM lock. 350 350 */ 351 PFNIOMIOPORT INSTRING pfnInStrCallback = pRegEntry->pfnInStrCallback;352 PFNIOMIOPORT IN pfnInCallback = pRegEntry->pfnInCallback;353 PPDMDEVINS pDevIns = pRegEntry->pDevIns;351 PFNIOMIOPORTNEWINSTRING pfnInStrCallback = pRegEntry->pfnInStrCallback; 352 PFNIOMIOPORTNEWIN pfnInCallback = pRegEntry->pfnInCallback; 353 PPDMDEVINS pDevIns = pRegEntry->pDevIns; 354 354 #ifndef IN_RING3 355 355 if ( pfnInCallback … … 671 671 * Found an entry, get the data so we can leave the IOM lock. 672 672 */ 673 PFNIOMIOPORT OUT pfnOutCallback = pRegEntry->pfnOutCallback;674 PPDMDEVINS pDevIns = pRegEntry->pDevIns;673 PFNIOMIOPORTNEWOUT pfnOutCallback = pRegEntry->pfnOutCallback; 674 PPDMDEVINS pDevIns = pRegEntry->pDevIns; 675 675 #ifndef IN_RING3 676 676 if ( pfnOutCallback … … 892 892 * Found an entry, get the data so we can leave the IOM lock. 893 893 */ 894 PFNIOMIOPORT OUTSTRING pfnOutStrCallback = pRegEntry->pfnOutStrCallback;895 PFNIOMIOPORT OUT pfnOutCallback = pRegEntry->pfnOutCallback;896 PPDMDEVINS pDevIns = pRegEntry->pDevIns;894 PFNIOMIOPORTNEWOUTSTRING pfnOutStrCallback = pRegEntry->pfnOutStrCallback; 895 PFNIOMIOPORTNEWOUT pfnOutCallback = pRegEntry->pfnOutCallback; 896 PPDMDEVINS pDevIns = pRegEntry->pDevIns; 897 897 #ifndef IN_RING3 898 898 if ( pfnOutCallback -
trunk/src/VBox/VMM/VMMR0/IOMR0.cpp
r80645 r80960 90 90 */ 91 91 VMMR0_INT_DECL(int) IOMR0IoPortSetUpContext(PGVM pGVM, PPDMDEVINS pDevIns, IOMIOPORTHANDLE hIoPorts, 92 PFNIOMIOPORT OUT pfnOut, PFNIOMIOPORTIN pfnIn,93 PFNIOMIOPORT OUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, void *pvUser)92 PFNIOMIOPORTNEWOUT pfnOut, PFNIOMIOPORTNEWIN pfnIn, 93 PFNIOMIOPORTNEWOUTSTRING pfnOutStr, PFNIOMIOPORTNEWINSTRING pfnInStr, void *pvUser) 94 94 { 95 95 /* -
trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp
r80943 r80960 192 192 /** @interface_method_impl{PDMDEVHLPR0,pfnIoPortSetUpContextEx} */ 193 193 static DECLCALLBACK(int) pdmR0DevHlp_IoPortSetUpContextEx(PPDMDEVINS pDevIns, IOMIOPORTHANDLE hIoPorts, 194 PFNIOMIOPORT OUT pfnOut, PFNIOMIOPORTIN pfnIn,195 PFNIOMIOPORT OUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr,194 PFNIOMIOPORTNEWOUT pfnOut, PFNIOMIOPORTNEWIN pfnIn, 195 PFNIOMIOPORTNEWOUTSTRING pfnOutStr, PFNIOMIOPORTNEWINSTRING pfnInStr, 196 196 void *pvUser) 197 197 { … … 1110 1110 1111 1111 1112 /** @interface_method_impl{PDMPCIHLPR0,pfnGetBusByNo} */ 1113 static DECLCALLBACK(PPDMDEVINS) pdmR0PciHlp_GetBusByNo(PPDMDEVINS pDevIns, uint32_t idxPdmBus) 1114 { 1115 PDMDEV_ASSERT_DEVINS(pDevIns); 1116 PGVM pGVM = pDevIns->Internal.s.pGVM; 1117 AssertReturn(idxPdmBus < RT_ELEMENTS(pGVM->pdmr0.s.aPciBuses), NULL); 1118 PPDMDEVINS pRetDevIns = pGVM->pdmr0.s.aPciBuses[idxPdmBus].pDevInsR0; 1119 LogFlow(("pdmR3PciHlp_GetBusByNo: caller='%s'/%d: returns %p\n", pDevIns->pReg->szName, pDevIns->iInstance, pRetDevIns)); 1120 return pRetDevIns; 1121 } 1122 1123 1112 1124 /** 1113 1125 * The Ring-0 PCI Bus Helper Callbacks. … … 1121 1133 pdmR0PciHlp_Lock, 1122 1134 pdmR0PciHlp_Unlock, 1135 pdmR0PciHlp_GetBusByNo, 1123 1136 PDM_PCIHLPR0_VERSION, /* the end */ 1124 1137 }; -
trunk/src/VBox/VMM/VMMR3/IOM.cpp
r80679 r80960 148 148 static FNIOMIOPORTINSTRING iomR3IOPortDummyInStr; 149 149 static FNIOMIOPORTOUTSTRING iomR3IOPortDummyOutStr; 150 static FNIOMIOPORTNEWIN iomR3IOPortDummyNewIn; 151 static FNIOMIOPORTNEWOUT iomR3IOPortDummyNewOut; 152 static FNIOMIOPORTNEWINSTRING iomR3IOPortDummyNewInStr; 153 static FNIOMIOPORTNEWOUTSTRING iomR3IOPortDummyNewOutStr; 150 154 151 155 #ifdef VBOX_WITH_STATISTICS … … 452 456 */ 453 457 VMMR3_INT_DECL(int) IOMR3IoPortCreate(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT cPorts, uint32_t fFlags, PPDMPCIDEV pPciDev, 454 uint32_t iPciRegion, PFNIOMIOPORT OUT pfnOut, PFNIOMIOPORTIN pfnIn,455 PFNIOMIOPORT OUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, RTR3PTR pvUser,458 uint32_t iPciRegion, PFNIOMIOPORTNEWOUT pfnOut, PFNIOMIOPORTNEWIN pfnIn, 459 PFNIOMIOPORTNEWOUTSTRING pfnOutStr, PFNIOMIOPORTNEWINSTRING pfnInStr, RTR3PTR pvUser, 456 460 const char *pszDesc, PCIOMIOPORTDESC paExtDescs, PIOMIOPORTHANDLE phIoPorts) 457 461 { … … 524 528 pVM->iom.s.paIoPortRegs[idx].pvUser = pvUser; 525 529 pVM->iom.s.paIoPortRegs[idx].pDevIns = pDevIns; 526 pVM->iom.s.paIoPortRegs[idx].pfnOutCallback = pfnOut ? pfnOut : iomR3IOPortDummy Out;527 pVM->iom.s.paIoPortRegs[idx].pfnInCallback = pfnIn ? pfnIn : iomR3IOPortDummy In;528 pVM->iom.s.paIoPortRegs[idx].pfnOutStrCallback = pfnOutStr ? pfnOutStr : iomR3IOPortDummy OutStr;529 pVM->iom.s.paIoPortRegs[idx].pfnInStrCallback = pfnInStr ? pfnInStr : iomR3IOPortDummy InStr;530 pVM->iom.s.paIoPortRegs[idx].pfnOutCallback = pfnOut ? pfnOut : iomR3IOPortDummyNewOut; 531 pVM->iom.s.paIoPortRegs[idx].pfnInCallback = pfnIn ? pfnIn : iomR3IOPortDummyNewIn; 532 pVM->iom.s.paIoPortRegs[idx].pfnOutStrCallback = pfnOutStr ? pfnOutStr : iomR3IOPortDummyNewOutStr; 533 pVM->iom.s.paIoPortRegs[idx].pfnInStrCallback = pfnInStr ? pfnInStr : iomR3IOPortDummyNewInStr; 530 534 pVM->iom.s.paIoPortRegs[idx].pszDesc = pszDesc; 531 535 pVM->iom.s.paIoPortRegs[idx].paExtDescs = paExtDescs; … … 592 596 /* Insert after the entry we just considered: */ 593 597 pEntry += 1; 594 if (i End< cEntries)595 memmove(pEntry + 1, pEntry, sizeof(*pEntry) * (cEntries - i End));598 if (i < cEntries) 599 memmove(pEntry + 1, pEntry, sizeof(*pEntry) * (cEntries - i)); 596 600 break; 597 601 } … … 604 608 { 605 609 /* Insert at the entry we just considered: */ 606 if (i End< cEntries)607 memmove(pEntry + 1, pEntry, sizeof(*pEntry) * (cEntries - i End));610 if (i < cEntries) 611 memmove(pEntry + 1, pEntry, sizeof(*pEntry) * (cEntries - i)); 608 612 break; 609 613 } … … 761 765 762 766 RTIOPORT uPortPrev = paEntries[0].uLastPort; 763 for (i = 1; i < = cEntries; i++)767 for (i = 1; i < cEntries - 1; i++) 764 768 { 765 769 AssertMsg(paEntries[i].uLastPort >= paEntries[i].uFirstPort, ("%u: %#x %#x\n", i, paEntries[i].uLastPort, paEntries[i].uFirstPort)); … … 1697 1701 1698 1702 /** 1703 * @callback_method_impl{FNIOMIOPORTNEWIN, 1704 * Dummy Port I/O Handler for IN operations.} 1705 */ 1706 static DECLCALLBACK(VBOXSTRICTRC) 1707 iomR3IOPortDummyNewIn(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb) 1708 { 1709 NOREF(pDevIns); NOREF(pvUser); NOREF(Port); 1710 switch (cb) 1711 { 1712 case 1: *pu32 = 0xff; break; 1713 case 2: *pu32 = 0xffff; break; 1714 case 4: *pu32 = UINT32_C(0xffffffff); break; 1715 default: 1716 AssertReleaseMsgFailed(("cb=%d\n", cb)); 1717 return VERR_IOM_IOPORT_IPE_2; 1718 } 1719 return VINF_SUCCESS; 1720 } 1721 1722 1723 /** 1724 * @callback_method_impl{FNIOMIOPORTNEWINSTRING, 1725 * Dummy Port I/O Handler for string IN operations.} 1726 */ 1727 static DECLCALLBACK(VBOXSTRICTRC) 1728 iomR3IOPortDummyNewInStr(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint8_t *pbDst, uint32_t *pcTransfer, unsigned cb) 1729 { 1730 NOREF(pDevIns); NOREF(pvUser); NOREF(Port); NOREF(pbDst); NOREF(pcTransfer); NOREF(cb); 1731 return VINF_SUCCESS; 1732 } 1733 1734 1735 /** 1736 * @callback_method_impl{FNIOMIOPORTNEWOUT, 1737 * Dummy Port I/O Handler for OUT operations.} 1738 */ 1739 static DECLCALLBACK(VBOXSTRICTRC) 1740 iomR3IOPortDummyNewOut(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb) 1741 { 1742 NOREF(pDevIns); NOREF(pvUser); NOREF(Port); NOREF(u32); NOREF(cb); 1743 return VINF_SUCCESS; 1744 } 1745 1746 1747 /** 1748 * @callback_method_impl{FNIOMIOPORTNEWOUTSTRING, 1749 * Dummy Port I/O Handler for string OUT operations.} 1750 */ 1751 static DECLCALLBACK(VBOXSTRICTRC) 1752 iomR3IOPortDummyNewOutStr(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint8_t const *pbSrc, uint32_t *pcTransfer, unsigned cb) 1753 { 1754 NOREF(pDevIns); NOREF(pvUser); NOREF(Port); NOREF(pbSrc); NOREF(pcTransfer); NOREF(cb); 1755 return VINF_SUCCESS; 1756 } 1757 1758 1759 /** 1699 1760 * Display a single I/O port ring-3 range. 1700 1761 * -
trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
r80949 r80960 99 99 /** @interface_method_impl{PDMDEVHLPR3,pfnIoPortCreateEx} */ 100 100 static DECLCALLBACK(int) pdmR3DevHlp_IoPortCreateEx(PPDMDEVINS pDevIns, RTIOPORT cPorts, uint32_t fFlags, PPDMPCIDEV pPciDev, 101 uint32_t iPciRegion, PFNIOMIOPORT OUT pfnOut, PFNIOMIOPORTIN pfnIn,102 PFNIOMIOPORT OUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, RTR3PTR pvUser,101 uint32_t iPciRegion, PFNIOMIOPORTNEWOUT pfnOut, PFNIOMIOPORTNEWIN pfnIn, 102 PFNIOMIOPORTNEWOUTSTRING pfnOutStr, PFNIOMIOPORTNEWINSTRING pfnInStr, RTR3PTR pvUser, 103 103 const char *pszDesc, PCIOMIOPORTDESC paExtDescs, PIOMIOPORTHANDLE phIoPorts) 104 104 { -
trunk/src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp
r80333 r80960 295 295 296 296 297 /** @interface_method_impl{PDMPCIHLPR3,pfnGetRCHelpers} */ 298 static DECLCALLBACK(PCPDMPCIHLPRC) pdmR3PciHlp_GetRCHelpers(PPDMDEVINS pDevIns) 299 { 300 PDMDEV_ASSERT_DEVINS(pDevIns); 301 PVM pVM = pDevIns->Internal.s.pVMR3; 302 VM_ASSERT_EMT(pVM); 303 304 RTRCPTR pRCHelpers = NIL_RTRCPTR; 305 if (VM_IS_RAW_MODE_ENABLED(pVM)) 306 { 307 int rc = PDMR3LdrGetSymbolRC(pVM, NULL, "g_pdmRCPciHlp", &pRCHelpers); 308 AssertReleaseRC(rc); 309 AssertRelease(pRCHelpers); 310 } 311 312 LogFlow(("pdmR3PciHlp_GetRCHelpers: caller='%s'/%d: returns %RRv\n", 313 pDevIns->pReg->szName, pDevIns->iInstance, pRCHelpers)); 314 return pRCHelpers; 315 } 316 317 318 /** @interface_method_impl{PDMPCIHLPR3,pfnGetR0Helpers} */ 319 static DECLCALLBACK(PCPDMPCIHLPR0) pdmR3PciHlp_GetR0Helpers(PPDMDEVINS pDevIns) 320 { 321 PDMDEV_ASSERT_DEVINS(pDevIns); 322 PVM pVM = pDevIns->Internal.s.pVMR3; 323 VM_ASSERT_EMT(pVM); 324 PCPDMPCIHLPR0 pR0Helpers = 0; 325 int rc = PDMR3LdrGetSymbolR0(pVM, NULL, "g_pdmR0PciHlp", &pR0Helpers); 326 AssertReleaseRC(rc); 327 AssertRelease(pR0Helpers); 328 LogFlow(("pdmR3PciHlp_GetR0Helpers: caller='%s'/%d: returns %RHv\n", 329 pDevIns->pReg->szName, pDevIns->iInstance, pR0Helpers)); 330 return pR0Helpers; 297 /** @interface_method_impl{PDMPCIHLPR3,pfnGetBusByNo} */ 298 static DECLCALLBACK(PPDMDEVINS) pdmR3PciHlp_GetBusByNo(PPDMDEVINS pDevIns, uint32_t idxPdmBus) 299 { 300 PDMDEV_ASSERT_DEVINS(pDevIns); 301 PVM pVM = pDevIns->Internal.s.pVMR3; 302 AssertReturn(idxPdmBus < RT_ELEMENTS(pVM->pdm.s.aPciBuses), NULL); 303 PPDMDEVINS pRetDevIns = pVM->pdm.s.aPciBuses[idxPdmBus].pDevInsR3; 304 LogFlow(("pdmR3PciHlp_GetBusByNo: caller='%s'/%d: returns %p\n", pDevIns->pReg->szName, pDevIns->iInstance, pRetDevIns)); 305 return pRetDevIns; 331 306 } 332 307 … … 342 317 pdmR3PciHlp_IoApicSendMsi, 343 318 pdmR3PciHlp_IsMMIO2Base, 344 pdmR3PciHlp_GetRCHelpers,345 pdmR3PciHlp_GetR0Helpers,346 319 pdmR3PciHlp_Lock, 347 320 pdmR3PciHlp_Unlock, 321 pdmR3PciHlp_GetBusByNo, 348 322 PDM_PCIHLPR3_VERSION, /* the end */ 349 323 }; -
trunk/src/VBox/VMM/include/IOMInternal.h
r80679 r80960 167 167 R0PTRTYPE(PPDMDEVINS) pDevIns; 168 168 /** Pointer to OUT callback function. */ 169 R0PTRTYPE(PFNIOMIOPORT OUT)pfnOutCallback;169 R0PTRTYPE(PFNIOMIOPORTNEWOUT) pfnOutCallback; 170 170 /** Pointer to IN callback function. */ 171 R0PTRTYPE(PFNIOMIOPORT IN)pfnInCallback;171 R0PTRTYPE(PFNIOMIOPORTNEWIN) pfnInCallback; 172 172 /** Pointer to string OUT callback function. */ 173 R0PTRTYPE(PFNIOMIOPORT OUTSTRING)pfnOutStrCallback;173 R0PTRTYPE(PFNIOMIOPORTNEWOUTSTRING) pfnOutStrCallback; 174 174 /** Pointer to string IN callback function. */ 175 R0PTRTYPE(PFNIOMIOPORT INSTRING)pfnInStrCallback;175 R0PTRTYPE(PFNIOMIOPORTNEWINSTRING) pfnInStrCallback; 176 176 /** The entry of the first statistics entry, UINT16_MAX if no stats. */ 177 177 uint16_t idxStats; … … 196 196 R3PTRTYPE(PPDMDEVINS) pDevIns; 197 197 /** Pointer to OUT callback function. */ 198 R3PTRTYPE(PFNIOMIOPORT OUT)pfnOutCallback;198 R3PTRTYPE(PFNIOMIOPORTNEWOUT) pfnOutCallback; 199 199 /** Pointer to IN callback function. */ 200 R3PTRTYPE(PFNIOMIOPORT IN)pfnInCallback;200 R3PTRTYPE(PFNIOMIOPORTNEWIN) pfnInCallback; 201 201 /** Pointer to string OUT callback function. */ 202 R3PTRTYPE(PFNIOMIOPORT OUTSTRING)pfnOutStrCallback;202 R3PTRTYPE(PFNIOMIOPORTNEWOUTSTRING) pfnOutStrCallback; 203 203 /** Pointer to string IN callback function. */ 204 R3PTRTYPE(PFNIOMIOPORT INSTRING)pfnInStrCallback;204 R3PTRTYPE(PFNIOMIOPORTNEWINSTRING) pfnInStrCallback; 205 205 /** Description / Name. For easing debugging. */ 206 206 R3PTRTYPE(const char *) pszDesc;
Note:
See TracChangeset
for help on using the changeset viewer.