summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2017-09-30 17:26:03 +0200
committerJustus Winter <justus@gnupg.org>2017-09-30 17:39:47 +0200
commit6c093a91e43873df7f16192fa0e5e4d73592fa64 (patch)
treef5be02fb1284eaabfce3cf89ce248bc73a60c674
parent51301147f36d1581be76acdf96a465e010beeb12 (diff)
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.
-rw-r--r--linux/dev/arch/i386/kernel/irq.c18
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;
}
}