Date: Tue, 6 Jul 2010 15:27:06 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r209724 - in head/sys/powerpc: mpc85xx powermac powerpc Message-ID: <201007061527.o66FR6Ka008645@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: nwhitehorn Date: Tue Jul 6 15:27:05 2010 New Revision: 209724 URL: http://svn.freebsd.org/changeset/base/209724 Log: Move the EOI logic when starting ithreads into intr_machdep instead of relying on it as a side effect of PIC_MASK() in the PIC drivers, and add an inmplementation of assign_cpu() for the kernel interrupt layer. Modified: head/sys/powerpc/mpc85xx/atpic.c head/sys/powerpc/powermac/hrowpic.c head/sys/powerpc/powerpc/intr_machdep.c head/sys/powerpc/powerpc/openpic.c Modified: head/sys/powerpc/mpc85xx/atpic.c ============================================================================== --- head/sys/powerpc/mpc85xx/atpic.c Tue Jul 6 12:13:15 2010 (r209723) +++ head/sys/powerpc/mpc85xx/atpic.c Tue Jul 6 15:27:05 2010 (r209724) @@ -308,12 +308,10 @@ atpic_mask(device_t dev, u_int irq) if (irq > 7) { sc->sc_mask[ATPIC_SLAVE] |= 1 << (irq - 8); atpic_write(sc, ATPIC_SLAVE, 1, sc->sc_mask[ATPIC_SLAVE]); - atpic_write(sc, ATPIC_SLAVE, 0, OCW2_EOI); } else { sc->sc_mask[ATPIC_MASTER] |= 1 << irq; atpic_write(sc, ATPIC_MASTER, 1, sc->sc_mask[ATPIC_MASTER]); } - atpic_write(sc, ATPIC_MASTER, 0, OCW2_EOI); } static void Modified: head/sys/powerpc/powermac/hrowpic.c ============================================================================== --- head/sys/powerpc/powermac/hrowpic.c Tue Jul 6 12:13:15 2010 (r209723) +++ head/sys/powerpc/powermac/hrowpic.c Tue Jul 6 15:27:05 2010 (r209724) @@ -269,12 +269,9 @@ static void hrowpic_mask(device_t dev, u_int irq) { struct hrowpic_softc *sc; - int bank; sc = device_get_softc(dev); hrowpic_toggle_irq(sc, irq, 0); - bank = (irq >= 32) ? HPIC_SECONDARY : HPIC_PRIMARY ; - hrowpic_write_reg(sc, HPIC_CLEAR, bank, 1U << (irq & 0x1f)); } static void Modified: head/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/intr_machdep.c Tue Jul 6 12:13:15 2010 (r209723) +++ head/sys/powerpc/powerpc/intr_machdep.c Tue Jul 6 15:27:05 2010 (r209724) @@ -239,21 +239,42 @@ powerpc_intr_eoi(void *arg) } static void -powerpc_intr_mask(void *arg) +powerpc_intr_pre_ithread(void *arg) { struct powerpc_intr *i = arg; PIC_MASK(i->pic, i->intline); + PIC_EOI(i->pic, i->intline); } static void -powerpc_intr_unmask(void *arg) +powerpc_intr_post_ithread(void *arg) { struct powerpc_intr *i = arg; PIC_UNMASK(i->pic, i->intline); } +static int +powerpc_assign_intr_cpu(void *arg, u_char cpu) +{ +#ifdef SMP + struct powerpc_intr *i = arg; + + if (cpu == NOCPU) + i->cpu = all_cpus; + else + i->cpu = 1 << cpu; + + if (!cold && i->pic != NULL && i->pic == root_pic) + PIC_BIND(i->pic, i->intline, i->cpu); + + return (0); +#else + return (EOPNOTSUPP); +#endif +} + void powerpc_register_pic(device_t dev, u_int ipi) { @@ -360,8 +381,8 @@ powerpc_setup_intr(const char *name, u_i if (i->event == NULL) { error = intr_event_create(&i->event, (void *)i, 0, irq, - powerpc_intr_mask, powerpc_intr_unmask, powerpc_intr_eoi, - NULL, "irq%u:", irq); + powerpc_intr_pre_ithread, powerpc_intr_post_ithread, + powerpc_intr_eoi, powerpc_assign_intr_cpu, "irq%u:", irq); if (error) return (error); @@ -410,14 +431,6 @@ powerpc_bind_intr(u_int irq, u_char cpu) if (i == NULL) return (ENOMEM); - if (cpu == NOCPU) - i->cpu = all_cpus; - else - i->cpu = 1 << cpu; - - if (!cold && i->pic != NULL && i->pic == root_pic) - PIC_BIND(i->pic, i->intline, i->cpu); - return (intr_event_bind(i->event, cpu)); } #endif Modified: head/sys/powerpc/powerpc/openpic.c ============================================================================== --- head/sys/powerpc/powerpc/openpic.c Tue Jul 6 12:13:15 2010 (r209723) +++ head/sys/powerpc/powerpc/openpic.c Tue Jul 6 15:27:05 2010 (r209724) @@ -351,7 +351,6 @@ openpic_mask(device_t dev, u_int irq) x |= OPENPIC_IMASK; openpic_write(sc, OPENPIC_IPI_VECTOR(0), x); } - openpic_write(sc, OPENPIC_PCPU_EOI(PCPU_GET(cpuid)), 0); } void
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007061527.o66FR6Ka008645>