From f38b1e35dea12478e8a2b9dc24c4859f31be48a7 Mon Sep 17 00:00:00 2001 From: uwe Date: Mon, 7 Jan 2008 05:00:12 +0000 Subject: [PATCH] Now that sh3 has didicated interrupt stack we can check for cpu_intr_p with simple sp comparison, so we can drop ci_idepth. --- sys/arch/dreamcast/dreamcast/machdep.c | 10 ++-------- sys/arch/evbsh3/evbsh3/machdep.c | 11 ++--------- sys/arch/hpcsh/hpcsh/machdep.c | 9 ++------- sys/arch/mmeye/mmeye/machdep.c | 10 ++-------- sys/arch/sh3/include/cpu.h | 3 +-- 5 files changed, 9 insertions(+), 34 deletions(-) diff --git a/sys/arch/dreamcast/dreamcast/machdep.c b/sys/arch/dreamcast/dreamcast/machdep.c index 33fcdd6511bb..2efd67753a18 100644 --- a/sys/arch/dreamcast/dreamcast/machdep.c +++ b/sys/arch/dreamcast/dreamcast/machdep.c @@ -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 -__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--; } diff --git a/sys/arch/evbsh3/evbsh3/machdep.c b/sys/arch/evbsh3/evbsh3/machdep.c index 911d4d73dcd2..0caa730968a5 100644 --- a/sys/arch/evbsh3/evbsh3/machdep.c +++ b/sys/arch/evbsh3/evbsh3/machdep.c @@ -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 -__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--; } diff --git a/sys/arch/hpcsh/hpcsh/machdep.c b/sys/arch/hpcsh/hpcsh/machdep.c index 65b8aaa76868..3de11806385c 100644 --- a/sys/arch/hpcsh/hpcsh/machdep.c +++ b/sys/arch/hpcsh/hpcsh/machdep.c @@ -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 -__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--; } diff --git a/sys/arch/mmeye/mmeye/machdep.c b/sys/arch/mmeye/mmeye/machdep.c index b1eb184e98cd..58850a88a035 100644 --- a/sys/arch/mmeye/mmeye/machdep.c +++ b/sys/arch/mmeye/mmeye/machdep.c @@ -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 -__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 * diff --git a/sys/arch/sh3/include/cpu.h b/sys/arch/sh3/include/cpu.h index acf1d094a58c..a019f01d4e72 100644 --- a/sys/arch/sh3/include/cpu.h +++ b/sys/arch/sh3/include/cpu.h @@ -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;