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.
This commit is contained in:
tsutsui 2007-08-13 01:55:31 +00:00
parent e7c5957392
commit 5c47006ea3

View File

@ -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]