diff options
author | Ian Romanick <idr@us.ibm.com> | 2007-09-04 16:13:24 -0700 |
---|---|---|
committer | Ian Romanick <idr@us.ibm.com> | 2007-09-04 16:13:24 -0700 |
commit | 82a2ff0bb091e097bacb66273f55a287afb15abf (patch) | |
tree | d0d960c40c539ccaae110b1e31880958ab74f6af /src/common_interface.c | |
parent | 9d1596cba90c8fd273e9d1d5488747cc0f34fdc7 (diff) | |
download | xorg-lib-libpciaccess-82a2ff0bb091e097bacb66273f55a287afb15abf.tar.gz |
Add stub version of pci_device_map_memory_range
This stub version of pci_device_map_memory_range allows the vesa driver and
other users of this interface to continue functioning with current
libpciaccess bits. That said, users of this interface should convert over
to pci_device_map_range as soon as possible.
Diffstat (limited to 'src/common_interface.c')
-rw-r--r-- | src/common_interface.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/common_interface.c b/src/common_interface.c index 9c29622..98f0e91 100644 --- a/src/common_interface.c +++ b/src/common_interface.c @@ -166,6 +166,34 @@ pci_device_map_region(struct pci_device * dev, unsigned region, * \param dev Device whose memory region is to be mapped. * \param base Base address of the range to be mapped. * \param size Size of the range to be mapped. + * \param write_enable Map for writing (non-zero). + * \param addr Location to store the mapped address. + * + * \return + * Zero on success or an \c errno value on failure. + * + * \sa pci_device_map_range + */ +int pci_device_map_memory_range(struct pci_device *dev, + pciaddr_t base, pciaddr_t size, + int write_enable, void **addr) +{ + return pci_device_map_range(dev, base, size, + (write_enable) ? PCI_DEV_MAP_FLAG_WRITABLE : 0, + addr); +} + + +/** + * Map the specified memory range so that it can be accessed by the CPU. + * + * Maps the specified memory range for access by the processor. The pointer + * to the mapped region is stored in \c addr. In addtion, the + * \c pci_mem_region::memory pointer for the BAR will be updated. + * + * \param dev Device whose memory region is to be mapped. + * \param base Base address of the range to be mapped. + * \param size Size of the range to be mapped. * \param map_flags Flag bits controlling how the mapping is accessed. * \param addr Location to store the mapped address. * |