summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2007-08-30 17:52:02 -0700
committerIan Romanick <idr@us.ibm.com>2007-08-30 17:52:19 -0700
commit08ff9f7fbd26dd2d0e30351b556c71c272f6be6c (patch)
tree0c4849c43518d4d172b4a1f409a8e35579b13e23 /include
parentc87273e8e20c8bff892ded31295dba103f27dd35 (diff)
downloadlibpciaccess-08ff9f7fbd26dd2d0e30351b556c71c272f6be6c.tar.gz
New interfaces to map memory with MTRR (or similar) support.
Added new functions pci_device_map_range and pci_device_unmap_range to handle mapping of PCI device BARs. These new interfaces allow the possiblity of MTRRs on platforms that support them. These additional APIs necessitated changing some internal interfaces. The code for FreeBSD and Solaris has been updated but has not been compiled or tested. Old interfaces are marked deprecated and will eventually be removed.
Diffstat (limited to 'include')
-rw-r--r--include/pciaccess.h35
1 files changed, 29 insertions, 6 deletions
diff --git a/include/pciaccess.h b/include/pciaccess.h
index 4f383ab..3146a35 100644
--- a/include/pciaccess.h
+++ b/include/pciaccess.h
@@ -33,6 +33,12 @@
#include <inttypes.h>
+#if __GNUC__ >= 3
+#define __deprecated __attribute__((deprecated))
+#else
+#define __deprecated
+#endif
+
typedef uint64_t pciaddr_t;
struct pci_device;
@@ -42,17 +48,24 @@ struct pci_slot_match;
int pci_device_read_rom(struct pci_device *dev, void *buffer);
-int pci_device_map_region(struct pci_device *dev, unsigned region,
- int write_enable);
+int __deprecated pci_device_map_region(struct pci_device *dev,
+ unsigned region, int write_enable);
-int pci_device_unmap_region(struct pci_device *dev, unsigned region);
+int __deprecated pci_device_unmap_region(struct pci_device *dev,
+ unsigned region);
-int pci_device_map_memory_range(struct pci_device *dev, pciaddr_t base,
- pciaddr_t size, int write_enable, void **addr);
+int pci_device_map_range(struct pci_device *dev, pciaddr_t base,
+ pciaddr_t size, unsigned map_flags, void **addr);
-int pci_device_unmap_memory_range(struct pci_device *dev, void *memory,
+int pci_device_unmap_range(struct pci_device *dev, void *memory,
pciaddr_t size);
+int __deprecated pci_device_map_memory_range(struct pci_device *dev,
+ pciaddr_t base, pciaddr_t size, int write_enable, void **addr);
+
+int __deprecated pci_device_unmap_memory_range(struct pci_device *dev,
+ void *memory, pciaddr_t size);
+
int pci_device_probe(struct pci_device *dev);
const struct pci_agp_info *pci_device_get_agp_info(struct pci_device *dev);
@@ -111,6 +124,16 @@ int pci_device_cfg_write_u32(struct pci_device *dev, uint32_t data,
int pci_device_cfg_write_bits(struct pci_device *dev, uint32_t mask,
uint32_t data, pciaddr_t offset);
+/**
+ * \name Mapping flags passed to \c pci_device_map_range
+ */
+/*@{*/
+#define PCI_DEV_MAP_FLAG_WRITABLE (1U<<0)
+#define PCI_DEV_MAP_FLAG_WRITE_COMBINE (1U<<1)
+#define PCI_DEV_MAP_FLAG_CACHABLE (1U<<2)
+/*@}*/
+
+
#define PCI_MATCH_ANY (~0)
/**