Age | Commit message (Collapse) | Author |
|
|
|
It no longer exists in newer glibc, and didn't work like you'd have
hoped on anything but strongarm anyway.
|
|
Fixes: xorg/lib/libpciaccess#9
|
|
Switch over to the new recursive scan bus routine for x86
Signed-off-by: Damien Zammit <damien@zamaudio.com>
|
|
Also add a recursive scan-bus routine that uses the new probe cmds.
Signed-off-by: Damien Zammit <damien@zamaudio.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Remove unused variable, it's written to, but never used.
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
|
|
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.
|
|
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.
|
|
Fix the type used in write functions to match the size of the write.
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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 open - close after use.
Signed-off-by: Henry Zhao <henry.zhao@oracle.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
|
|
This reverts commit 8ea3af620a2d4ad5648917b4a0ef2b23ff566774.
The include was added with 6bd2f7f92eae713663f4e13f6e2cb23526607b8c
Cc: Adam Jackson <ajax@redhat.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Felix Janda <felix.janda@posteo.de>
Tested-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
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>
|
|
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>
|
|
"__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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
This fixes a typo (unAMp instead of unMAp) introduced in the Windows/Cygwin
support patch.
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
|
|
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>
|
|
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>
|
|
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>
|
|
Fixes:
solx_devfs.c:824:19: warning: comparison of integers of different signs: 'int' and 'pciaddr_t' (aka 'unsigned long') [-Wsign-compare]
for (i = 0; i < size; i += PCITOOL_ACC_ATTR_SIZE(PCITOOL_ACC_ATTR_SIZE_1))
~ ^ ~~~~
solx_devfs.c:826:28: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion]
cfg_prg.offset = offset + i;
~ ^
solx_devfs.c:844:19: warning: implicit conversion changes signedness: 'int' to 'pciaddr_t' (aka 'unsigned long') [-Wsign-conversion]
*bytes_read = i;
~ ^
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Fixes build on NetBSD-5.
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Clears up gcc warning on Solaris:
common_device_name.c: In function 'pci_id_file_open':
common_device_name.c:83:17: warning: unused variable 'result' [-Wunused-variable]
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Michael Lorenz <macallan@NetBSD.org>
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
https://bugs.freedesktop.org/show_bug.cgi?id=63583
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Jung-uk Kim <jkim@FreeBSD.org>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|