summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-05-19x86: Use MAP_SHARED for memory/rom region mmap && fix modehurd-upstreamDamien Zammit
2019-04-06Use recursive scan busDamien Zammit
Switch over to the new recursive scan bus routine for x86 Signed-off-by: Damien Zammit <damien@zamaudio.com>
2019-04-06Add better probe cmds for non-VGA roms and regions on x86Damien Zammit
Also add a recursive scan-bus routine that uses the new probe cmds. Signed-off-by: Damien Zammit <damien@zamaudio.com>
2019-04-06New module for the HurdDamien Zammit
This new module uses Hurd's RPCs for accessing the PCI configuration space. Direct access as in {read_write}_{8,16,32} functions is done by the old x86 module. Some x86 function prototypes are now declared in a new header for the Hurd module to use them, in order to duplicate as little code as possible. Author: Joan Lledó <joanlluislledo@gmail.com> Also-by: Damien Zammit <damien@zamaudio.com> Signed-off-by: Damien Zammit <damien@zamaudio.com>
2018-12-07Update configure.ac bug URL for gitlab migrationAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-19Update README for gitlab migrationAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-10-24linux: Set number of devices to 0 in case of errorOlivier Fourdan
pci_sys is a global variable which is populated on init, and in case of error reading sysfs on Linux, the devices are NULL, but the number of devices is left unchanged. As a result, we may crash in `pci_device_next()` which relies on the number of devices. To fix the issue, simply reset the number of devices to zero in case of error so we don't try to access indices of a NULL array later on. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2017-10-23libpciaccess 0.14libpciaccess-0.14Adam Jackson
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-09-20linux: support 32 bit PCI domains (v3)Stephen Hemminger
The PCI domain may be larger than 16 bits on Microsoft Azure and other virtual environments. PCI busses reported by ACPI are limited to 16 bits, but in Azure the domain value for pass through devices is intentionally larger than 16 bits to avoid clashing with local devices. This is needed to support pass through of GPU devices. v3: (ajax) Update FreeBSD and Solaris backends to preserve the full 32-bit domain number, since on those OSes it stands a chance of working already. Update NetBSD and OpenBSD backends to initialize domain_16 compatibly with older libpciaccess; neither backend appears to support more than a handful of domains to begin with though. Trivially update the generic x86 backend for source compatibility, though it still only supports one domain and will never be better. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=101744 Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-04-04libpciaccess 0.13.5libpciaccess-0.13.5Emil Velikov
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-04-04configure.ac: set AC_CONFIG_AUX_DIREmil Velikov
If not set, libtool will search directories up to ../.. for an install-sh and then dump the aux files there. This caused a couple of problems with the xorg release.sh script that now uses worktrees but is generally bad behaviour because we can't guarantee that we're not inside some other repository. Set AC_CONFIG_AUX_DIR to avoid this behavior. See https://lists.freedesktop.org/archives/xorg-devel/2017-March/053006.html Note: the commit and above message are shamelessly copied from libinput. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-04-04configure.ac: remove AC_CONFIG_SRCDIR macroEmil Velikov
It is used to guide people who incorrectly set configure --srcdir. To be actually useful the macro should point to a rather unique file - which in our current case is a false premise. We have five Makefile.am in-tree and chances are that $libpciaccess/.. may also contain such a file. Let's not pretend that its useful and leave the user to what they're asking for. Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-04-04use cached devinfo snapshots, remove unnecessary di_init()Henry Zhao
Use cached devinfo (DINFOCACHE) in di_init(). Remove unnecessary di_init() on nexus nodes. Signed-off-by: Henry Zhao <henry.zhao@oracle.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-04-04probe should not hold pci nexus drivers openHenry Zhao
Probe should not hold pci nexus drivers open - close after use. Signed-off-by: Henry Zhao <henry.zhao@oracle.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-04-04Revert "linux_sysfs: include <limits.h> for PATH_MAX"Emil Velikov
This reverts commit 8ea3af620a2d4ad5648917b4a0ef2b23ff566774. The include was added with 6bd2f7f92eae713663f4e13f6e2cb23526607b8c Cc: Adam Jackson <ajax@redhat.com>
2017-01-26autogen: add default patch prefixMihail Konev
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-26autogen.sh: use quoted string variablesEmil Velikov
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent fall-outs, when they contain space. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26autogen.sh: use exec instead of waiting for configure to finishPeter Hutterer
Syncs the invocation of configure with the one from the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-01-11linux sysfs: retrieve vendor, device... info via separate sysfs filesEmil Velikov
Currently the kernel does not expose the revision file. With that about to change (due in 4.10) we can read all the information required from separate files and avoid opening the config one. The latter has the [negative] side effect of waking up the device, which in some cases can be quite costly. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-08-15Ignore 32-bit domainsKeith Busch
A pci "domain" need not be limited to the 16-bits. The Linux kernel currently supports 32-bit domains which cause startx to segfault. Updating libpciaccess to support 32-bit domains breaks the library's ABI, and domains requiring 32-bits are not necessary for startx anyway, so this patch ignores them. Reported-by: Pawel Baldysiak <pawel.baldysiak@intel.com> Signed-off-by: Keith Busch <keith.busch@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2016-05-02device-name: handle calloc failure in insert()arsharma
Issue was spotted by Klocwork, and fixed by arsharma as part of Android-ia. Just bail out if memory allocation fails. All the callers of insert() already handle the case. [Emil Velikov: Split from larger patch, write commit message] Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-05-02vgaarb: add a the trailing NULL character on read(vgaarb_fd)arsharma
Issue was spotted by Klocwork, and fixed by arsharma as part of Android-ia. Not 100% sure if the data read from /dev/vga_arbiter is not already null terminated, but making sure won't hurt either. [Emil Velikov: Split from larger patch, write commit message] Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-10-20libpciaccess: Fix incorrect format specificationChuck Tuffli
Building libpciaccess generates a warning on versions of Linux in which the definition of the struct mtrr_sentry has changed to __u64. Since sentry.base is assigned from a pciaddr_t, always cast sentry.base to be type pciaddr_t and modify the formatting string to use PRIx64 instead of %08lx Verified on Ubuntu 10.04 and 14.04 Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=74643 Signed-off-by: Chuck Tuffli <chuck@tuffli.net>
2015-09-22linux_sysfs: include <limits.h> for PATH_MAXFelix Janda
Signed-off-by: Felix Janda <felix.janda@posteo.de> Tested-by: Bernd Kuhls <bernd.kuhls@t-online.de>
2015-09-22autogen.sh: pass --force to autoreconf, quote string variablesEmil Velikov
By passing --force autoreconf will update all the aux files, which would otherwise be ignored if one updates autoconf/automake. Quote the $srcdir, $ORIGDIR and $0 variables to prevent fall-outs, when it contains space. v2: Also handle $srcdir and $0. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-09-22chmod a-x README.cygwinAdam Jackson
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-05-04linux_sysfs.c: Include <limits.h> for PATH_MAXFelix Janda
Fixes compilation with musl libc. Tested-by: Bernd Kuhls <bernd.kuhls@t-online.de> Signed-off-by: Felix Janda <felix.janda@posteo.de> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-05-02Fix quoting issue.Thomas Klausner
m4 has '[]' as quoting characters, so if we want '[]' to end up in the configure script, we need to quote them again. Reported by Greg Troxel <gdt@ir.bbn.com>. Signed-off-by: Thomas Klausner <wiz@NetBSD.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-05-01Include config.h before anything else in *.cJulien Cristau
Debian bug#749008 <https://bugs.debian.org/749008> Reported-by: Michael Tautschnig <mt@debian.org> Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-04-30libpciaccess 0.13.4libpciaccess-0.13.4Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-02-16Bug 89151: Fix build on NetBSD/alpha and NetBSD/sparc64.Tobias Nygren
This patch is required for building on NetBSD/alpha (needs platform specific -lalpha) and NetBSD/sparc64 (no platform specific library, just -lpci). The patch also generalizes to support all NetBSD platforms with pci bus. https://bugs.freedesktop.org/show_bug.cgi?id=89151 Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
2015-02-12Check for __linux__ instead of linux during compilationEero Tamminen
"__linux__" is the POSIX define for checking for Linux OS, "linux" is deprecated and apparently not supported by Android. Besides correcting the define, patch adds error for the case OS isn't recognized. Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com> v2: Drop double negative from commit msg. Spotted by Mateusz Jończyk. [Emil Velikov: Remove irrelevant Android details from commit msg.] Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-02-12Include config.h before any other headers.Emil Velikov
The former has a series of defines which in some cases are crusial to be set before including any system headers. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-02-12Add missing guards around config.h inclusionChih-Wei Huang
In some cases the header may not exist, leading to compilation issues. Add the ifdef HAVE_CONFIG_H, as it is those in other parts of the project. [Emil Velikov: Split out from a larger commit, rework commit message] Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-02-12Include the POSIX fcntl.h instead of sys/fcntl.hEmil Velikov
The former is part of the POSIX standard, and (unlike the latter) is more widely available. v2: Drop gracious d in header name. Spotted by Alan. Cc: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-02-03libpciaccess 0.13.3libpciaccess-0.13.3Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-09-29Use PCIOCREADMASK on OpenBSD.Mark Kettenis
If the machdep.allowaperture sysctl(8) variable is set to 0, writing to PCI config space is not allowed. So instead of writing 0xffffffff to the BARs in order to determine their size, use the PCIOCREADMASK ioctl(2) which returns the mask of changeable bits that was saved by the kernel when the devices was initially probed. Reviewed-by: Matthieu Herrb <matthieu@herbb.eu> Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
2014-08-30Implement the kernel_has_driver() method for NetBSD.Matthew Green
This has the benefit of stopping the "vesa" driver from loading on hardware that has been claimed by a kernel driver and thus shouldn't be using "vesa". Reviewed-by: Matthieu Herrb <matthieu@herrb.eu> Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
2014-07-03Solaris: Fix fd leak in pci_device_solx_devfs_map_range()Alan Coopersmith
Caching fd's for reuse is most effective when you actually stick the newly opened fd in the cache, instead of letting it leak at the end of the function. Regression introduced by yours truly in commit 9f2d95e61896f41adb. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Randy Fishel <randy.fishel@oracle.com>
2014-05-31Enable use of __attribute__((deprecated)) with Solaris Studio 12.4 compilerAlan Coopersmith
Support for this attribute is added in the 12.4 beta release. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-02-11Fix IO access functions on linux+sysfs.Marcin Ko?cielnicki
The offsets on the resourceX files are relative to BAR base - don't add the base address ourselves. Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-31Fix a compilation error on GNU Hurd platforms.Samuel Pitoiset
This fixes a typo (unAMp instead of unMAp) introduced in the Windows/Cygwin support patch. Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-01-27Windows/Cygwin: Add support through the WinIo librarySamuel Pitoiset
V2: - Add support for unmapping - Add a README.cygwin Reviewed-by: Martin Peres <martin.peres@free.fr> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2013-11-22Improve NetBSD i386 detection.Thomas Klausner
Sometimes, other values are reported for the CPU part, like "i486--netbsdelf"). From: Mark Davies <markd@NetBSD.org> Signed-off-by: Thomas Klausner <wiz@NetBSD.org> Reviewed-By: Matt Dew <marcoz@osource.org> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-21Fix zlib handling on NetBSD.Thomas Klausner
Signed-off-by: Thomas Klausner <wiz@NetBSD.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-20libpciaccess 0.13.2libpciaccess-0.13.2Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-20Fix Sun bug #7035791: scanpci should report 64 bit registersJohn Martin
On a system which has allocated 64-bit device addresses scanpci -v will show entries such as: [...] BASE0 0xce000000 SIZE 16777216 MEM BASE1 0x00000fc1f8000000 SIZE 134217728 MEM64 PREFETCHABLE BASE3 0x00000fc1f6000000 SIZE 33554432 MEM64 PREFETCHABLE [...] instead of: [...] BASE0 0xce000000 SIZE 16777216 MEM BASE1 0xf8000000 SIZE 134217728 MEM PREFETCHABLE BASE3 0xf6000000 SIZE 33554432 MEM PREFETCHABLE [...] Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-20Resync COPYING file with copyrights/licenses from codeAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-06pci_device_solx_devfs_probe: implicit conversion changes signedness warningsAlan Coopersmith
solx_devfs.c:615:32: warning: implicit conversion changes signedness: 'unsigned long' to 'int' [-Wsign-conversion] for (i = 0; i < len; i = i + CELL_NUMS_1275) { ~ ~~^~~~~~~~~~~~~~~~ solx_devfs.c:615:30: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion] for (i = 0; i < len; i = i + CELL_NUMS_1275) { ^ ~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-06Solaris: Remove #defines for Ultra 45 southbridge device idsAlan Coopersmith
Workaround for these chipsets was removed in commit d76fb36d9c28be0f7c with the switch of probing methods from the PCI address poking that upset them to using the already collected data from the kernel via devinfo, but the #define to identify them was left behind unused - remove it too. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>