diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-08-23 19:27:27 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-08-23 19:27:27 +0200 |
commit | d193fa690415333420b435edb5782789a6f3ea57 (patch) | |
tree | 3dc441811f7b2cfc3e95458d33b0843c0af95ee0 /src/x86_pci.c | |
parent | 361356b08003f5e3c606e16eeb6a17fe02ff2726 (diff) |
hurd: Fix pci_device_hurd_map_legacy
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.
Diffstat (limited to 'src/x86_pci.c')
-rw-r--r-- | src/x86_pci.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/x86_pci.c b/src/x86_pci.c index 86be0e7..dfe3fa3 100644 --- a/src/x86_pci.c +++ b/src/x86_pci.c @@ -240,8 +240,8 @@ sort_devices(void) #include <device/device.h> #endif -static int -map_dev_mem(void **dest, size_t mem_offset, size_t mem_size, int write) +int +pci_system_x86_map_dev_mem(void **dest, size_t mem_offset, size_t mem_size, int write) { #if defined(__GNU__) int err; @@ -543,7 +543,7 @@ pci_device_x86_read_rom(struct pci_device *dev, void *buffer) struct pci_device_private *d = (struct pci_device_private *)dev; int err; - if ( (err = map_dev_mem(&bios, d->rom_base, dev->rom_size, 0)) ) + if ( (err = pci_system_x86_map_dev_mem(&bios, d->rom_base, dev->rom_size, 0)) ) return err; memcpy(buffer, bios, dev->rom_size); @@ -918,7 +918,7 @@ pci_device_x86_map_range(struct pci_device *dev, struct pci_device_mapping *map) { int err; - if ( (err = map_dev_mem(&map->memory, map->base, map->size, + if ( (err = pci_system_x86_map_dev_mem(&map->memory, map->base, map->size, map->flags & PCI_DEV_MAP_FLAG_WRITABLE))) return err; |