summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-02-27linux: Don't use /dev/portAdam Jackson1-13/+50
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-02-24Use correct type for pci_id file accessor functionsMathias Krause1-2/+2
This fixes the compiler warning of using the wrong type for gzgets() and gzclose() as they want a gzFile argument, not a pointer to gzFile. The abstraction layer pci_id_file should just abstract the full type. Signed-off-by: Mathias Krause <mathias.krause@secunet.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-02-08solx_devfs.c: fix gcc warnings about casting away const when reading dataAlan Coopersmith1-4/+4
solx_devfs.c: In function `pci_device_solx_devfs_write': solx_devfs.c:1085: warning: cast discards qualifiers from pointer target type solx_devfs.c:1089: warning: cast discards qualifiers from pointer target type solx_devfs.c:1093: warning: cast discards qualifiers from pointer target type solx_devfs.c:1097: warning: cast discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-02-08Close pci.ids file when bailing out because realloc failedAlan Coopersmith1-1/+2
Error: File Leak Leaked File f at line 272 of src/common_device_name.c in function 'populate_vendor'. f initialized at line 204 with fopen("/usr/share/hwdata/pci.ids", "r"). [ This bug was found by the Parfait 0.5.0 bug checking tool. For more information see http://labs.oracle.com/projects/parfait/ ] Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-02-08Solaris: reorder functions to remove need for lots of static prototypesAlan Coopersmith1-201/+174
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-01-03OpenBSD: Implement map_legacy and legacy_ioMark Kettenis2-2/+152
Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-11-28delete_io_handle: fix deletion of last handleDaniel Drake1-3/+8
When num_ios goes from 1 to 0, a realloc(ios, 0); call is made. This is equivalent to free(ios) and NULL is returned. However, the previous logic in the code incorrectly discards this NULL return value. When we next call new_io_handle(), realloc(ios, X) is called with "ios" pointing to freed memory. This causes glibc to abort. Correct this logic to detect the 1-to-0 case and handle it correctly. Other cases are unchanged; there is still value in checking the return value from realloc() as it also returns NULL on error. Signed-off-by: Daniel Drake <dsd@laptop.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-11-19Add VGA Arbiter support for OpenBSD.Mark Kettenis2-5/+139
Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-11-19OpenBSD: Indicate that devices need access to legacy VGA resources.Mark Kettenis1-0/+4
Makes sure xserver disables DRI if the VGA arbiter is in use. Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-11-17Solaris: improve support for sparc platformHenry Zhao1-48/+217
(1) added prom property retrieval on sparc (2) added multiple domain support on sparc (3) use kernel device as mapping device (4) performance improvements by removing redundant ioctl Signed-off-by: Henry Zhao <henry.zhao@oracle.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-11-09configure.ac: Bump to 0.12.902libpciaccess-0.12.902Jeremy Huddleston1-1/+1
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-09Fix some -Wformat errors in scanpciJeremy Huddleston1-6/+7
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-24libpciaccess: close mtrr fd on pci_cleanupNithin Nayak Sujir1-1/+11
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 <nsujir@broadcom.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-14Solaris: Give better error on realloc failureAlan Coopersmith1-2/+3
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.coopersmith@oracle.com> Reviewed-by: Dirk Wallenstein <halsmit@t-online.de> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2011-10-11linux sysfs: Fix read-write access in map_legacyJeremy Huddleston1-1/+1
O_RDONLY | O_WRONLY != O_RDWR >< Reported-by: Javier Pello <javier.pello@urjc.es> Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-09scanpci: Build fix for systems without <err.h>Jeremy Huddleston2-1/+21
https://bugs.freedesktop.org/show_bug.cgi?id=31133 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-07configure.ac: Bump version to 0.12.901libpciaccess-0.12.901Jeremy Huddleston1-1/+1
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-07Update library version to reflect new APIJeremy Huddleston1-1/+1
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-07linux: Implement map_legacyAdam Jackson1-0/+52
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-07Add map_legacy interfaceAdam Jackson3-0/+56
This allows platforms to hand back mmaps of the low 1M (ISA) address space on a per-domain basis. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-16Strip trailing whitespaceAlan Coopersmith18-632/+632
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.coopersmith@oracle.com>
2011-08-03linux: Fix a crash in populate_devicesAdam Jackson1-1/+1
If scandir returns -1, the 'devices' array won't be initialized, and attempting to free() it will crash. Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-04linux: Only set errno after an errorChris Wilson1-2/+6
errno is only valid after an error, and was being filled with a garbage value upon eof. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-30Solaris support for multiple PCI segments (domains)John Martin2-63/+89
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.Martin@Oracle.COM> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-02-03config: comment, minor upgrade, quote and layout configure.acGaetan Nadon1-36/+34
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 <memsize@videotron.ca>
2011-02-02libpciaccess 0.12.1libpciaccess-0.12.1Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-01-28config: replace deprecated AC_HELP_STRING with AS_HELP_STRINGGaetan Nadon1-2/+2
This silences an Automake warning. Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-01-13config: remove AC_PROG_CC as it overrides AC_PROG_C_C99Alan Coopersmith1-1/+0
XORG_STRICT_OPTION from XORG_DEFAULT_OPTIONS calls AC_PROG_C_C99. This sets gcc with -std=gnu99. If AC_PROG_CC macro is called afterwards, it resets CC to gcc. Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-01-13config: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERSAlan Coopersmith1-3/+8
Regroup AC statements under the Autoconf initialization section. Regroup AM statements under the Automake initialization section. Add missing AC_CONFIG_SRCDIR Replace obsolete argument to AC_OUTPUT with AC_CONFIG_FILES Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-12-14Fix detection of multi-function cardsBryce Harrington1-2/+2
Bit 7 of the pci device header type is an indicator of multi-function devices, so needs to be masked when examining the bridge type. Thanks go to Chih-Pin Wu for finding the bug and its fix. https://bugs.launchpad.net/ubuntu/+source/libpciaccess/+bug/681207 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Bryce Harrington <bryce@canonical.com>
2010-12-06Revert "Don't try to use bogus bridge data"Jesse Barnes1-4/+0
This reverts commit 2bda5b733bb12854760750c08138db95e77aea0c. It actually conflicts with 9ba94caf57e3a8c3e9c6f3f5f068f4a7a7b3ff9d which came earlier, but I didn't catch it probably because I did a blind rebase before pushing. When reading bridge bus info, we may need to read out the current bridge info if the PCI bridge private is uninitialized, so remove the check at the top that would always short circuit the case where the priv was still 0. References: https://bugs.launchpad.net/ubuntu/+source/libpciaccess/+bug/681207. Reported-by: Bryce Harrington <bryce@canonical.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-11-21Sun's copyrights belong to Oracle nowAlan Coopersmith3-3/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-10-15config: use LDADD to obtain appropriate dependenciesGaetan Nadon1-1/+1
In generated scanpci/Makefile, this line is added: scanpci_DEPENDENCIES = $(top_builddir)/src/libpciaccess.la If the content of the library changes, the tool will rebuild. When scanpci was in the same directory as the library, the .la file was used. This will also ensure the "installed" pciaccess library is not used. Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-10-03include: add a Makefile to install and distribute header fileGaetan Nadon4-6/+3
Makefiles are simpler when they only handle what is in their directory. Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-10-03config: replace INCLUDES, which is deprecated, with AM_CPPFLAGSGaetan Nadon1-2/+1
Fixes an Automake warning. Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-10-03config: provide a makefile for scanpci man pagesGaetan Nadon4-7/+41
Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-10-03scanpci.c: remove offending whitespace as reported by git diffGaetan Nadon1-5/+5
Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-10-03config: provide a makefile for scanpci dev toolGaetan Nadon7-8/+34
No function changes. Note that automake generates a wrapper script if libpciaccess is not installed at configuration time, which is the most common case. If it is installed at configuration time, you get an executable. The makefile build order ensures the lib is build before scanpci. Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-08-21config: upgrade AC_DEFINE_DIR to AX_DEFINE_DIRGaetan Nadon2-15/+15
Use the latest version now hosted by GNU. The renaming protects Autoconf namespace. There is no functional change in the macro. Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-07-21libpciaccess 0.12.0 - bump version for releaselibpciaccess-0.12.0Dave Airlie1-1/+1
2010-07-21Fix long standing MTRR bug.Thomas Hellstrom1-0/+1
Add an include that makes the file common_vgaarb.c see the same struct pci_system as the file linux_sysfs.c. Without this fix, on a MTRR system, the vgaarb_fd member would overwrite the mtrr_fd member and cause the MTRR_IOC_ADD_ENTRY call to be issued to the incorrect device causing the infamous "Inappropriate ioctl for device (25)" error. This error would cause MTRR setup to fail on all systems relying on it and is severe enough to warrant a new release. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-07-12pciaccess: fix use after free.Dave Airlie1-2/+2
Using the pointer passed to realloc earlier isn't a recipe for success. Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-06-19Let libtool handle library flags for scanpci on SolarisAlan Coopersmith1-5/+1
Stop hardcoding -ldevinfo since configure/libtool already know to add it for static linking, and ELF dependencies handle it for dynamic linking Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-06-16vgaarb: read back vga count when setting new decodingTiago Vignatti1-0/+7
Decode kernel operation can also change vga refcount, so we need to read back the information when calling it. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-06-16vgaarb: decode should send new information to the kernelTiago Vignatti1-1/+1
This was introduced in e360c11c. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-06-04Delay allocation of agp_info so we don't leak it on prior errorsAlan Coopersmith1-6/+6
Memory leak of pointer 'agp_info' at line 119 of src/common_capability.c in function 'pci_fill_capabilities_generic'. 'agp_info' allocated at line 107 with calloc(1, 12). 'agp_info' leaks when err != 0 at line 118. at line 124 of src/common_capability.c in function 'pci_fill_capabilities_generic'. 'agp_info' allocated at line 107 with calloc(1, 12). 'agp_info' leaks when err != 0 at line 123. [ This bug was found by the Parfait bug checking tool. For more information see http://research.sun.com/projects/parfait ] Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-03-29config: update AC_PREREQ statement to 2.60Gaetan Nadon1-1/+1
Unrelated to the previous patches, the new value simply reflects the reality that the minimum level for autoconf to configure all x.org modules is 2.60 dated June 2006. ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-03-29config: remove the pkgconfig pc.in file from EXTRA_DISTGaetan Nadon1-1/+1
Automake always includes it in the tarball. Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-02-10libpciaccess x86 backendSamuel Thibault5-0/+680
This adds support on x86 for OSes that do not have a PCI interface, tinkering with I/O ports, and makes use of it on GNU/Hurd. Signed-off-by: Julien Cristau <jcristau@debian.org>
2010-01-17COPYING: add Red Hat's copyright noticeJulien Cristau1-0/+1