Module Name: src Committed By: matt Date: Wed Jun 8 05:13:00 UTC 2011
Modified Files: src/sys/arch/powerpc/booke: e500_intr.c Log Message: Add an e500_idlespin to detect calls to idlespin when interrupts are blocked or disabled. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/booke/e500_intr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/powerpc/booke/e500_intr.c diff -u src/sys/arch/powerpc/booke/e500_intr.c:1.8 src/sys/arch/powerpc/booke/e500_intr.c:1.9 --- src/sys/arch/powerpc/booke/e500_intr.c:1.8 Sun Jun 5 16:52:24 2011 +++ src/sys/arch/powerpc/booke/e500_intr.c Wed Jun 8 05:13:00 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: e500_intr.c,v 1.8 2011/06/05 16:52:24 matt Exp $ */ +/* $NetBSD: e500_intr.c,v 1.9 2011/06/08 05:13:00 matt Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -1120,6 +1120,18 @@ } static void +e500_idlespin(void) +{ + KASSERTMSG(curcpu()->ci_cpl == IPL_NONE, + ("%s: cpu%u: ci_cpl (%d) != 0", __func__, cpu_number(), + curcpu()->ci_cpl)); + KASSERTMSG(CTPR2IPL(openpic_read(curcpu()->ci_softc, OPENPIC_CTPR)) == IPL_NONE, + ("%s: cpu%u: CTPR (%d) != IPL_NONE", __func__, cpu_number(), + CTPR2IPL(openpic_read(curcpu()->ci_softc, OPENPIC_CTPR)))); + KASSERT(mfmsr() & PSL_EE); +} + +static void e500_intr_cpu_attach(struct cpu_info *ci) { struct cpu_softc * const cpu = ci->ci_softc; @@ -1180,6 +1192,8 @@ evcnt_attach_dynamic(evcnt, EVCNT_TYPE_INTR, NULL, xname, e500_mi_intr_names[j].in_name); } + + ci->ci_idlespin = e500_idlespin; } static void