summaryrefslogtreecommitdiff
path: root/src/x86_pci.c
Commit message (Collapse)AuthorAgeFilesLines
* hurd: Fix pci_device_hurd_map_legacySamuel Thibault2022-08-231-4/+4
| | | | | | | | | | | | It was not passing a proper region number to pci_device_hurd_map_range, and that would not make sense anyway since the rom is not a region for instance, and the video memory, interrupt vector etc. aren't a region or the rom. So this uses pci_device_hurd_map_range for the rom, and pci_system_x86_map_dev_mem for non-rom. Unfortunately pci-arbiter currently cannot get the rom_base from libpciaccess, so we can only guess that we are trying to map a rom.
* hurd: Implement device memory mappingJoan Lledó2022-01-081-9/+14
| | | | | | | | | | | | | | | | | | | | | | * 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>
* x86: Sort devices by B/D/F due to recursive scanDamien Zammit2021-04-131-0/+27
|
* hurd: Fix map_dev_mem from non-zero addressSamuel Thibault2020-09-101-1/+2
| | | | | | 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>
* hurd: Fix letting map_dev_mem map anywhereSamuel Thibault2020-09-101-1/+1
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* hurd: Add missing round up size in map_dev_memSamuel Thibault2020-09-101-1/+6
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* x86: Remove probe during create, other backends don't do thisDamien Zammit2020-08-271-4/+0
|
* x86: Remove mapping of regions during probe - otherwise remapping later failsDamien Zammit2020-08-271-10/+3
|
* x86: Use gnumach device instead of /dev/mem on GNU systems && factorise ifdefsDamien Zammit2020-08-271-42/+87
|
* x86: Use MAP_SHARED for memory/rom region mmap && fix modeDamien Zammit2019-07-121-8/+6
|
* Use recursive scan busDamien Zammit2019-07-111-71/+11
| | | | | | Switch over to the new recursive scan bus routine for x86 Signed-off-by: Damien Zammit <damien@zamaudio.com>
* Add better probe cmds for non-VGA roms and regions on x86Damien Zammit2019-07-111-59/+285
| | | | | | Also add a recursive scan-bus routine that uses the new probe cmds. Signed-off-by: Damien Zammit <damien@zamaudio.com>
* New module for the HurdDamien Zammit2019-07-111-149/+215
| | | | | | | | | | | | | 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>
* linux: support 32 bit PCI domains (v3)Stephen Hemminger2017-09-201-1/+1
| | | | | | | | | | | | | | | | | | | | | 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>
* Include config.h before anything else in *.cJulien Cristau2015-05-011-1/+3
| | | | | | | | 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>
* Fix IO access functions on linux+sysfs.baserock/morphMarcin Ko?cielnicki2014-02-111-0/+1
| | | | | | | 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-271-2/+173
| | | | | | | | | 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>
* Implement legacy io & map for x86 backendSamuel Thibault2012-05-311-1/+99
| | | | | | | Add the legacy io and map methods for the x86 backend, using ioperm, in/out, and the existing mmap method. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* Use O_CLOEXEC for internal file descriptorsAdam Jackson2012-02-271-2/+2
| | | | | | | | Well, almost all of them. zlib doesn't support "e" in the mode string in gzopen() though it will silently accept and ignore it, and Solaris appears not to support "e" in the mode string at all. Signed-off-by: Adam Jackson <ajax@redhat.com>
* libpciaccess x86 backendSamuel Thibault2010-02-101-0/+669
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>