From 5c47006ea3ab8889207cf2a8e3edd49dddf3f436 Mon Sep 17 00:00:00 2001 From: tsutsui Date: Mon, 13 Aug 2007 01:55:31 +0000 Subject: [PATCH] In irq_setmasks(), refer spl_masks[current_spl_level] directly rather than spl_mask which is a saved value in splraise() and splx() functions because the latter one is not always sync'ed with current_spl_level and interrupt state could be mangled. Okay'ed by chris@, and should close PR port-shark/22355. --- sys/arch/shark/isa/isa_irq.S | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/arch/shark/isa/isa_irq.S b/sys/arch/shark/isa/isa_irq.S index 9699b1a6e323..a5814066554e 100644 --- a/sys/arch/shark/isa/isa_irq.S +++ b/sys/arch/shark/isa/isa_irq.S @@ -1,4 +1,4 @@ -/* $NetBSD: isa_irq.S,v 1.7 2007/03/09 19:21:59 thorpej Exp $ */ +/* $NetBSD: isa_irq.S,v 1.8 2007/08/13 01:55:31 tsutsui Exp $ */ /* * Copyright 1997 @@ -297,9 +297,6 @@ nextirq: /* NOT REACHED */ b . - 8 -Lspl_mask: - .word _C_LABEL(spl_mask) /* irq's allowed at current spl level */ - Lcurrent_mask: .word _C_LABEL(current_mask) /* irq's that are usable */ @@ -318,8 +315,10 @@ ENTRY(irq_setmasks) ldr r1, Lcurrent_mask /* All the enabled interrupts */ ldrh r1, [r1] /* get hardware bits of mask */ /* .word 0xe0d110b0 */ /* hand-assembled ldrh r1, [r1] */ - ldr r2, Lspl_mask /* Block due to current spl level */ + ldr r0, Lspl_masks + ldr r2, Lcurrent_spl_level ldr r2, [r2] + ldr r2, [r0, r2, lsl #2] and r1, r1, r2 ldr r2, Ldisabled_mask /* Block due to active interrupts */ ldr r2, [r2]