Changeset 36678 in vbox
- Timestamp:
- Apr 15, 2011 9:24:13 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pci.h
r36630 r36678 55 55 * This is used when registering a I/O region. 56 56 */ 57 /** Note: There are all sorts of dirty dependencies on the values in the58 * pci device. Be careful when changing this.57 /** 58 * Defined by the PCI specification. 59 59 */ 60 60 typedef enum PCIADDRESSSPACE … … 88 88 * @param enmType One of the PCI_ADDRESS_SPACE_* values. 89 89 * 90 * @remarks The address is *NOT* relative to pci_mem_base.91 90 */ 92 91 typedef DECLCALLBACK(int) FNPCIIOREGIONMAP(PPCIDEVICE pPciDev, /*unsigned*/ int iRegion, RTGCPHYS GCPhysAddress, uint32_t cb, PCIADDRESSSPACE enmType); … … 1024 1023 * Class representing PCI address. PCI device consist of 1025 1024 * bus, device and function numbers. Generally device PCI 1026 * address could be changed during runtime, but only by 1025 * address could be changed during runtime, but only by 1027 1026 * an OS PCI driver. 1028 1027 * … … 1109 1108 bool valid() const 1110 1109 { 1111 return (miBus != -1) 1112 && (miDevice != -1) 1110 return (miBus != -1) 1111 && (miDevice != -1) 1113 1112 && (miFn != -1); 1114 1113 } … … 1133 1132 if (cBufSize < (/* bus */ 2 + /* : */ 1 + /* device */ 2 + /* . */ 1 + /* function*/ 1 + /* \0 */1)) 1134 1133 return false; 1135 1134 1136 1135 if (valid()) 1137 1136 RTStrPrintf(szBuf, cBufSize, "%02x:%02x.%01x", miBus, miDevice, miFn); 1138 1137 else 1139 1138 RTStrPrintf(szBuf, cBufSize, "%s", "<bad>"); 1140 1139 1141 1140 return true; 1142 1141 } -
trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
r36663 r36678 958 958 pRegion->map_func = pfnCallback; 959 959 960 /* Set type in the config space. */ 961 uint32_t u32Address = ich9pciGetRegionReg(iRegion); 962 uint32_t u32Value = 963 (((enmType & PCI_ADDRESS_SPACE_MEM_PREFETCH) != 0) ? (1 << 3) : 0) 964 | (((enmType & PCI_ADDRESS_SPACE_IO) != 0) ? 1 : 0); 965 PCIDevSetDWord(pPciDev, u32Address, u32Value); 960 /* Set type in the PCI config space. */ 961 uint32_t u32Value = ((uint32_t)enmType) & (PCI_ADDRESS_SPACE_IO | PCI_ADDRESS_SPACE_BAR64 | PCI_ADDRESS_SPACE_MEM_PREFETCH); 962 PCIDevSetDWord(pPciDev, ich9pciGetRegionReg(iRegion), u32Value); 966 963 967 964 return VINF_SUCCESS; -
trunk/src/VBox/HostDrivers/VBoxPci/VBoxPci.c
r36665 r36678 190 190 191 191 vboxPciDevLock(pThis); 192 192 193 193 if (pThis->IrqHandler.pfnIrqHandler) 194 194 { … … 243 243 static DECLCALLBACK(int) vboxPciDevGetRegionInfo(PRAWPCIDEVPORT pPort, 244 244 int32_t iRegion, 245 246 247 245 RTHCPHYS *pRegionStart, 246 uint64_t *pu64RegionSize, 247 bool *pfPresent, 248 248 uint32_t *pfFlags) 249 249 { … … 266 266 static DECLCALLBACK(int) vboxPciDevMapRegion(PRAWPCIDEVPORT pPort, 267 267 int32_t iRegion, 268 269 268 RTHCPHYS RegionStart, 269 uint64_t u64RegionSize, 270 270 int32_t fFlags, 271 271 RTR0PTR *pRegionBase) … … 288 288 static DECLCALLBACK(int) vboxPciDevUnmapRegion(PRAWPCIDEVPORT pPort, 289 289 int32_t iRegion, 290 291 290 RTHCPHYS RegionStart, 291 uint64_t u64RegionSize, 292 292 RTR0PTR RegionBase) 293 293 { … … 307 307 * @copydoc RAWPCIDEVPORT:: pfnPciCfgRead 308 308 */ 309 static DECLCALLBACK(int) vboxPciDevPciCfgRead(PRAWPCIDEVPORT pPort, uint32_t Register, PCIRAWMEMLOC *pValue) 309 static DECLCALLBACK(int) vboxPciDevPciCfgRead(PRAWPCIDEVPORT pPort, 310 uint32_t Register, 311 PCIRAWMEMLOC *pValue) 310 312 { 311 313 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); … … 325 327 * @copydoc RAWPCIDEVPORT:: pfnPciCfgWrite 326 328 */ 327 static DECLCALLBACK(int) vboxPciDevPciCfgWrite(PRAWPCIDEVPORT pPort, uint32_t Register, PCIRAWMEMLOC *pValue) 329 static DECLCALLBACK(int) vboxPciDevPciCfgWrite(PRAWPCIDEVPORT pPort, 330 uint32_t Register, 331 PCIRAWMEMLOC *pValue) 328 332 { 329 333 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); … … 339 343 } 340 344 341 static DECLCALLBACK(int) vboxPciDevRegisterIrqHandler(PRAWPCIDEVPORT pPort, PFNRAWPCIISR pfnHandler, void* pIrqContext, PCIRAWISRHANDLE *phIsr) 345 static DECLCALLBACK(int) vboxPciDevRegisterIrqHandler(PRAWPCIDEVPORT pPort, 346 PFNRAWPCIISR pfnHandler, 347 void* pIrqContext, 348 PCIRAWISRHANDLE *phIsr) 342 349 { 343 350 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 344 351 int rc; 345 int32_t iHostIrq = 0; 352 int32_t iHostIrq = 0; 346 353 347 354 if (pfnHandler == NULL) … … 365 372 } 366 373 } 367 368 vboxPciDevUnlock(pThis); 369 370 return rc; 371 } 372 373 static DECLCALLBACK(int) vboxPciDevUnregisterIrqHandler(PRAWPCIDEVPORT pPort, PCIRAWISRHANDLE hIsr) 374 375 vboxPciDevUnlock(pThis); 376 377 return rc; 378 } 379 380 static DECLCALLBACK(int) vboxPciDevUnregisterIrqHandler(PRAWPCIDEVPORT pPort, 381 PCIRAWISRHANDLE hIsr) 374 382 { 375 383 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); … … 393 401 } 394 402 395 static DECLCALLBACK(int) vboxPciDevPowerStateChange(PRAWPCIDEVPORT pPort, PCIRAWPOWERSTATE aState, uint64_t *pu64Param) 403 static DECLCALLBACK(int) vboxPciDevPowerStateChange(PRAWPCIDEVPORT pPort, 404 PCIRAWPOWERSTATE aState, 405 uint64_t *pu64Param) 396 406 { 397 407 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort);
Note:
See TracChangeset
for help on using the changeset viewer.