summaryrefslogtreecommitdiff
path: root/src/x86_pci.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-09-10 00:20:33 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-09-10 00:26:35 +0200
commit1ebcfe918a0da46a5b7ab44fc3ec0e6c65f98043 (patch)
treef597939c1042011fc9dbbce0be8c5f37693df3c6 /src/x86_pci.c
parentb82b779247b2adb164afed85a7e06cf3ca0d8ade (diff)
hurd: Fix map_dev_mem from non-zero address
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>
Diffstat (limited to 'src/x86_pci.c')
-rw-r--r--src/x86_pci.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/x86_pci.c b/src/x86_pci.c
index a272147..03864e6 100644
--- a/src/x86_pci.c
+++ b/src/x86_pci.c
@@ -248,7 +248,8 @@ map_dev_mem(void **dest, size_t mem_offset, size_t mem_size, int write)
if (mem_size % pagesize)
mem_size += pagesize - (mem_size % pagesize);
- err = device_map (devmem, prot, 0x0, mem_size, &pager, 0);
+ /* XXX: Mach should be fixed into supporting non-zero offset */
+ err = device_map (devmem, prot, 0x0, mem_offset + mem_size, &pager, 0);
if (err)
return err;