Abandon disabled_mask and spl_mask, and use only current_spl_level to

manage interrupt masking.

This change is necessary for straightforward implementation of coming IPL
support for cascaded intrs, and it should not impair performance.
This commit is contained in:
toshii 2001-05-14 16:19:30 +00:00
parent 1ef476f4a4
commit c939f00e98
3 changed files with 7 additions and 54 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: spl.S,v 1.3 2001/04/17 16:07:13 toshii Exp $ */
/* $NetBSD: spl.S,v 1.4 2001/05/14 16:19:30 toshii Exp $ */
/*
* Copyright (c) 1996-1998 Mark Brinicombe.
@ -49,12 +49,6 @@
Lcurrent_spl_level:
.word _C_LABEL(current_spl_level)
Lspl_masks:
.word _C_LABEL(spl_masks)
Lspl_mask:
.word _C_LABEL(spl_mask)
ENTRY(raisespl)
stmfd sp!, {r4}
/* Disable interrupts */
@ -70,12 +64,6 @@ ENTRY(raisespl)
str r3, [r1] /* Store the new spl level */
ldr r2, Lspl_masks /* Get the spl mask */
ldr r2, [r2, r3, lsl #2]
ldr r1, Lspl_mask /* Store in the current spl mask */
str r2, [r1]
stmfd sp!, {r0, lr} /* Preserve registers */
bl _C_LABEL(irq_setmasks) /* Update the actual masks */
ldmfd sp!, {r0, lr}
@ -99,12 +87,6 @@ ENTRY(lowerspl)
str r3, [r1] /* Store the new spl level */
ldr r2, Lspl_masks /* Get the spl mask */
ldr r2, [r2, r3, lsl #2]
ldr r1, Lspl_mask /* Store in the current spl mask */
str r2, [r1]
stmfd sp!, {r0, lr} /* Preserve registers */
bl _C_LABEL(irq_setmasks) /* Update the actual masks */
msr cpsr_all, r4
@ -132,12 +114,6 @@ ENTRY(splx)
str r3, [r1] /* Store the new spl level */
ldr r2, Lspl_masks /* Get the spl mask */
ldr r2, [r2, r3, lsl #2] /* Use r4 so available later */
ldr r1, Lspl_mask /* Store in the current spl mask */
str r2, [r1]
stmfd sp!, {r0, lr} /* Preserve registers */
bl _C_LABEL(irq_setmasks) /* Update the actual masks */
msr cpsr_all, r4

View File

@ -1,4 +1,4 @@
/* $NetBSD: sa11x0_irq.S,v 1.4 2001/03/11 14:37:03 toshii Exp $ */
/* $NetBSD: sa11x0_irq.S,v 1.5 2001/05/14 16:19:31 toshii Exp $ */
/*
* Copyright (c) 1998 Mark Brinicombe.
@ -50,9 +50,6 @@
.text
.align 0
Ldisabled_mask:
.word _C_LABEL(disabled_mask)
Lcurrent_spl_level:
.word _C_LABEL(current_spl_level)
@ -109,12 +106,6 @@ ASENTRY_NP(irq_entry)
add r1, r1, #1
str r1, [r0]
/* Block the current requested interrupts */
ldr r1, Ldisabled_mask
ldr r0, [r1]
stmfd sp!, {r0}
orr r0, r0, r8
/*
* Need to block all interrupts at the IPL or lower for
* all asserted interrupts.
@ -141,9 +132,6 @@ Lfind_highest_ipl:
add r9, r9, #1
ldr r2, [r7, r9, lsl #2]
mvn r2, r2
orr r0, r0, r2
str r0, [r1]
ldr r0, Lcurrent_spl_level
ldr r1, [r0]
@ -210,7 +198,7 @@ irqchainloop:
add lr, pc, #nextinchain - . - 8 /* return address */
ldr r0, [r6, #(IH_ARG)] /* Get argument pointer */
teq r0, #0x00000000 /* If arg is zero pass stack frame */
addeq r0, sp, #8 /* ... stack frame [XXX needs care] */
addeq r0, sp, #4 /* ... stack frame [XXX needs care] */
ldr pc, [r6, #(IH_FUNC)] /* Call handler */
nextinchain:
@ -233,9 +221,6 @@ nextirq:
str r2, [r1]
/* Restore previous disabled mask */
ldmfd sp!, {r2}
ldr r1, Ldisabled_mask
str r2, [r1]
bl _C_LABEL(irq_setmasks)
bl _C_LABEL(dosoftints) /* Handle the soft interrupts */
@ -314,9 +299,6 @@ irqast:
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 */
@ -329,12 +311,11 @@ ENTRY(irq_setmasks)
/* Calculate interrupt mask */
ldr r1, Lcurrent_mask /* All the enabled interrupts */
ldr 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]
bic r1, r1, r2
ldr r0, [pc, #_C_LABEL(saipic_base) - . - 8]
str r1, [r0, #(SAIPIC_MR)] /* Set mask register */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sa11x0_irqhandler.c,v 1.3 2001/03/31 12:48:10 toshii Exp $ */
/* $NetBSD: sa11x0_irqhandler.c,v 1.4 2001/05/14 16:19:31 toshii Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@ -100,8 +100,6 @@ irqhandler_t *irqhandlers[NIRQS];
int current_intr_depth;
u_int current_mask;
u_int actual_mask;
u_int disabled_mask;
u_int spl_mask;
u_int imask[NIPL];
u_int irqblock[NIRQS];
@ -238,7 +236,6 @@ sa11x0_intr_establish(ic, irq, type, level, ih_fun, ih_arg)
saved_cpsr = SetCPSR(I32_bit, I32_bit);
set_spl_masks();
spl_mask = spl_masks[current_spl_level];
current_mask |= (1 << irq);
irq_setmasks();
@ -283,7 +280,6 @@ sa11x0_intr_disestablish(ic, arg)
intr_calculatemasks();
saved_cpsr = SetCPSR(I32_bit, I32_bit);
set_spl_masks();
spl_mask = spl_masks[current_spl_level];
current_mask &= ~(1 << irq);
irq_setmasks();