diff options
author | Justus Winter <justus@gnupg.org> | 2017-09-30 17:26:03 +0200 |
---|---|---|
committer | Justus Winter <justus@gnupg.org> | 2017-09-30 17:39:47 +0200 |
commit | 6c093a91e43873df7f16192fa0e5e4d73592fa64 (patch) | |
tree | f5be02fb1284eaabfce3cf89ce248bc73a60c674 /linux | |
parent | 51301147f36d1581be76acdf96a465e010beeb12 (diff) | |
download | gnumach-6c093a91e43873df7f16192fa0e5e4d73592fa64.tar.gz gnumach-6c093a91e43873df7f16192fa0e5e4d73592fa64.tar.bz2 gnumach-6c093a91e43873df7f16192fa0e5e4d73592fa64.zip |
linux: Fix interrupt glue.
Previously, we used an invalid pointer to mark interrupts as reserved
by Mach. This, however, crashes code trying to iterate over the list
of interrupt handlers. Use a valid structure instead.
* linux/dev/arch/i386/kernel/irq.c (reserved_mach_handler): New
function.
(reserved_mach): New variable.
(reserve_mach_irqs): Use the new variable.
Diffstat (limited to 'linux')
-rw-r--r-- | linux/dev/arch/i386/kernel/irq.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/linux/dev/arch/i386/kernel/irq.c b/linux/dev/arch/i386/kernel/irq.c index 7753814b..a02e9582 100644 --- a/linux/dev/arch/i386/kernel/irq.c +++ b/linux/dev/arch/i386/kernel/irq.c @@ -393,6 +393,18 @@ probe_irq_off (unsigned long irqs) * Reserve IRQs used by Mach drivers. * Must be called before Linux IRQ detection, after Mach IRQ detection. */ + +static void reserved_mach_handler (int line, void *cookie, struct pt_regs *regs) +{ + /* These interrupts are actually handled in Mach. */ + assert (! "reached"); +} + +static const struct linux_action reserved_mach = + { + reserved_mach_handler, NULL, NULL, 0 + }; + static void reserve_mach_irqs (void) { @@ -401,8 +413,10 @@ reserve_mach_irqs (void) for (i = 0; i < 16; i++) { if (ivect[i] != prtnull && ivect[i] != intnull) - /* Set non-NULL value. */ - irq_action[i] = (struct linux_action *) -1; + /* This dummy action does not specify SA_SHIRQ, so + setup_x86_irq will not try to add a handler to this + slot. Therefore, the cast is safe. */ + irq_action[i] = (struct linux_action *) &reserved_mach; } } |