pci_control_port is not a port info
so calling deref on it is invalid.
There seems no reason to have a device_close
for the pci device currently so remove it.
Perhaps some logic needs to be added to prevent
concurrent pci accesses by multiple clients
since some pci commands are non-atomic (?)
TESTED via booting a rump disk
---
pci-arbiter/main.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/pci-arbiter/main.c b/pci-arbiter/main.c
index ec97856d..0ed5b1c2 100644
--- a/pci-arbiter/main.c
+++ b/pci-arbiter/main.c
@@ -97,20 +97,13 @@ pci_device_open (mach_port_t reply_port,
mach_msg_type_name_t reply_port_type,
return D_SUCCESS;
}
-static io_return_t
-pci_device_close (void *d)
-{
- ports_port_deref (&pci_control_port);
- return 0;
-}
-
static struct machdev_device_emulation_ops pci_arbiter_emulation_ops = {
NULL,
NULL,
NULL,
NULL,
pci_device_open,
- pci_device_close,
+ NULL,
NULL,
NULL,
NULL,
--
2.35.1