COPYING | 2 ChangeLog | 178 +++++++ Makefile.am | 2 configure.ac | 74 +-- debian/changelog | 11 debian/libpciaccess0.symbols | 74 +-- debian/rules | 15 include/pciaccess.h | 22 scanpci/scanpci.c | 33 + src/Doxyfile | 1016 +++++++++++++++++++++---------------------- src/Makefile.am | 4 src/common_bridge.c | 10 src/common_capability.c | 10 src/common_device_name.c | 28 - src/common_init.c | 12 src/common_interface.c | 92 ++- src/common_io.c | 2 src/common_iterator.c | 30 - src/freebsd_pci.c | 14 src/linux_devmem.c | 18 src/linux_devmem.h | 2 src/linux_sysfs.c | 106 +++- src/netbsd_pci.c | 2 src/pciaccess_private.h | 14 src/solx_devfs.c | 151 +++--- 25 files changed, 1134 insertions(+), 788 deletions(-)
New commits: commit bbda6cfc19cdc7242b0d104cd970eb7a08f30b34 Author: Cyril Brulebois <k...@debian.org> Date: Thu Dec 15 15:56:00 2011 +0100 Upload to unstable. diff --git a/debian/changelog b/debian/changelog index c26fa76..708590f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -libpciaccess (0.12.902-1) UNRELEASED; urgency=low +libpciaccess (0.12.902-1) unstable; urgency=low * New upstream release candidate. * Add -c4 to dh_makeshlibs. @@ -7,7 +7,7 @@ libpciaccess (0.12.902-1) UNRELEASED; urgency=low * Use --parallel to simplify parallel build handling. * Use dpkg-buildflags to set CFLAGS automatically. - -- Cyril Brulebois <k...@debian.org> Thu, 15 Dec 2011 15:30:29 +0100 + -- Cyril Brulebois <k...@debian.org> Thu, 15 Dec 2011 15:55:57 +0100 libpciaccess (0.12.1-2) unstable; urgency=low commit 148a6320ed0537dacb5de2a99a22cc84dfcda3bf Author: Cyril Brulebois <k...@debian.org> Date: Thu Dec 15 15:55:55 2011 +0100 Use dpkg-buildflags to set CFLAGS automatically. diff --git a/debian/changelog b/debian/changelog index 37f427f..c26fa76 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ libpciaccess (0.12.902-1) UNRELEASED; urgency=low * Sort libpciaccess0.symbols. * Add pci_device_{,un}map_legacy symbols, and bump shlibs accordingly. * Use --parallel to simplify parallel build handling. + * Use dpkg-buildflags to set CFLAGS automatically. -- Cyril Brulebois <k...@debian.org> Thu, 15 Dec 2011 15:30:29 +0100 diff --git a/debian/rules b/debian/rules index 6dcf0d5..d724c5d 100755 --- a/debian/rules +++ b/debian/rules @@ -2,12 +2,7 @@ PACKAGE = libpciaccess0 -CFLAGS = -Wall -g -ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif +CFLAGS = $(shell dpkg-buildflags --get CFLAGS) %: dh $@ --with autoreconf --builddirectory=build/ --parallel commit 19afb9456e39948b4f436bb47ded1aa271430a09 Author: Cyril Brulebois <k...@debian.org> Date: Thu Dec 15 15:52:07 2011 +0100 Use --parallel to simplify parallel build handling. diff --git a/debian/changelog b/debian/changelog index 424d343..37f427f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ libpciaccess (0.12.902-1) UNRELEASED; urgency=low * Add -c4 to dh_makeshlibs. * Sort libpciaccess0.symbols. * Add pci_device_{,un}map_legacy symbols, and bump shlibs accordingly. + * Use --parallel to simplify parallel build handling. -- Cyril Brulebois <k...@debian.org> Thu, 15 Dec 2011 15:30:29 +0100 diff --git a/debian/rules b/debian/rules index 7a1350c..6dcf0d5 100755 --- a/debian/rules +++ b/debian/rules @@ -8,13 +8,9 @@ ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) else CFLAGS += -O2 endif -ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) - NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) - MAKEFLAGS += -j$(NUMJOBS) -endif %: - dh $@ --with autoreconf --builddirectory=build/ + dh $@ --with autoreconf --builddirectory=build/ --parallel override_dh_auto_configure: dh_auto_configure -- \ commit 40d54e33467f81b826d5b9402275e30e4bd4d761 Author: Cyril Brulebois <k...@debian.org> Date: Thu Dec 15 15:43:52 2011 +0100 Add pci_device_{,un}map_legacy symbols, and bump shlibs accordingly. diff --git a/debian/changelog b/debian/changelog index d5ca25f..424d343 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ libpciaccess (0.12.902-1) UNRELEASED; urgency=low * New upstream release candidate. * Add -c4 to dh_makeshlibs. * Sort libpciaccess0.symbols. + * Add pci_device_{,un}map_legacy symbols, and bump shlibs accordingly. -- Cyril Brulebois <k...@debian.org> Thu, 15 Dec 2011 15:30:29 +0100 diff --git a/debian/libpciaccess0.symbols b/debian/libpciaccess0.symbols index 6147b6e..8aaeb5b 100644 --- a/debian/libpciaccess0.symbols +++ b/debian/libpciaccess0.symbols @@ -22,6 +22,7 @@ libpciaccess.so.0 libpciaccess0 #MINVER# pci_device_get_vendor_name@Base 0 pci_device_has_kernel_driver@Base 0.10.7 pci_device_is_boot_vga@Base 0.10.7 + pci_device_map_legacy@Base 0.12.902 pci_device_map_memory_range@Base 0 pci_device_map_range@Base 0.8.0+git20071002 pci_device_map_region@Base 0 @@ -29,6 +30,7 @@ libpciaccess.so.0 libpciaccess0 #MINVER# pci_device_open_io@Base 0.11.0 pci_device_probe@Base 0 pci_device_read_rom@Base 0 + pci_device_unmap_legacy@Base 0.12.902 pci_device_unmap_memory_range@Base 0 pci_device_unmap_range@Base 0.8.0+git20071002 pci_device_unmap_region@Base 0 diff --git a/debian/rules b/debian/rules index 3a6b710..7a1350c 100755 --- a/debian/rules +++ b/debian/rules @@ -27,4 +27,4 @@ override_dh_install: dh_install --fail-missing override_dh_makeshlibs: - dh_makeshlibs -V'libpciaccess0 (>= 0.11.0)' --add-udeb=$(PACKAGE)-udeb -- -c4 + dh_makeshlibs -V'libpciaccess0 (>= 0.12.902)' --add-udeb=$(PACKAGE)-udeb -- -c4 commit 13d07479fd19b2a9a95b2639afc7153b1b9d137d Author: Cyril Brulebois <k...@debian.org> Date: Thu Dec 15 15:39:44 2011 +0100 Sort libpciaccess0.symbols. diff --git a/debian/changelog b/debian/changelog index c17df66..d5ca25f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ libpciaccess (0.12.902-1) UNRELEASED; urgency=low * New upstream release candidate. * Add -c4 to dh_makeshlibs. + * Sort libpciaccess0.symbols. -- Cyril Brulebois <k...@debian.org> Thu, 15 Dec 2011 15:30:29 +0100 diff --git a/debian/libpciaccess0.symbols b/debian/libpciaccess0.symbols index 5411b6c..6147b6e 100644 --- a/debian/libpciaccess0.symbols +++ b/debian/libpciaccess0.symbols @@ -1,16 +1,36 @@ libpciaccess.so.0 libpciaccess0 #MINVER# - pci_device_next@Base 0 - pci_device_map_region@Base 0 + pci_device_cfg_read@Base 0 + pci_device_cfg_read_u16@Base 0 pci_device_cfg_read_u32@Base 0 - pci_system_init@Base 0 - pci_system_init_dev_mem@Base 0.10.2 + pci_device_cfg_read_u8@Base 0 + pci_device_cfg_write@Base 0 + pci_device_cfg_write_bits@Base 0 pci_device_cfg_write_u16@Base 0 + pci_device_cfg_write_u32@Base 0 + pci_device_cfg_write_u8@Base 0 + pci_device_close_io@Base 0.11.0 pci_device_enable@Base 0.10.2 - pci_get_strings@Base 0 - pci_device_map_memory_range@Base 0 + pci_device_find_by_slot@Base 0 + pci_device_get_agp_info@Base 0 + pci_device_get_bridge_buses@Base 0 + pci_device_get_bridge_info@Base 0 + pci_device_get_device_name@Base 0 + pci_device_get_parent_bridge@Base 0.11.0 + pci_device_get_pcmcia_bridge_info@Base 0 + pci_device_get_subdevice_name@Base 0 pci_device_get_subvendor_name@Base 0 + pci_device_get_vendor_name@Base 0 + pci_device_has_kernel_driver@Base 0.10.7 + pci_device_is_boot_vga@Base 0.10.7 + pci_device_map_memory_range@Base 0 + pci_device_map_range@Base 0.8.0+git20071002 + pci_device_map_region@Base 0 + pci_device_next@Base 0 + pci_device_open_io@Base 0.11.0 pci_device_probe@Base 0 - pci_device_cfg_write@Base 0 + pci_device_read_rom@Base 0 + pci_device_unmap_memory_range@Base 0 + pci_device_unmap_range@Base 0.8.0+git20071002 pci_device_unmap_region@Base 0 pci_device_vgaarb_decodes@Base 0.10.7 pci_device_vgaarb_fini@Base 0.10.7 @@ -20,37 +40,17 @@ libpciaccess.so.0 libpciaccess0 #MINVER# pci_device_vgaarb_set_target@Base 0.10.7 pci_device_vgaarb_trylock@Base 0.10.7 pci_device_vgaarb_unlock@Base 0.10.7 - pci_device_cfg_read_u16@Base 0 - pci_device_get_device_name@Base 0 - pci_device_find_by_slot@Base 0 + pci_get_strings@Base 0 pci_id_match_iterator_create@Base 0 - pci_device_cfg_write_u8@Base 0 - pci_device_get_subdevice_name@Base 0 - pci_device_unmap_range@Base 0.8.0+git20071002 - pci_device_get_bridge_info@Base 0 - pci_system_cleanup@Base 0 - pci_device_cfg_read_u8@Base 0 - pci_iterator_destroy@Base 0 - pci_device_read_rom@Base 0 - pci_device_map_range@Base 0.8.0+git20071002 - pci_slot_match_iterator_create@Base 0 - pci_device_cfg_write_u32@Base 0 - pci_device_unmap_memory_range@Base 0 - pci_device_get_agp_info@Base 0 - pci_device_get_pcmcia_bridge_info@Base 0 - pci_device_get_bridge_buses@Base 0 - pci_device_cfg_write_bits@Base 0 - pci_device_get_vendor_name@Base 0 - pci_device_has_kernel_driver@Base 0.10.7 - pci_device_is_boot_vga@Base 0.10.7 - pci_device_cfg_read@Base 0 - pci_device_get_parent_bridge@Base 0.11.0 - pci_device_open_io@Base 0.11.0 - pci_device_close_io@Base 0.11.0 - pci_legacy_open_io@Base 0.11.0 - pci_io_read8@Base 0.11.0 pci_io_read16@Base 0.11.0 pci_io_read32@Base 0.11.0 - pci_io_write8@Base 0.11.0 + pci_io_read8@Base 0.11.0 pci_io_write16@Base 0.11.0 pci_io_write32@Base 0.11.0 + pci_io_write8@Base 0.11.0 + pci_iterator_destroy@Base 0 + pci_legacy_open_io@Base 0.11.0 + pci_slot_match_iterator_create@Base 0 + pci_system_cleanup@Base 0 + pci_system_init@Base 0 + pci_system_init_dev_mem@Base 0.10.2 commit 0059b1a08f739df7b0f58f07a358e93f71b4268e Author: Cyril Brulebois <k...@debian.org> Date: Thu Dec 15 15:37:22 2011 +0100 Add -c4 to dh_makeshlibs. diff --git a/debian/changelog b/debian/changelog index 6b5e659..c17df66 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ libpciaccess (0.12.902-1) UNRELEASED; urgency=low * New upstream release candidate. + * Add -c4 to dh_makeshlibs. -- Cyril Brulebois <k...@debian.org> Thu, 15 Dec 2011 15:30:29 +0100 diff --git a/debian/rules b/debian/rules index fd898e3..3a6b710 100755 --- a/debian/rules +++ b/debian/rules @@ -27,4 +27,4 @@ override_dh_install: dh_install --fail-missing override_dh_makeshlibs: - dh_makeshlibs -V'libpciaccess0 (>= 0.11.0)' --add-udeb=$(PACKAGE)-udeb + dh_makeshlibs -V'libpciaccess0 (>= 0.11.0)' --add-udeb=$(PACKAGE)-udeb -- -c4 commit 93890188ae35844fc1e4640d6a8e8e2800265456 Author: Cyril Brulebois <k...@debian.org> Date: Thu Dec 15 15:30:38 2011 +0100 Bump changelogs. diff --git a/ChangeLog b/ChangeLog index cb640b9..6ce65d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,181 @@ +commit 78eed07d599ff9e30c075aa7c8d1795e125ffc4b +Author: Jeremy Huddleston <jerem...@apple.com> +Date: Wed Nov 9 09:27:49 2011 -0800 + + configure.ac: Bump to 0.12.902 + + Signed-off-by: Jeremy Huddleston <jerem...@apple.com> + +commit cbb3c63affc1792ade0433691aa67f0edad52b0b +Author: Jeremy Huddleston <jerem...@apple.com> +Date: Wed Nov 9 09:46:30 2011 -0800 + + Fix some -Wformat errors in scanpci + + Signed-off-by: Jeremy Huddleston <jerem...@apple.com> + +commit a0a53a67c91c698007dcac3e7aba27c999c4f6ed +Author: Nithin Nayak Sujir <nsu...@broadcom.com> +Date: Mon Oct 24 12:15:15 2011 -0700 + + libpciaccess: close mtrr fd on pci_cleanup + + Since the fd is not closed, calling pci_system_init and + pci_system_cleanup more than 1024 times results in "too many files open" + error. + + Signed-off-by: Nithin Nayak Sujir <nsu...@broadcom.com> + Reviewed-by: Jeremy Huddleston <jerem...@apple.com> + +commit 803bf3aa28de0f1260e479e2036159d4fead0a87 +Author: Alan Coopersmith <alan.coopersm...@oracle.com> +Date: Tue Oct 4 21:46:05 2011 -0700 + + Solaris: Give better error on realloc failure + + commit a18460b385ae03 converted from a fixed maximum number of devices + to dynamically growing the list via realloc, but didn't update the + error message shown on failure. + + Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> + Reviewed-by: Dirk Wallenstein <hals...@t-online.de> + Reviewed-by: Mark Kettenis <kette...@openbsd.org> + +commit af4478c52c960bee08209293aa14b784ac30dc05 +Author: Jeremy Huddleston <jerem...@apple.com> +Date: Tue Oct 11 10:22:49 2011 -0700 + + linux sysfs: Fix read-write access in map_legacy + + O_RDONLY | O_WRONLY != O_RDWR + + >< + + Reported-by: Javier Pello <javier.pe...@urjc.es> + Signed-off-by: Jeremy Huddleston <jerem...@apple.com> + +commit b9c5ce8083be53ea017bd15a63b173b4476fff23 +Author: Jeremy Huddleston <jerem...@apple.com> +Date: Sun Oct 9 03:53:05 2011 -0700 + + scanpci: Build fix for systems without <err.h> + + https://bugs.freedesktop.org/show_bug.cgi?id=31133 + + Signed-off-by: Jeremy Huddleston <jerem...@apple.com> + +commit 30e9ec91107791835d722f99498d659dec048922 +Author: Jeremy Huddleston <jerem...@apple.com> +Date: Fri Oct 7 11:57:26 2011 -0700 + + configure.ac: Bump version to 0.12.901 + + Signed-off-by: Jeremy Huddleston <jerem...@apple.com> + +commit 12dbf6d2d346cfe7ba8b2a1697c56af3f9876be7 +Author: Jeremy Huddleston <jerem...@apple.com> +Date: Fri Oct 7 11:56:06 2011 -0700 + + Update library version to reflect new API + + Signed-off-by: Jeremy Huddleston <jerem...@apple.com> + +commit 58e87933b3286f33cdeedd3a6b21f4ea795bea47 +Author: Adam Jackson <a...@redhat.com> +Date: Tue May 10 17:56:35 2011 -0400 + + linux: Implement map_legacy + + Signed-off-by: Adam Jackson <a...@redhat.com> + Reviewed-by: Jeremy Huddleston <jerem...@apple.com> + +commit 8cc9a8fe57adfb52abaa90a8a2ac2316de8eb898 +Author: Adam Jackson <a...@redhat.com> +Date: Tue May 10 17:56:34 2011 -0400 + + Add map_legacy interface + + This allows platforms to hand back mmaps of the low 1M (ISA) address + space on a per-domain basis. + + Signed-off-by: Adam Jackson <a...@redhat.com> + Reviewed-by: Jeremy Huddleston <jerem...@apple.com> + +commit e1a0240a3d6840b497845680c2bf6753415ba20f +Author: Alan Coopersmith <alan.coopersm...@oracle.com> +Date: Fri Sep 16 22:11:38 2011 -0700 + + Strip trailing whitespace + + Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}' + git diff -w & git diff -b show no diffs from this change + + Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> + +commit 7bfc4f806d51b85e7ae069dd6deaf0b48326ed22 +Author: Adam Jackson <a...@redhat.com> +Date: Wed Aug 3 18:35:11 2011 -0400 + + linux: Fix a crash in populate_devices + + If scandir returns -1, the 'devices' array won't be initialized, and + attempting to free() it will crash. + + Signed-off-by: Adam Jackson <a...@redhat.com> + +commit f9159b97834ba4b4e42a07953a33866e7ac90dbd +Author: Chris Wilson <ch...@chris-wilson.co.uk> +Date: Sat Jun 4 12:30:06 2011 +0100 + + linux: Only set errno after an error + + errno is only valid after an error, and was being filled with a garbage + value upon eof. + + Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> + +commit a18460b385ae034830e4efbaaed7e0665c53ad9f +Author: John Martin <john.m.mar...@oracle.com> +Date: Mon Mar 28 17:51:19 2011 -0700 + + Solaris support for multiple PCI segments (domains) + + 1. Removed hardcoded maximum size of 256 PCI devices, which is + too small for large systems. The number of devices is dynamically + resized as needed. + + 2. pci_device_solx_devfs_probe() no longer walks the device tree + from the very top ("/") but instead starts at the nexus which + owns the bus. Performance optimization for systems with multiple + bus nodes (including systems with just one segment/domain). + + 3. Added support for multiple domains/segments. Code tested + on kernels with and without multiple segment support so it should + be safe to integrate independent of the kernel version. + + Signed-off-by: John Martin <john.m.mar...@oracle.com> + Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> + Reviewed-by: Adam Jackson <a...@redhat.com> + +commit f3e283a25f5fca4f750bb9538d69c4f36641cca5 +Author: Gaetan Nadon <mems...@videotron.ca> +Date: Thu Feb 3 17:38:32 2011 -0500 + + config: comment, minor upgrade, quote and layout configure.ac + + Group statements per section as per Autoconf standard layout + Quote statements where appropriate. + Autoconf recommends not using dnl instead of # for comments + + Use AC_CONFIG_FILES to replace the deprecated AC_OUTPUT with parameters. + Add AC_CONFIG_SRCDIR([Makefile.am]) + Update X.Org util-macros to version 1.8 + + This helps automated maintenance and release activities. + Details can be found in http://wiki.x.org/wiki/NewModuleGuidelines + + Signed-off-by: Gaetan Nadon <mems...@videotron.ca> + commit d05ed57216726811388f17d7e87d7b6c7b8580ee Author: Alan Coopersmith <alan.coopersm...@oracle.com> Date: Wed Feb 2 20:50:17 2011 -0800 diff --git a/debian/changelog b/debian/changelog index 4e15262..6b5e659 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libpciaccess (0.12.902-1) UNRELEASED; urgency=low + + * New upstream release candidate. + + -- Cyril Brulebois <k...@debian.org> Thu, 15 Dec 2011 15:30:29 +0100 + libpciaccess (0.12.1-2) unstable; urgency=low [ Christopher James Halse Rogers ] commit 78eed07d599ff9e30c075aa7c8d1795e125ffc4b Author: Jeremy Huddleston <jerem...@apple.com> Date: Wed Nov 9 09:27:49 2011 -0800 configure.ac: Bump to 0.12.902 Signed-off-by: Jeremy Huddleston <jerem...@apple.com> diff --git a/configure.ac b/configure.ac index d622961..d63ad25 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([libpciaccess],[0.12.901], +AC_INIT([libpciaccess],[0.12.902], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=libpciaccess],[libpciaccess]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) commit cbb3c63affc1792ade0433691aa67f0edad52b0b Author: Jeremy Huddleston <jerem...@apple.com> Date: Wed Nov 9 09:46:30 2011 -0800 Fix some -Wformat errors in scanpci Signed-off-by: Jeremy Huddleston <jerem...@apple.com> diff --git a/scanpci/scanpci.c b/scanpci/scanpci.c index 219c814..1f5f8bd 100644 --- a/scanpci/scanpci.c +++ b/scanpci/scanpci.c @@ -29,6 +29,7 @@ #include <stdlib.h> #include <stdio.h> #include <unistd.h> +#include <inttypes.h> #ifdef HAVE_ERR_H #include <err.h> @@ -51,19 +52,19 @@ static void print_pci_bridge( const struct pci_bridge_info * info ) { - printf( " Bus: primary=%02x, secondary=%02x, subordinate=%02x, " - "sec-latency=%u\n", + printf( " Bus: primary=%02"PRIx8", secondary=%02"PRIx8", subordinate=%02"PRIx8", " + "sec-latency=%"PRIu8"\n", info->primary_bus, info->secondary_bus, info->subordinate_bus, info->secondary_latency_timer ); - printf( " I/O behind bridge: %08x-%08x\n", + printf( " I/O behind bridge: %08"PRIx32"-%08"PRIx32"\n", info->io_base, info->io_limit ); - printf( " Memory behind bridge: %08x-%08x\n", + printf( " Memory behind bridge: %08"PRIx32"-%08"PRIx32"\n", info->mem_base, info->mem_limit ); - printf( " Prefetchable memory behind bridge: %08llx-%08llx\n", + printf( " Prefetchable memory behind bridge: %08"PRIx64"-%08"PRIx64"\n", info->prefetch_mem_base, info->prefetch_mem_limit ); } @@ -150,7 +151,7 @@ print_pci_device( struct pci_device * dev, int verbose ) pci_device_probe( dev ); for ( i = 0 ; i < 6 ; i++ ) { if ( dev->regions[i].base_addr != 0 ) { - printf( " BASE%u 0x%08x SIZE %d %s", + printf( " BASE%u 0x%08"PRIxPTR" SIZE %zu %s", i, (intptr_t) dev->regions[i].base_addr, (size_t) dev->regions[i].size, commit a0a53a67c91c698007dcac3e7aba27c999c4f6ed Author: Nithin Nayak Sujir <nsu...@broadcom.com> Date: Mon Oct 24 12:15:15 2011 -0700 libpciaccess: close mtrr fd on pci_cleanup Since the fd is not closed, calling pci_system_init and pci_system_cleanup more than 1024 times results in "too many files open" error. Signed-off-by: Nithin Nayak Sujir <nsu...@broadcom.com> Reviewed-by: Jeremy Huddleston <jerem...@apple.com> diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c index d5ba66a..09e7138 100644 --- a/src/linux_sysfs.c +++ b/src/linux_sysfs.c @@ -889,8 +889,18 @@ pci_device_linux_sysfs_unmap_legacy(struct pci_device *dev, void *addr, pciaddr_ return munmap(addr, size); } + +static void +pci_system_linux_destroy(void) +{ +#ifdef HAVE_MTRR + if (pci_sys->mtrr_fd != -1) + close(pci_sys->mtrr_fd); +#endif +} + static const struct pci_system_methods linux_sysfs_methods = { - .destroy = NULL, + .destroy = pci_system_linux_destroy, .destroy_device = NULL, .read_rom = pci_device_linux_sysfs_read_rom, .probe = pci_device_linux_sysfs_probe, commit 803bf3aa28de0f1260e479e2036159d4fead0a87 Author: Alan Coopersmith <alan.coopersm...@oracle.com> Date: Tue Oct 4 21:46:05 2011 -0700 Solaris: Give better error on realloc failure commit a18460b385ae03 converted from a fixed maximum number of devices to dynamically growing the list via realloc, but didn't update the error message shown on failure. Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> Reviewed-by: Dirk Wallenstein <hals...@t-online.de> Reviewed-by: Mark Kettenis <kette...@openbsd.org> diff --git a/src/solx_devfs.c b/src/solx_devfs.c index d47a846..ea91479 100644 --- a/src/solx_devfs.c +++ b/src/solx_devfs.c @@ -454,8 +454,9 @@ probe_dev(nexus_t *nexus, pcitool_reg_t *prg_p, probe_info_t *pinfo) new_num_elems * sizeof (struct pci_device_private)); if (new_devs == NULL) { (void) fprintf(stderr, - "Maximum number of PCI devices found," - " discarding additional devices\n"); + "Error allocating memory for PCI devices:" + " %s\n discarding additional devices\n", + strerror(errno)); return (rval); } (void) memset(&new_devs[pinfo->num_devices], 0, commit af4478c52c960bee08209293aa14b784ac30dc05 Author: Jeremy Huddleston <jerem...@apple.com> Date: Tue Oct 11 10:22:49 2011 -0700 linux sysfs: Fix read-write access in map_legacy O_RDONLY | O_WRONLY != O_RDWR >< Reported-by: Javier Pello <javier.pe...@urjc.es> Signed-off-by: Jeremy Huddleston <jerem...@apple.com> diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c index 876abb1..d5ba66a 100644 --- a/src/linux_sysfs.c +++ b/src/linux_sysfs.c @@ -851,7 +851,7 @@ pci_device_linux_sysfs_map_legacy(struct pci_device *dev, pciaddr_t base, int ret=0; if (map_flags & PCI_DEV_MAP_FLAG_WRITABLE) { - flags |= O_WRONLY; + flags = O_RDWR; /* O_RDWR != O_WRONLY | O_RDONLY */; prot |= PROT_WRITE; } commit b9c5ce8083be53ea017bd15a63b173b4476fff23 Author: Jeremy Huddleston <jerem...@apple.com> Date: Sun Oct 9 03:53:05 2011 -0700 scanpci: Build fix for systems without <err.h> https://bugs.freedesktop.org/show_bug.cgi?id=31133 Signed-off-by: Jeremy Huddleston <jerem...@apple.com> diff --git a/configure.ac b/configure.ac index 476a4bf..d622961 100644 --- a/configure.ac +++ b/configure.ac @@ -106,6 +106,8 @@ AM_CONDITIONAL(GNU, [test "x$gnu" = xyes]) AC_SYS_LARGEFILE +AC_CHECK_HEADERS([err.h]) + AC_CHECK_HEADER([asm/mtrr.h], [have_mtrr_h="yes"], [have_mtrr_h="no"]) if test "x$have_mtrr_h" = xyes; then diff --git a/scanpci/scanpci.c b/scanpci/scanpci.c index 36ecf04..219c814 100644 --- a/scanpci/scanpci.c +++ b/scanpci/scanpci.c @@ -22,11 +22,29 @@ * DEALINGS IN THE SOFTWARE. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <stdlib.h> #include <stdio.h> -#include <err.h> #include <unistd.h> +#ifdef HAVE_ERR_H +#include <err.h> +#else +# include <errno.h> +# include <string.h> +# define err(exitcode, format, args...) \ + errx(exitcode, format ": %s", ## args, strerror(errno)) +# define errx(exitcode, format, args...) \ + { warnx(format, ## args); exit(exitcode); } +# define warn(format, args...) \ + warnx(format ": %s", ## args, strerror(errno)) +# define warnx(format, args...) \ + fprintf(stderr, format "\n", ## args) +#endif + #include "pciaccess.h" commit 30e9ec91107791835d722f99498d659dec048922 Author: Jeremy Huddleston <jerem...@apple.com> Date: Fri Oct 7 11:57:26 2011 -0700 configure.ac: Bump version to 0.12.901 Signed-off-by: Jeremy Huddleston <jerem...@apple.com> diff --git a/configure.ac b/configure.ac index caaf358..476a4bf 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([libpciaccess],[0.12.1], +AC_INIT([libpciaccess],[0.12.901], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=libpciaccess],[libpciaccess]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) commit 12dbf6d2d346cfe7ba8b2a1697c56af3f9876be7 Author: Jeremy Huddleston <jerem...@apple.com> Date: Fri Oct 7 11:56:06 2011 -0700 Update library version to reflect new API Signed-off-by: Jeremy Huddleston <jerem...@apple.com> diff --git a/src/Makefile.am b/src/Makefile.am index 6f50ade..6757a6f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -70,4 +70,4 @@ libpciaccess_la_SOURCES = common_bridge.c \ libpciaccess_la_LIBADD = $(PCIACCESS_LIBS) -libpciaccess_la_LDFLAGS = -version-number 0:10:8 -no-undefined +libpciaccess_la_LDFLAGS = -version-number 0:11:0 -no-undefined commit 58e87933b3286f33cdeedd3a6b21f4ea795bea47 Author: Adam Jackson <a...@redhat.com> Date: Tue May 10 17:56:35 2011 -0400 linux: Implement map_legacy Signed-off-by: Adam Jackson <a...@redhat.com> Reviewed-by: Jeremy Huddleston <jerem...@apple.com> diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c index 0ed6862..876abb1 100644 --- a/src/linux_sysfs.c +++ b/src/linux_sysfs.c @@ -840,6 +840,55 @@ pci_device_linux_sysfs_write8(struct pci_io_handle *handle, uint32_t port, pwrite(handle->fd, &data, 1, port + handle->base); } +static int +pci_device_linux_sysfs_map_legacy(struct pci_device *dev, pciaddr_t base, + pciaddr_t size, unsigned map_flags, void **addr) +{ + char name[PATH_MAX]; + int flags = O_RDONLY; + int prot = PROT_READ; + int fd; + int ret=0; + + if (map_flags & PCI_DEV_MAP_FLAG_WRITABLE) { + flags |= O_WRONLY; + prot |= PROT_WRITE; + } + + /* First check if there's a legacy memory method for the device */ + while (dev) { + snprintf(name, PATH_MAX, "/sys/class/pci_bus/%04x:%02x/legacy_mem", + dev->domain, dev->bus); + + fd = open(name, flags); + if (fd >= 0) + break; + + dev = pci_device_get_parent_bridge(dev); + } + + /* If not, /dev/mem is the best we can do */ + if (!dev) + fd = open("/dev/mem", flags); + + if (fd < 0) + return errno; + + *addr = mmap(NULL, size, prot, MAP_SHARED, fd, base); + if (*addr == MAP_FAILED) { + ret = errno; + } + + close(fd); + return ret; +} + +static int +pci_device_linux_sysfs_unmap_legacy(struct pci_device *dev, void *addr, pciaddr_t size) +{ + return munmap(addr, size); +} + static const struct pci_system_methods linux_sysfs_methods = { .destroy = NULL, .destroy_device = NULL, @@ -865,4 +914,7 @@ static const struct pci_system_methods linux_sysfs_methods = { .write32 = pci_device_linux_sysfs_write32, .write16 = pci_device_linux_sysfs_write16, .write8 = pci_device_linux_sysfs_write8, + + .map_legacy = pci_device_linux_sysfs_map_legacy, + .unmap_legacy = pci_device_linux_sysfs_unmap_legacy, }; commit 8cc9a8fe57adfb52abaa90a8a2ac2316de8eb898 Author: Adam Jackson <a...@redhat.com> Date: Tue May 10 17:56:34 2011 -0400 Add map_legacy interface This allows platforms to hand back mmaps of the low 1M (ISA) address space on a per-domain basis. Signed-off-by: Adam Jackson <a...@redhat.com> Reviewed-by: Jeremy Huddleston <jerem...@apple.com> diff --git a/include/pciaccess.h b/include/pciaccess.h index 00ae6de..c457424 100644 --- a/include/pciaccess.h +++ b/include/pciaccess.h @@ -526,4 +526,12 @@ void pci_io_write32(struct pci_io_handle *handle, uint32_t reg, uint32_t data); void pci_io_write16(struct pci_io_handle *handle, uint32_t reg, uint16_t data); void pci_io_write8(struct pci_io_handle *handle, uint32_t reg, uint8_t data); +/* + * Legacy memory access + */ + +int pci_device_map_legacy(struct pci_device *dev, pciaddr_t base, + pciaddr_t size, unsigned map_flags, void **addr); +int pci_device_unmap_legacy(struct pci_device *dev, void *addr, pciaddr_t size); + #endif /* PCIACCESS_H */ diff --git a/src/common_interface.c b/src/common_interface.c index 94a0d21..6dccf8e 100644 --- a/src/common_interface.c +++ b/src/common_interface.c @@ -654,3 +654,47 @@ pci_device_enable(struct pci_device *dev) if (pci_sys->methods->enable) pci_sys->methods->enable(dev); } + +/** + * Map the legacy memory space for the PCI domain containing \c dev. + * + * \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. + * + * \returns + * Zero on success or an \c errno value on failure. + */ +int +pci_device_map_legacy(struct pci_device *dev, pciaddr_t base, pciaddr_t size, + unsigned map_flags, void **addr) +{ + if (base > 0x100000 || base + size > 0x100000) + return EINVAL; + + if (!pci_sys->methods->map_legacy) + return ENOSYS; + + return pci_sys->methods->map_legacy(dev, base, size, map_flags, addr); +} + +/** + * Unmap the legacy memory space for the PCI domain containing \c dev. + * + * \param dev Device whose memory region is to be unmapped. + * \param addr Location of the mapped address. + * \param size Size of the range to be unmapped. + * + * \returns + * Zero on success or an \c errno value on failure. + */ +int +pci_device_unmap_legacy(struct pci_device *dev, void *addr, pciaddr_t size) +{ + if (!pci_sys->methods->unmap_legacy) + return ENOSYS; + + return pci_sys->methods->unmap_legacy(dev, addr, size); +} diff --git a/src/pciaccess_private.h b/src/pciaccess_private.h index beaeaa7..1653b8b 100644 --- a/src/pciaccess_private.h +++ b/src/pciaccess_private.h @@ -77,6 +77,10 @@ struct pci_system_methods { void (*write16)( struct pci_io_handle *handle, uint32_t reg, uint16_t data ); void (*write8)( struct pci_io_handle *handle, uint32_t reg, uint8_t data ); + + int (*map_legacy)(struct pci_device *dev, pciaddr_t base, pciaddr_t size, + unsigned map_flags, void **addr); + int (*unmap_legacy)(struct pci_device *dev, void *addr, pciaddr_t size); }; struct pci_device_mapping { commit e1a0240a3d6840b497845680c2bf6753415ba20f Author: Alan Coopersmith <alan.coopersm...@oracle.com> Date: Fri Sep 16 22:11:38 2011 -0700 Strip trailing whitespace Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}' git diff -w & git diff -b show no diffs from this change Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> diff --git a/Makefile.am b/Makefile.am index a285275..fc47966 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -# +# # (C) Copyright IBM Corporation 2006 # All Rights Reserved. # diff --git a/configure.ac b/configure.ac index 3c5ab56..caaf358 100644 --- a/configure.ac -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/e1rbg5u-0000rf...@vasks.debian.org