-/* $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 $ */
/*-
struct clockframe cf;
int evtcode;
+ curcpu()->ci_intrdepth++;
+
evtcode = _reg_read_4(SH4_INTEVT);
ih = EVTCODE_IH(evtcode);
KDASSERT(ih->ih_func);
printf("NMI ignored.\n");
break;
}
+
+ curcpu()->ci_intrdepth--;
}
void
-/* $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 $ */
/*-
#endif
int ci_want_resched;
+ int ci_intrdepth;
struct clockqueue ci_queue;
#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