X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=arch%2Fsparc64%2Fkernel%2Firq.c;h=c3d068c7a4128c5ad7a94a8ad62936f425fe2569;hb=d39c9400ae0d60aaaf534b1ad860a9bc1413d8af;hp=ab9e640df22820a5ffd9084b73258ea09042c41e;hpb=a53da52fd743fd637637572838c0a7af23a2d038;p=linux-2.6-omap-h63xx.git diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c index ab9e640df22..c3d068c7a41 100644 --- a/arch/sparc64/kernel/irq.c +++ b/arch/sparc64/kernel/irq.c @@ -6,7 +6,6 @@ * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) */ -#include #include #include #include @@ -373,14 +372,14 @@ static void run_pre_handler(unsigned int virt_irq) } } -static struct hw_interrupt_type sun4u_irq = { +static struct irq_chip sun4u_irq = { .typename = "sun4u", .enable = sun4u_irq_enable, .disable = sun4u_irq_disable, .end = sun4u_irq_end, }; -static struct hw_interrupt_type sun4u_irq_ack = { +static struct irq_chip sun4u_irq_ack = { .typename = "sun4u+ack", .enable = sun4u_irq_enable, .disable = sun4u_irq_disable, @@ -388,14 +387,14 @@ static struct hw_interrupt_type sun4u_irq_ack = { .end = sun4u_irq_end, }; -static struct hw_interrupt_type sun4v_irq = { +static struct irq_chip sun4v_irq = { .typename = "sun4v", .enable = sun4v_irq_enable, .disable = sun4v_irq_disable, .end = sun4v_irq_end, }; -static struct hw_interrupt_type sun4v_irq_ack = { +static struct irq_chip sun4v_irq_ack = { .typename = "sun4v+ack", .enable = sun4v_irq_enable, .disable = sun4v_irq_disable, @@ -414,6 +413,10 @@ void irq_install_pre_handler(int virt_irq, data->pre_handler_arg1 = arg1; data->pre_handler_arg2 = arg2; + if (desc->chip == &sun4u_irq_ack || + desc->chip == &sun4v_irq_ack) + return; + desc->chip = (desc->chip == &sun4u_irq ? &sun4u_irq_ack : &sun4v_irq_ack); } @@ -490,22 +493,6 @@ out: return bucket->virt_irq; } -void hw_resend_irq(struct hw_interrupt_type *handler, unsigned int virt_irq) -{ - struct ino_bucket *bucket = virt_irq_to_bucket(virt_irq); - unsigned long pstate; - unsigned int *ent; - - __asm__ __volatile__("rdpr %%pstate, %0" : "=r" (pstate)); - __asm__ __volatile__("wrpr %0, %1, %%pstate" - : : "r" (pstate), "i" (PSTATE_IE)); - ent = irq_work(smp_processor_id()); - bucket->irq_chain = *ent; - *ent = __irq(bucket); - set_softint(1 << PIL_DEVICE_IRQ); - __asm__ __volatile__("wrpr %0, 0x0, %%pstate" : : "r" (pstate)); -} - void ack_bad_irq(unsigned int virt_irq) { struct ino_bucket *bucket = virt_irq_to_bucket(virt_irq); @@ -519,12 +506,13 @@ void ack_bad_irq(unsigned int virt_irq) } #ifndef CONFIG_SMP -extern irqreturn_t timer_interrupt(int, void *, struct pt_regs *); +extern irqreturn_t timer_interrupt(int, void *); void timer_irq(int irq, struct pt_regs *regs) { unsigned long clr_mask = 1 << irq; unsigned long tick_mask = tick_ops->softint_mask; + struct pt_regs *old_regs; if (get_softint() & tick_mask) { irq = 0; @@ -532,21 +520,25 @@ void timer_irq(int irq, struct pt_regs *regs) } clear_softint(clr_mask); + old_regs = set_irq_regs(regs); irq_enter(); kstat_this_cpu.irqs[0]++; - timer_interrupt(irq, NULL, regs); + timer_interrupt(irq, NULL); irq_exit(); + set_irq_regs(old_regs); } #endif void handler_irq(int irq, struct pt_regs *regs) { struct ino_bucket *bucket; + struct pt_regs *old_regs; clear_softint(1 << irq); + old_regs = set_irq_regs(regs); irq_enter(); /* Sliiiick... */ @@ -555,12 +547,13 @@ void handler_irq(int irq, struct pt_regs *regs) struct ino_bucket *next = __bucket(bucket->irq_chain); bucket->irq_chain = 0; - __do_IRQ(bucket->virt_irq, regs); + __do_IRQ(bucket->virt_irq); bucket = next; } irq_exit(); + set_irq_regs(old_regs); } struct sun5_timer {