From: miod Date: Thu, 24 Oct 2024 05:28:00 +0000 (+0000) Subject: Add a ci_intrdepth field to struct cpu_info for sh, and use it to implement X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=db5bb88ce21fadc1550981d4d32107131b9208cd;p=openbsd Add a ci_intrdepth field to struct cpu_info for sh, and use it to implement CLKF_INTR properly. --- diff --git a/sys/arch/landisk/landisk/intr.c b/sys/arch/landisk/landisk/intr.c index 14b00b85f33..4e5d4470de0 100644 --- a/sys/arch/landisk/landisk/intr.c +++ b/sys/arch/landisk/landisk/intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.c,v 1.10 2015/08/29 23:59:19 deraadt Exp $ */ +/* $OpenBSD: intr.c,v 1.11 2024/10/24 05:28:00 miod Exp $ */ /* $NetBSD: intr.c,v 1.1 2006/09/01 21:26:18 uwe Exp $ */ /*- @@ -73,6 +73,8 @@ intc_intr(int ssr, int spc, int ssp) struct clockframe cf; int evtcode; + curcpu()->ci_intrdepth++; + evtcode = _reg_read_4(SH4_INTEVT); ih = EVTCODE_IH(evtcode); KDASSERT(ih->ih_func); @@ -119,6 +121,8 @@ intc_intr(int ssr, int spc, int ssp) printf("NMI ignored.\n"); break; } + + curcpu()->ci_intrdepth--; } void diff --git a/sys/arch/sh/include/cpu.h b/sys/arch/sh/include/cpu.h index e1bb2283c64..f55b9866a6c 100644 --- a/sys/arch/sh/include/cpu.h +++ b/sys/arch/sh/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.39 2024/06/09 21:15:29 jca Exp $ */ +/* $OpenBSD: cpu.h,v 1.40 2024/10/24 05:28:00 miod Exp $ */ /* $NetBSD: cpu.h,v 1.41 2006/01/21 04:24:12 uwe Exp $ */ /*- @@ -72,6 +72,7 @@ struct cpu_info { #endif int ci_want_resched; + int ci_intrdepth; struct clockqueue ci_queue; @@ -105,7 +106,7 @@ struct clockframe { #define CLKF_USERMODE(cf) (!KERNELMODE((cf)->ssr)) #define CLKF_PC(cf) ((cf)->spc) -#define CLKF_INTR(cf) 0 /* XXX */ +#define CLKF_INTR(cf) (curcpu()->ci_intrdepth > 1) /* * This is used during profiling to integrate system time. It can safely