diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-10-04 05:16:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-04 10:55:25 -0400 |
commit | f29bd1ba68c8c6a0f50bd678bbd5a26674018f7c (patch) | |
tree | 5a2f6086397b94e9094fa065a344bcb7e6a05ac0 /arch/x86_64/kernel/i8259.c | |
parent | 0271eb947db2704a0ff8be68d72915ab021d1ead (diff) |
[PATCH] genirq: convert the x86_64 architecture to irq-chips
This patch converts all the x86_64 PIC controllers layers to the new and
simpler irq-chip interrupt handling layer.
[mingo@elte.hu: The patch also enables the fasteoi handler for x86_64]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/kernel/i8259.c')
-rw-r--r-- | arch/x86_64/kernel/i8259.c | 50 |
1 files changed, 12 insertions, 38 deletions
diff --git a/arch/x86_64/kernel/i8259.c b/arch/x86_64/kernel/i8259.c index 2dd51f364ea2..ae1101cd5252 100644 --- a/arch/x86_64/kernel/i8259.c +++ b/arch/x86_64/kernel/i8259.c | |||
@@ -121,42 +121,15 @@ void (*interrupt[NR_IRQS])(void) = { | |||
121 | * moves to arch independent land | 121 | * moves to arch independent land |
122 | */ | 122 | */ |
123 | 123 | ||
124 | DEFINE_SPINLOCK(i8259A_lock); | ||
125 | |||
126 | static int i8259A_auto_eoi; | 124 | static int i8259A_auto_eoi; |
127 | 125 | DEFINE_SPINLOCK(i8259A_lock); | |
128 | static void end_8259A_irq (unsigned int irq) | ||
129 | { | ||
130 | if (irq > 256) { | ||
131 | char var; | ||
132 | printk("return %p stack %p ti %p\n", __builtin_return_address(0), &var, task_thread_info(current)); | ||
133 | |||
134 | BUG(); | ||
135 | } | ||
136 | |||
137 | if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)) && | ||
138 | irq_desc[irq].action) | ||
139 | enable_8259A_irq(irq); | ||
140 | } | ||
141 | |||
142 | #define shutdown_8259A_irq disable_8259A_irq | ||
143 | |||
144 | static void mask_and_ack_8259A(unsigned int); | 126 | static void mask_and_ack_8259A(unsigned int); |
145 | 127 | ||
146 | static unsigned int startup_8259A_irq(unsigned int irq) | 128 | static struct irq_chip i8259A_chip = { |
147 | { | 129 | .name = "XT-PIC", |
148 | enable_8259A_irq(irq); | 130 | .mask = disable_8259A_irq, |
149 | return 0; /* never anything pending */ | 131 | .unmask = enable_8259A_irq, |
150 | } | 132 | .mask_ack = mask_and_ack_8259A, |
151 | |||
152 | static struct hw_interrupt_type i8259A_irq_type = { | ||
153 | .typename = "XT-PIC", | ||
154 | .startup = startup_8259A_irq, | ||
155 | .shutdown = shutdown_8259A_irq, | ||
156 | .enable = enable_8259A_irq, | ||
157 | .disable = disable_8259A_irq, | ||
158 | .ack = mask_and_ack_8259A, | ||
159 | .end = end_8259A_irq, | ||
160 | }; | 133 | }; |
161 | 134 | ||
162 | /* | 135 | /* |
@@ -231,7 +204,7 @@ void make_8259A_irq(unsigned int irq) | |||
231 | { | 204 | { |
232 | disable_irq_nosync(irq); | 205 | disable_irq_nosync(irq); |
233 | io_apic_irqs &= ~(1<<irq); | 206 | io_apic_irqs &= ~(1<<irq); |
234 | irq_desc[irq].chip = &i8259A_irq_type; | 207 | set_irq_chip_and_handler(irq, &i8259A_chip, handle_level_irq); |
235 | enable_irq(irq); | 208 | enable_irq(irq); |
236 | } | 209 | } |
237 | 210 | ||
@@ -367,9 +340,9 @@ void init_8259A(int auto_eoi) | |||
367 | * in AEOI mode we just have to mask the interrupt | 340 | * in AEOI mode we just have to mask the interrupt |
368 | * when acking. | 341 | * when acking. |
369 | */ | 342 | */ |
370 | i8259A_irq_type.ack = disable_8259A_irq; | 343 | i8259A_chip.mask_ack = disable_8259A_irq; |
371 | else | 344 | else |
372 | i8259A_irq_type.ack = mask_and_ack_8259A; | 345 | i8259A_chip.mask_ack = mask_and_ack_8259A; |
373 | 346 | ||
374 | udelay(100); /* wait for 8259A to initialize */ | 347 | udelay(100); /* wait for 8259A to initialize */ |
375 | 348 | ||
@@ -464,12 +437,13 @@ void __init init_ISA_irqs (void) | |||
464 | /* | 437 | /* |
465 | * 16 old-style INTA-cycle interrupts: | 438 | * 16 old-style INTA-cycle interrupts: |
466 | */ | 439 | */ |
467 | irq_desc[i].chip = &i8259A_irq_type; | 440 | set_irq_chip_and_handler(i, &i8259A_chip, |
441 | handle_level_irq); | ||
468 | } else { | 442 | } else { |
469 | /* | 443 | /* |
470 | * 'high' PCI IRQs filled in on demand | 444 | * 'high' PCI IRQs filled in on demand |
471 | */ | 445 | */ |
472 | irq_desc[i].chip = &no_irq_type; | 446 | irq_desc[i].chip = &no_irq_chip; |
473 | } | 447 | } |
474 | } | 448 | } |
475 | } | 449 | } |