diff options
author | Damien Zammit <damien@zamaudio.com> | 2023-07-16 00:43:57 +1000 |
---|---|---|
committer | Damien Zammit <damien@zamaudio.com> | 2023-07-20 20:00:37 +1000 |
commit | db94575b4eebb84852ea9bbad8216250c1f9cd19 (patch) | |
tree | 73881ad17e65c28eb9dd0bcf26ffbc00ab980419 /src/x86_pci.c | |
parent | 03d0b467804bf033c2be259be3f091231f74cff9 (diff) |
hurd: Make io port access granular and go through pci-arbiterfix-ioperm
Diffstat (limited to 'src/x86_pci.c')
-rw-r--r-- | src/x86_pci.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/x86_pci.c b/src/x86_pci.c index dfe3fa3..0207e2f 100644 --- a/src/x86_pci.c +++ b/src/x86_pci.c @@ -45,7 +45,9 @@ int x86_enable_io(void) { - if (!ioperm(0, 0xffff, 1)) + /* The first process to claim this gets to be the pci-arbiter + * and mach will eventually reject all subsequent requests to any overlapping ranges */ + if (!ioperm(PCI_CFG1_BASE, PCI_CFG1_BASE + PCI_CFG1_SIZE - 1, 1)) return 0; return errno; } @@ -53,7 +55,7 @@ x86_enable_io(void) int x86_disable_io(void) { - if (!ioperm(0, 0xffff, 0)) + if (!ioperm(PCI_CFG1_BASE, PCI_CFG1_BASE + PCI_CFG1_SIZE - 1, 0)) return 0; return errno; } |