diff options
author | Justus Winter <justus@gnupg.org> | 2016-02-27 09:10:23 +0100 |
---|---|---|
committer | Justus Winter <justus@gnupg.org> | 2016-02-27 09:10:23 +0100 |
commit | 2cf0c62f09dc2069a9446a5a694bb73dd1322108 (patch) | |
tree | 0cb0d4b951f4ec9efa4686b2b3d9c05c92fed9eb /linux | |
parent | 9482ee4ba48f8033f7916551f2767f48f9bd0c55 (diff) |
No need for a new kind of notification, we can provide a smoother upgrade path
Diffstat (limited to 'linux')
-rw-r--r-- | linux/dev/arch/i386/kernel/irq.c | 50 |
1 files changed, 20 insertions, 30 deletions
diff --git a/linux/dev/arch/i386/kernel/irq.c b/linux/dev/arch/i386/kernel/irq.c index 15f95c3..e2c18c7 100644 --- a/linux/dev/arch/i386/kernel/irq.c +++ b/linux/dev/arch/i386/kernel/irq.c @@ -104,7 +104,6 @@ linux_intr (int irq) { struct pt_regs regs; struct linux_action *action = *(irq_action + irq); - struct linux_action **prev = &irq_action[irq]; unsigned long flags; kstat.interrupts[irq]++; @@ -123,18 +122,10 @@ linux_intr (int irq) /* We disable the irq here and it will be enabled * after the interrupt is handled by the user space driver. */ disable_irq (irq); - if (! queue_intr (action->userspace_handler)) - { - *prev = action->next; - linux_kfree(action); - action = *prev; - enable_irq (irq); - continue; - } + queue_intr (action->userspace_handler); } else if (action->handler) action->handler (irq, action->dev_id, ®s); - prev = &action->next; action = action->next; } @@ -277,30 +268,10 @@ install_user_intr_handler (unsigned int irq, unsigned long flags, struct intr_entry *entry) { struct linux_action *action; -#if 0 - struct linux_action *old; -#endif int retval; assert (irq < 16); -#if 0 - /* Test whether the irq handler has already been set. */ - /* JW: Actually, that cannot happen. We test for that in - device_intr_register before calling this function. */ - // TODO I need to protect the array when iterating it. - old = irq_action[irq]; - while (old) - { - if (old->delivery_port == entry->dest) - { - printk ("The interrupt handler has been installed on line %d", irq); - return linux_to_mach_error (-EAGAIN); - } - old = old->next; - } -#endif - /* * Hmm... Should I use `kalloc()' ? * By OKUJI Yoshinori. @@ -323,6 +294,25 @@ install_user_intr_handler (unsigned int irq, unsigned long flags, return linux_to_mach_error (retval); } +int +remove_user_intr_handler (unsigned int irq, struct intr_entry *entry) +{ + struct linux_action *action, **prev; + + for (prev = &irq_action[irq], action = irq_action[irq]; + action; + prev = &action->next, action = action->next) + if (action->userspace_handler == entry) + { + *prev = action->next; + linux_kfree(action); + enable_irq (irq); + return 1; + } + + return 0; +} + /* * Attach a handler to an IRQ. */ |