Now that sh3 has didicated interrupt stack we can check for cpu_intr_p

with simple sp comparison, so we can drop ci_idepth.
This commit is contained in:
uwe 2008-01-07 05:00:12 +00:00
parent b786c078f9
commit f38b1e35de
5 changed files with 9 additions and 34 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.34 2007/12/03 15:33:28 ad Exp $ */
/* $NetBSD: machdep.c,v 1.35 2008/01/07 05:00:12 uwe Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2002 The NetBSD Foundation, Inc.
@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.34 2007/12/03 15:33:28 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.35 2008/01/07 05:00:12 uwe Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -275,12 +275,8 @@ void
intc_intr(int ssr, int spc, int ssp)
{
struct intc_intrhand *ih;
struct cpu_info *ci;
int s, evtcode;
ci = curcpu();
ci->ci_idepth++;
evtcode = _reg_read_4(SH4_INTEVT);
ih = EVTCODE_IH(evtcode);
@ -300,6 +296,4 @@ intc_intr(int ssr, int spc, int ssp)
} else {
(*ih->ih_func)(ih->ih_arg);
}
ci->ci_idepth--;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.58 2007/12/03 15:33:35 ad Exp $ */
/* $NetBSD: machdep.c,v 1.59 2008/01/07 05:00:12 uwe Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.58 2007/12/03 15:33:35 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.59 2008/01/07 05:00:12 uwe Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -740,13 +740,9 @@ void
intc_intr(int ssr, int spc, int ssp)
{
struct intc_intrhand *ih;
struct cpu_info *ci;
struct clockframe cf;
int s, evtcode;
ci = curcpu();
ci->ci_idepth++;
switch (cpu_product) {
case CPU_PRODUCT_7708:
case CPU_PRODUCT_7708S:
@ -765,7 +761,6 @@ intc_intr(int ssr, int spc, int ssp)
#ifdef DIAGNOSTIC
panic("intr_intc: cpu_product %d unhandled!", cpu_product);
#endif
ci->ci_idepth--;
return;
}
@ -793,7 +788,5 @@ intc_intr(int ssr, int spc, int ssp)
printf("NMI ignored.\n");
break;
}
ci->ci_idepth--;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.59 2007/12/03 15:33:44 ad Exp $ */
/* $NetBSD: machdep.c,v 1.60 2008/01/07 05:00:13 uwe Exp $ */
/*-
* Copyright (c) 2001, 2002, 2004 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.59 2007/12/03 15:33:44 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.60 2008/01/07 05:00:13 uwe Exp $");
#include "opt_md.h"
#include "opt_ddb.h"
@ -599,14 +599,11 @@ void
intc_intr(int ssr, int spc, int ssp)
{
struct intc_intrhand *ih;
struct cpu_info *ci;
int evtcode;
uint16_t r;
evtcode = _reg_read_4(CPU_IS_SH3 ? SH7709_INTEVT2 : SH4_INTEVT);
ci = curcpu();
ci->ci_idepth++;
ih = EVTCODE_IH(evtcode);
KDASSERT(ih->ih_func);
/*
@ -633,7 +630,6 @@ intc_intr(int ssr, int spc, int ssp)
if (cause == 0) {
printf("masked HD6446x interrupt.0x%04x\n", r);
_reg_write_2(HD6446X_NIRR, 0x0000);
ci->ci_idepth--;
return;
}
/* Enable higher level interrupt*/
@ -645,5 +641,4 @@ intc_intr(int ssr, int spc, int ssp)
(*ih->ih_func)(ih->ih_arg);
__dbg_heart_beat(HEART_BEAT_BLUE);
}
ci->ci_idepth--;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.41 2007/12/03 15:33:58 ad Exp $ */
/* $NetBSD: machdep.c,v 1.42 2008/01/07 05:00:13 uwe Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.41 2007/12/03 15:33:58 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.42 2008/01/07 05:00:13 uwe Exp $");
#include "opt_ddb.h"
#include "opt_memsize.h"
@ -569,12 +569,8 @@ void
intc_intr(int ssr, int spc, int ssp)
{
struct intc_intrhand *ih;
struct cpu_info *ci;
int s, evtcode;
ci = curcpu();
ci->ci_idepth++;
evtcode = _reg_read_4(SH3_INTEVT);
ih = EVTCODE_IH(evtcode);
@ -596,8 +592,6 @@ intc_intr(int ssr, int spc, int ssp)
} else {
(*ih->ih_func)(ih->ih_arg);
}
ci->ci_idepth--;
}
void *

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.49 2007/12/14 00:58:37 uwe Exp $ */
/* $NetBSD: cpu.h,v 1.50 2008/01/07 05:00:12 uwe Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
@ -59,7 +59,6 @@ struct cpu_info {
int ci_mtx_count;
int ci_mtx_oldspl;
int ci_want_resched;
int ci_idepth;
};
extern struct cpu_info cpu_info_store;