summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* freebsd_pci: Make this work on sparc64Niclas Zeising2019-07-103-9/+42
| | | | | | | | | Make the FreeBSD libpciaccess routines work on FreeBSD. The FreeBSD sparc64 architecture needs special treatment, similar to the PCI_MAGIC_IO_RANGE code. However, PCI_MAGIC_IO_RANGE has been gone for some time. Give this a chance to work on sparc64 anyway. This code has been in the FreeBSD ports tree for some time.
* freebsd_pci: update legacy I/O for new architecturesNiclas Zeising2019-07-101-35/+50
| | | | | | | | | | Update FreeBSD legacy I/O routines for new architectures. When we're not on amd64 or i386, and PCI_MAGIC_IO_RANGE is not defined, use IOCTLs to handle reads and writes through /dev/io. This is accomplished by opening /dev/io and using IOCTLs from dev/io/iodev.h, an interface that exists on most FreeBSD architectures. This change has been in the FreeBSD ports tree for quite some time.
* freebsd_pci: Fix types in write functionsNiclas Zeising2019-07-101-3/+3
| | | | | | Fix the type used in write functions to match the size of the write. Signed-off-by: Niclas Zeising <zeising@daemonic.se>
* Don't check for struct pci_io.pi_sel.pc_domainNiclas Zeising2019-07-102-18/+0
| | | | | | | | | | | | Autoconf has a check that pci_io.pi_sel.pc_domain exists. This is only used on FreeBSD. pc_domain was added to pci_io.pi_sel on FreeBSD many many releases ago, and exists on all current FreeBSD releases. Remove the check, and the corresponding HAVE_PCI_IO_PC_DOMAIN, and update the code to take into account that #ifdef HAVE_PCI_IO_PC_DOMAIN is now always true. Signed-off-by: Niclas Zeising <zeising@daemonic.se>
* freebsd_pci: Try to conform to uniform styleNiclas Zeising2019-07-101-79/+81
| | | | | | | Try to make freebsd_pci.c conform to a more uniform style. This change is whitespace only, no functional change intended. Signed-off-by: Niclas Zeising <zeising@daemonic.se>
* freebsd: Add !legacy open_device_io implementationConrad Meyer2019-06-161-0/+12
| | | | | | | | | | | Some drivers, such as QXL, rely on this method and do not check for errors when it is unavailable. FreeBSD's legacy method can enumerate any d/b/s/f just fine, so it should be adequate for the !legacy API, as far as I can tell. With this change, QXL doesn't crash on startup on FreeBSD. Signed-off-by: Conrad Meyer <cem@FreeBSD.org>
* Update configure.ac bug URL for gitlab migrationAlan Coopersmith2018-12-071-1/+1
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Update README for gitlab migrationAlan Coopersmith2018-11-193-35/+30
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* linux: Set number of devices to 0 in case of errorOlivier Fourdan2018-10-241-0/+1
| | | | | | | | | | | | | | 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>
* libpciaccess 0.14libpciaccess-0.14Adam Jackson2017-10-231-1/+1
| | | | Signed-off-by: Adam Jackson <ajax@redhat.com>
* linux: support 32 bit PCI domains (v3)Stephen Hemminger2017-09-206-15/+40
| | | | | | | | | | | | | | | | | | | | | 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>
* libpciaccess 0.13.5libpciaccess-0.13.5Emil Velikov2017-04-041-1/+1
| | | | Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
* configure.ac: set AC_CONFIG_AUX_DIREmil Velikov2017-04-041-0/+1
| | | | | | | | | | | | | | | | 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>
* configure.ac: remove AC_CONFIG_SRCDIR macroEmil Velikov2017-04-041-1/+0
| | | | | | | | | | | | | | 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>
* use cached devinfo snapshots, remove unnecessary di_init()Henry Zhao2017-04-041-20/+5
| | | | | | | | 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>
* probe should not hold pci nexus drivers openHenry Zhao2017-04-041-9/+20
| | | | | | | 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>
* Revert "linux_sysfs: include <limits.h> for PATH_MAX"Emil Velikov2017-04-041-1/+0
| | | | | | | | This reverts commit 8ea3af620a2d4ad5648917b4a0ef2b23ff566774. The include was added with 6bd2f7f92eae713663f4e13f6e2cb23526607b8c Cc: Adam Jackson <ajax@redhat.com>
* autogen: add default patch prefixMihail Konev2017-01-261-0/+3
| | | | Signed-off-by: Mihail Konev <k.mvc@ya.ru>
* autogen.sh: use quoted string variablesEmil Velikov2017-01-261-3/+3
| | | | | | | | | 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>
* autogen.sh: use exec instead of waiting for configure to finishPeter Hutterer2017-01-261-1/+1
| | | | | | | 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>
* linux sysfs: retrieve vendor, device... info via separate sysfs filesEmil Velikov2017-01-111-0/+54
| | | | | | | | | | | | 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>
* Ignore 32-bit domainsKeith Busch2016-08-151-2/+12
| | | | | | | | | | | | 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>
* device-name: handle calloc failure in insert()arsharma2016-05-021-0/+10
| | | | | | | | | | | 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>
* vgaarb: add a the trailing NULL character on read(vgaarb_fd)arsharma2016-05-021-3/+9
| | | | | | | | | 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>
* libpciaccess: Fix incorrect format specificationChuck Tuffli2015-10-201-4/+4
| | | | | | | | | | | | | | | 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>
* linux_sysfs: include <limits.h> for PATH_MAXFelix Janda2015-09-221-0/+1
| | | | | Signed-off-by: Felix Janda <felix.janda@posteo.de> Tested-by: Bernd Kuhls <bernd.kuhls@t-online.de>
* autogen.sh: pass --force to autoreconf, quote string variablesEmil Velikov2015-09-221-2/+2
| | | | | | | | | | | | 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>
* chmod a-x README.cygwinAdam Jackson2015-09-221-0/+0
| | | | Signed-off-by: Adam Jackson <ajax@redhat.com>
* linux_sysfs.c: Include <limits.h> for PATH_MAXFelix Janda2015-05-041-0/+1
| | | | | | | | | 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>
* Fix quoting issue.Thomas Klausner2015-05-021-1/+1
| | | | | | | | | | 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>
* Include config.h before anything else in *.cJulien Cristau2015-05-0111-3/+33
| | | | | | | | 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>
* libpciaccess 0.13.4libpciaccess-0.13.4Alan Coopersmith2015-04-301-1/+1
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Bug 89151: Fix build on NetBSD/alpha and NetBSD/sparc64.Tobias Nygren2015-02-161-2/+6
| | | | | | | | | | | | 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>
* Check for __linux__ instead of linux during compilationEero Tamminen2015-02-121-1/+3
| | | | | | | | | | | | | | | | "__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>
* Include config.h before any other headers.Emil Velikov2015-02-124-16/+16
| | | | | | | | | 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>
* Add missing guards around config.h inclusionChih-Wei Huang2015-02-123-0/+8
| | | | | | | | | | | 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>
* Include the POSIX fcntl.h instead of sys/fcntl.hEmil Velikov2015-02-121-1/+1
| | | | | | | | | | | | 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>
* libpciaccess 0.13.3libpciaccess-0.13.3Alan Coopersmith2015-02-031-1/+1
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Use PCIOCREADMASK on OpenBSD.Mark Kettenis2014-09-291-6/+25
| | | | | | | | | | | 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>
* Implement the kernel_has_driver() method for NetBSD.Matthew Green2014-08-301-0/+24
| | | | | | | | | 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>
* Solaris: Fix fd leak in pci_device_solx_devfs_map_range()Alan Coopersmith2014-07-031-0/+3
| | | | | | | | | | | 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>
* Enable use of __attribute__((deprecated)) with Solaris Studio 12.4 compilerAlan Coopersmith2014-05-311-1/+1
| | | | | | Support for this attribute is added in the 12.4 beta release. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Fix IO access functions on linux+sysfs.Marcin Ko?cielnicki2014-02-117-18/+54
| | | | | | | 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>
* Fix a compilation error on GNU Hurd platforms.Samuel Pitoiset2014-01-311-1/+1
| | | | | | | This fixes a typo (unAMp instead of unMAp) introduced in the Windows/Cygwin support patch. Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Windows/Cygwin: Add support through the WinIo librarySamuel Pitoiset2014-01-276-4/+210
| | | | | | | | | 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>
* Improve NetBSD i386 detection.Thomas Klausner2013-11-221-1/+1
| | | | | | | | | | 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>
* Fix zlib handling on NetBSD.Thomas Klausner2013-07-211-2/+2
| | | | | | 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>
* libpciaccess 0.13.2libpciaccess-0.13.2Alan Coopersmith2013-07-201-1/+1
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Fix Sun bug #7035791: scanpci should report 64 bit registersJohn Martin2013-07-201-2/+4
| | | | | | | | | | | | | | | | | | 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>
* Resync COPYING file with copyrights/licenses from codeAlan Coopersmith2013-07-201-3/+33
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>