X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fppc64%2Fkernel%2Fi8259.c;h=9bea66770ab07bb411f85b4c3e636b2d9527bc12;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=2f2b9bf8cf1cd4b4cbfc57cf0c9d858d55bea443;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/arch/ppc64/kernel/i8259.c b/arch/ppc64/kernel/i8259.c index 2f2b9bf8c..9bea66770 100644 --- a/arch/ppc64/kernel/i8259.c +++ b/arch/ppc64/kernel/i8259.c @@ -21,9 +21,10 @@ unsigned char cached_8259[2] = { 0xff, 0xff }; #define cached_A1 (cached_8259[0]) #define cached_21 (cached_8259[1]) -static spinlock_t i8259_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED; +static __cacheline_aligned_in_smp DEFINE_SPINLOCK(i8259_lock); -int i8259_pic_irq_offset; +static int i8259_pic_irq_offset; +static int i8259_present; int i8259_irq(int cpu) { @@ -140,11 +141,13 @@ struct hw_interrupt_type i8259_pic = { NULL }; -void __init i8259_init(void) +void __init i8259_init(int offset) { unsigned long flags; spin_lock_irqsave(&i8259_lock, flags); + i8259_pic_irq_offset = offset; + i8259_present = 1; /* init master interrupt controller */ outb(0x11, 0x20); /* Start init sequence */ outb(0x00, 0x21); /* Vector base */ @@ -160,7 +163,18 @@ void __init i8259_init(void) outb(cached_A1, 0xA1); outb(cached_21, 0x21); spin_unlock_irqrestore(&i8259_lock, flags); + +} + +static int i8259_request_cascade(void) +{ + if (!i8259_present) + return -ENODEV; + request_irq( i8259_pic_irq_offset + 2, no_action, SA_INTERRUPT, "82c59 secondary cascade", NULL ); - + + return 0; } + +arch_initcall(i8259_request_cascade);