From 918d1166a87d4111ddefb477c9a45ee1c2dce169 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Sat, 27 Feb 2016 07:53:50 +0100 Subject: libddekit: support new-style interrupt notifications * libddekit/interrupt.c (irq_server): If a message with a valid reply port arrives, deallocate that instead of calling 'device_intr_enable' to re-enable the interrupt. --- libddekit/interrupt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libddekit/interrupt.c b/libddekit/interrupt.c index 2618e50b..acace565 100644 --- a/libddekit/interrupt.c +++ b/libddekit/interrupt.c @@ -145,7 +145,11 @@ static void intloop(void *arg) params->handler(params->priv); /* If the irq has been disabled by the linux device, * we don't need to reenable the real one. */ - device_intr_enable (master_device, my_index, TRUE); + if (MACH_PORT_VALID (intr_header->intr_header.msgh_remote_port)) + mach_port_deallocate (mach_task_self (), + intr_header->intr_header.msgh_remote_port); + else + device_intr_enable (master_device, my_index, TRUE); if (ddekit_irq_ctrl[my_index].thread_exit) { ddekit_lock_unlock (&ddekit_irq_ctrl[my_index].irqlock); -- cgit v1.2.3