summaryrefslogtreecommitdiff
path: root/include/VBox/pci.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/VBox/pci.h')
-rw-r--r--include/VBox/pci.h45
1 files changed, 27 insertions, 18 deletions
diff --git a/include/VBox/pci.h b/include/VBox/pci.h
index 526c7298..4c6b5fd6 100644
--- a/include/VBox/pci.h
+++ b/include/VBox/pci.h
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 2006-2012 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -87,6 +87,8 @@ typedef enum PCIADDRESSSPACE
*
* @param enmType One of the PCI_ADDRESS_SPACE_* values.
*
+ * @remarks Called with the PDM lock held. The device lock is NOT take because
+ * that is very likely be a lock order violation.
*/
typedef DECLCALLBACK(int) FNPCIIOREGIONMAP(PPCIDEVICE pPciDev, /*unsigned*/ int iRegion, RTGCPHYS GCPhysAddress, uint32_t cb, PCIADDRESSSPACE enmType);
/** Pointer to a FNPCIIOREGIONMAP() function. */
@@ -470,6 +472,9 @@ typedef FNPCIIOREGIONMAP *PFNPCIIOREGIONMAP;
* @param pPciDev Pointer to PCI device. Use pPciDev->pDevIns to get the device instance.
* @param Address The configuration space register address. [0..4096]
* @param cb The register size. [1,2,4]
+ *
+ * @remarks Called with the PDM lock held. The device lock is NOT take because
+ * that is very likely be a lock order violation.
*/
typedef DECLCALLBACK(uint32_t) FNPCICONFIGREAD(PPCIDEVICE pPciDev, uint32_t Address, unsigned cb);
/** Pointer to a FNPCICONFIGREAD() function. */
@@ -485,6 +490,9 @@ typedef PFNPCICONFIGREAD *PPFNPCICONFIGREAD;
* @param u32Value The value that's being written. The number of bits actually used from
* this value is determined by the cb parameter.
* @param cb The register size. [1,2,4]
+ *
+ * @remarks Called with the PDM lock held. The device lock is NOT take because
+ * that is very likely be a lock order violation.
*/
typedef DECLCALLBACK(void) FNPCICONFIGWRITE(PPCIDEVICE pPciDev, uint32_t Address, uint32_t u32Value, unsigned cb);
/** Pointer to a FNPCICONFIGWRITE() function. */
@@ -537,47 +545,48 @@ typedef struct PCIDevice
/** @} */
} PCIDEVICE;
-/* @todo: handle extended space access */
-DECLINLINE(void) PCIDevSetByte(PPCIDEVICE pPciDev, uint32_t uOffset, uint8_t u8Value)
+/** @todo handle extended space access. */
+
+DECLINLINE(void) PCIDevSetByte(PPCIDEVICE pPciDev, uint32_t offReg, uint8_t u8Value)
{
- pPciDev->config[uOffset] = u8Value;
+ pPciDev->config[offReg] = u8Value;
}
-DECLINLINE(uint8_t) PCIDevGetByte(PPCIDEVICE pPciDev, uint32_t uOffset)
+DECLINLINE(uint8_t) PCIDevGetByte(PPCIDEVICE pPciDev, uint32_t offReg)
{
- return pPciDev->config[uOffset];
+ return pPciDev->config[offReg];
}
-DECLINLINE(void) PCIDevSetWord(PPCIDEVICE pPciDev, uint32_t uOffset, uint16_t u16Value)
+DECLINLINE(void) PCIDevSetWord(PPCIDEVICE pPciDev, uint32_t offReg, uint16_t u16Value)
{
- *(uint16_t*)&pPciDev->config[uOffset] = RT_H2LE_U16(u16Value);
+ *(uint16_t*)&pPciDev->config[offReg] = RT_H2LE_U16(u16Value);
}
-DECLINLINE(uint16_t) PCIDevGetWord(PPCIDEVICE pPciDev, uint32_t uOffset)
+DECLINLINE(uint16_t) PCIDevGetWord(PPCIDEVICE pPciDev, uint32_t offReg)
{
- uint16_t u16Value = *(uint16_t*)&pPciDev->config[uOffset];
+ uint16_t u16Value = *(uint16_t*)&pPciDev->config[offReg];
return RT_H2LE_U16(u16Value);
}
-DECLINLINE(void) PCIDevSetDWord(PPCIDEVICE pPciDev, uint32_t uOffset, uint32_t u32Value)
+DECLINLINE(void) PCIDevSetDWord(PPCIDEVICE pPciDev, uint32_t offReg, uint32_t u32Value)
{
- *(uint32_t*)&pPciDev->config[uOffset] = RT_H2LE_U32(u32Value);
+ *(uint32_t*)&pPciDev->config[offReg] = RT_H2LE_U32(u32Value);
}
-DECLINLINE(uint32_t) PCIDevGetDWord(PPCIDEVICE pPciDev, uint32_t uOffset)
+DECLINLINE(uint32_t) PCIDevGetDWord(PPCIDEVICE pPciDev, uint32_t offReg)
{
- uint32_t u32Value = *(uint32_t*)&pPciDev->config[uOffset];
+ uint32_t u32Value = *(uint32_t*)&pPciDev->config[offReg];
return RT_H2LE_U32(u32Value);
}
-DECLINLINE(void) PCIDevSetQWord(PPCIDEVICE pPciDev, uint32_t uOffset, uint64_t u64Value)
+DECLINLINE(void) PCIDevSetQWord(PPCIDEVICE pPciDev, uint32_t offReg, uint64_t u64Value)
{
- *(uint64_t*)&pPciDev->config[uOffset] = RT_H2LE_U64(u64Value);
+ *(uint64_t*)&pPciDev->config[offReg] = RT_H2LE_U64(u64Value);
}
-DECLINLINE(uint64_t) PCIDevGetQWord(PPCIDEVICE pPciDev, uint32_t uOffset)
+DECLINLINE(uint64_t) PCIDevGetQWord(PPCIDEVICE pPciDev, uint32_t offReg)
{
- uint64_t u64Value = *(uint64_t*)&pPciDev->config[uOffset];
+ uint64_t u64Value = *(uint64_t*)&pPciDev->config[offReg];
return RT_H2LE_U64(u64Value);
}