diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2005-11-28 22:22:56 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2005-11-28 22:22:56 +0000 |
commit | ef49b62f208d1fd26918bebe3130a438212dedda (patch) | |
tree | 1111970af7f7fc869e40d20f847e1f1b5a809039 /sys/arch | |
parent | 9407a589e754c164aa72b047d01fb5e153c17425 (diff) |
Maintain an interrupt depth counter for CLKF_INTR to be correct.
Tested aoyama@ martin@ and I.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/m88k/include/cpu.h | 5 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/m88k_machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/trap.c | 8 |
3 files changed, 13 insertions, 4 deletions
diff --git a/sys/arch/m88k/include/cpu.h b/sys/arch/m88k/include/cpu.h index fc3a85cfba1..a69737ff09a 100644 --- a/sys/arch/m88k/include/cpu.h +++ b/sys/arch/m88k/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.8 2005/11/28 22:21:15 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.9 2005/11/28 22:22:51 miod Exp $ */ /* * Copyright (c) 1996 Nivas Madhur * Copyright (c) 1992, 1993 @@ -97,7 +97,8 @@ struct clockframe { #define CLKF_USERMODE(framep) (((framep)->tf.tf_epsr & PSR_MODE) == 0) #define CLKF_PC(framep) ((framep)->tf.tf_sxip & XIP_ADDR) -#define CLKF_INTR(framep) (0) /* XXX temporary */ +extern int intrdepth; +#define CLKF_INTR(framep) (intrdepth > 1) /* * Get interrupt glue. diff --git a/sys/arch/m88k/m88k/m88k_machdep.c b/sys/arch/m88k/m88k/m88k_machdep.c index 2b0db929c41..0c9b6d2fdc9 100644 --- a/sys/arch/m88k/m88k/m88k_machdep.c +++ b/sys/arch/m88k/m88k/m88k_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m88k_machdep.c,v 1.8 2005/11/06 17:58:20 miod Exp $ */ +/* $OpenBSD: m88k_machdep.c,v 1.9 2005/11/28 22:22:55 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -75,6 +75,8 @@ void dumpconf(void); int longformat = 1; /* for regdump() */ +int intrdepth; + /* * safepri is a safe priority for sleep to set for a spin-wait * during autoconfiguration or after a panic. diff --git a/sys/arch/m88k/m88k/trap.c b/sys/arch/m88k/m88k/trap.c index 2491feb36b6..dae2b10eb6c 100644 --- a/sys/arch/m88k/m88k/trap.c +++ b/sys/arch/m88k/m88k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.22 2005/11/28 22:21:15 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.23 2005/11/28 22:22:55 miod Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. * Copyright (c) 1998 Steve Murphree, Jr. @@ -260,7 +260,9 @@ m88100_trap(unsigned type, struct trapframe *frame) /* This function pointer is set in machdep.c It calls m188_ext_int or sbc_ext_int depending on the value of brdtyp - smurph */ + intrdepth++; md_interrupt_func(T_INT, frame); + intrdepth--; return; case T_MISALGNFLT: @@ -693,11 +695,15 @@ m88110_trap(unsigned type, struct trapframe *frame) break; case T_NON_MASK: case T_NON_MASK+T_USER: + intrdepth++; md_interrupt_func(T_NON_MASK, frame); + intrdepth--; return; case T_INT: case T_INT+T_USER: + intrdepth++; md_interrupt_func(T_INT, frame); + intrdepth--; return; case T_MISALGNFLT: printf("kernel mode misaligned access exception @ 0x%08x\n", |