summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-04-03Obtain correct value of is_64 and is_prefetchable PCI device fieldsChester Gillon
Correct setting of the is_64 and is_prefetchable pci_device fields in pci_device_linux_sysfs_probe(). The pci_device struct defines is_64 and is_prefetchable as single bits, but the previous code was attempting to store the result of a bit-masked field in a single bit which always resulted in is_64 and is_prefetchable being zero regardless of the actual capabilities of the PCI device. Fixes: #15 Signed-off-by: Chester Gillon <chester.gillon@metronet.co.uk>
2022-04-02gitlab CI: add a basic build test for both autotools and mesonAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-04-02meson: install man page in mandir/man1/, not mandir/1/Alan Coopersmith
But don't install it by default, since neither meson nor autotools installs the scanpci program by default Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-04-02Fix spelling/wording issuesAlan Coopersmith
Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-04-02Build xz tarballs instead of bzip2Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-03-14Hurd: Fix initialization orderJoan Lledó
This allows non-root programs to to rely on /servers/bus/pci Message-Id: <20220312182804.9318-2-jlledom@mailfence.com> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2022-02-15hurd: Don't necessarily look up _SERVERS_BUS_PCIDamien Zammit
This allows the fallback mechanism in the hurd create method to be used in the map range method by reusing the mach port that corresponds to the root of the pci filesystem. Message-Id: <20220215064411.68671-1-damien@zamaudio.com> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2022-01-09hurd: Restore initialization orderSamuel Thibault
3e0d1cde0187 ("hurd: Implement device memory mapping") was making root-running processes insist on using the pci device, and never try the fs-provided translator. This reverts back to trying the pci device first, but completely, and then revert to the fs-provided translator.
2022-01-08hurd: Implement device memory mappingJoan Lledó
* src/hurd_pci.c: * Implement device memory mapping functions * pci_device_hurd_map_range * pci_device_hurd_unmap_range * pci_device_hurd_map_legacy * pci_device_hurd_unmap_legacy * src/x86_pci.h: * Remove unused declarations * pci_device_x86_map_range() * pci_device_x86_unmap_range() * pci_device_x86_map_legacy() * pci_device_x86_unmap_legacy() * src/x86_pci.c: * Fix port leaks * Make mapping function static again * map_dev_mem(): use device_map() support for offsets Message-Id: <20220105120802.14008-2-jlledom@mailfence.com> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2021-04-13x86: Sort devices by B/D/F due to recursive scanDamien Zammit
2021-04-05hurd: device_open(pci), /servers/bus/pci fallbackDamien Zammit
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2020-12-02missed library installation in mesonPetr Ovtchenkov
Signed-off-by: Petr Ovtchenkov <ptr@void-ptr.info> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2020-11-02autoconf: Add meson files to dist tarballDylan Baker
Reviewed-by: Eric Anholt <eric@anholt.net>
2020-11-02Add a meson build systemDylan Baker
I believe this is correct and complete, but I could have missed something on non-linux OSes. Reviewed-by: Eric Anholt <eric@anholt.net>
2020-09-10hurd: Fix map_dev_mem from non-zero addressSamuel Thibault
device_map needs to create a big-enough object so it can then be mapped. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2020-09-10hurd: Fix letting map_dev_mem map anywhereSamuel Thibault
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2020-09-10hurd: Add missing round up size in map_dev_memSamuel Thibault
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2020-08-27x86: Remove probe during create, other backends don't do thisDamien Zammit
2020-08-27x86: Remove mapping of regions during probe - otherwise remapping later failsDamien Zammit
2020-08-27x86: Use gnumach device instead of /dev/mem on GNU systems && factorise ifdefsDamien Zammit
2020-08-27hurd_pci: Use __pci_conf_ variants of pci_conf_Damien Zammit
2020-08-22pciaccess.pc.in: add Libs.PrivateFabrice Fontaine
Add Libs.Private in pciaccess.pc.in so applications that wants to link statically with pciaccess will know that they have to link with its dependencies such as -lz Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2019-12-27Hurd: avoid using the deprecated RPC pci_get_ndevs()Joan Lledó
2019-07-17libpciaccess 0.16libpciaccess-0.16Adam Jackson
2019-07-12x86: Use MAP_SHARED for memory/rom region mmap && fix modeDamien Zammit
2019-07-11linux: Don't try to include <sys/io.h> on armAdam Jackson
It no longer exists in newer glibc, and didn't work like you'd have hoped on anything but strongarm anyway.
2019-07-11libpciaccess 0.15libpciaccess-0.15Adam Jackson
2019-07-11Fix pci_device_get_bridge_info() for multifunction bridgesLichao Mu
Fixes: xorg/lib/libpciaccess#9
2019-07-11Use recursive scan busDamien Zammit
Switch over to the new recursive scan bus routine for x86 Signed-off-by: Damien Zammit <damien@zamaudio.com>
2019-07-11Add 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-07-11New 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>
2019-07-10freebsd_pci: remove old probe methodNiclas Zeising
Remove the old probe method. The PCIOCGETBAR ioctl has been in FreeBSD since 8.0 release, if not earlier. Remove the old way of doing it. This is done using unifdef -DPCIOCGETBAR and cleaning up whitespace. Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2019-07-10freebsd_pci: format freebsd_pci_methodsNiclas Zeising
Format freebsd_pci_methods a bit, adding some whitespace and assigning NULL to methods not implemented. This makes it easier to see the names of various methods, as well as which methods are not implemented. Idea from src/linux_sysfs.c Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2019-07-10freebsd_pci: Add has_kernel_driver functionNiclas Zeising
Add a has_kernel_driver function to the FreeBSD libpciaccess functions. This uses the PCIOCATTACHED ioctl to check if a driver is attached to a specific PCI device. Idea taken from the FreeBSD system utility pciconf. Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2019-07-10freebsd_pci: Remove unused variableNiclas Zeising
Remove unused variable, it's written to, but never used. Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2019-07-10freebsd_pci: Make this work on sparc64Niclas Zeising
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.
2019-07-10freebsd_pci: update legacy I/O for new architecturesNiclas Zeising
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.
2019-07-10freebsd_pci: Fix types in write functionsNiclas Zeising
Fix the type used in write functions to match the size of the write. Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2019-07-10Don't check for struct pci_io.pi_sel.pc_domainNiclas Zeising
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>
2019-07-10freebsd_pci: Try to conform to uniform styleNiclas Zeising
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>
2019-06-16freebsd: Add !legacy open_device_io implementationConrad Meyer
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>
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>