summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-07-10 00:07:09 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-07-10 00:07:09 +0200
commit0908df0d373076495cb7a69ce95d31db49ea21f7 (patch)
tree1fbc9e2894d18821e6f13f7964ac52ca619482f0
parent327a9d60cee95bc9601129232b922697042ec8b5 (diff)
Fix duplicate initial unack for compatibility
-rw-r--r--device/ds_routines.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/device/ds_routines.c b/device/ds_routines.c
index c16b2098..36a8437e 100644
--- a/device/ds_routines.c
+++ b/device/ds_routines.c
@@ -358,7 +358,6 @@ ds_device_intr_register (device_t dev, int id,
}
static ipc_port_t intr_receive_ports[16];
-static int ackskip[16];
io_return_t
experimental_device_intr_register (ipc_port_t master_port, int line,
int id, int flags, ipc_port_t receive_port)
@@ -378,14 +377,11 @@ experimental_device_intr_register (ipc_port_t master_port, int line,
user_intr_t *user_intr = insert_intr_entry (&irqtab, line, receive_port, 1);
if (!user_intr)
return D_NO_MEMORY;
+
// TODO The original port should be replaced
// when the same device driver calls it again,
// in order to handle the case that the device driver crashes and restarts.
ret = install_user_intr_handler (&irqtab, line, 0, user_intr);
- intr_receive_ports[line] = receive_port;
- /* For now netdde calls device_intr_enable once after registration. Assume
- * it does so for this RPC. */
- ackskip[line]++;
if (ret == 0)
{
@@ -393,6 +389,7 @@ experimental_device_intr_register (ipc_port_t master_port, int line,
* Thus, the port won't be destroyed after its task is terminated. */
ip_reference (receive_port);
+ intr_receive_ports[line] = receive_port;
/* For now netdde calls device_intr_enable once after registration. Assume
* it does so for now. When we move to IRQ acknowledgment convention we will
* change this. */
@@ -424,11 +421,8 @@ experimental_device_intr_enable(ipc_port_t master_port, int line, char status)
if (master_port != master_device_port)
return D_INVALID_OPERATION;
- if (ackskip[line])
- {
- ackskip[line]--;
- return D_SUCCESS;
- }
+ if (status != 1)
+ return D_INVALID_OPERATION;
return irq_acknowledge(intr_receive_ports[line]);
}