Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/atari Add 'prev_sr' argument to milan_isa_intr() so...
details: https://anonhg.NetBSD.org/src/rev/9f383fc5b11d
branches: trunk
changeset: 510408:9f383fc5b11d
user: leo <leo%NetBSD.org@localhost>
date: Mon May 28 08:41:37 2001 +0000
description:
Add 'prev_sr' argument to milan_isa_intr() so we can properly defer interrupts
that come in at the wrong time.
diffstat:
sys/arch/atari/atari/locore.s | 6 ++++--
sys/arch/atari/isa/isa_milan.c | 38 ++++++++++++++++++++++++++++++++------
2 files changed, 36 insertions(+), 8 deletions(-)
diffs (97 lines):
diff -r bef89304eb26 -r 9f383fc5b11d sys/arch/atari/atari/locore.s
--- a/sys/arch/atari/atari/locore.s Mon May 28 08:30:03 2001 +0000
+++ b/sys/arch/atari/atari/locore.s Mon May 28 08:41:37 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.80 2001/05/15 13:49:56 leo Exp $ */
+/* $NetBSD: locore.s,v 1.81 2001/05/28 08:41:37 leo Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -378,6 +378,8 @@
#define PLX_CNTRL 0x42ec
#define PLX_DMCFGA 0x42ac
moveml %d0-%d2/%a0-%a1,%sp@-
+ movw %sp@(20),%sp@- | push previous SR value
+ clrw %sp@- | padded to longword
movl _C_LABEL(stio_addr),%a0 | get KVA of ST-IO area
movew #0xffff,%a0@(PLX_PCICR) | clear PCI_SR error bits
movel a0@(PLX_CNTRL),%d0 | Change PCI command code from
@@ -395,7 +397,7 @@
movew %d2,%sr | Re-enable interrupts
movel %d1,%sp@- | Call handler
jbsr _C_LABEL(milan_isa_intr)
- addql #4,%sp
+ addql #8,%sp
moveml %sp@+,%d0-%d2/%a0-%a1
jra _ASM_LABEL(rei)
diff -r bef89304eb26 -r 9f383fc5b11d sys/arch/atari/isa/isa_milan.c
--- a/sys/arch/atari/isa/isa_milan.c Mon May 28 08:30:03 2001 +0000
+++ b/sys/arch/atari/isa/isa_milan.c Mon May 28 08:41:37 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isa_milan.c,v 1.2 2001/05/16 08:45:50 leo Exp $ */
+/* $NetBSD: isa_milan.c,v 1.3 2001/05/28 08:41:37 leo Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -52,6 +52,7 @@
#endif
static void set_icus(void);
static void calc_imask(void);
+static void isa_callback(int);
/*
* Bitmask of currently enabled isa interrupts. Used by set_icus().
@@ -132,11 +133,24 @@
set_icus();
}
+static void
+isa_callback(vector)
+ int vector;
+{
+ isa_intr_info_t *iinfo_p;
+ int s;
-void milan_isa_intr(int);
+ iinfo_p = &milan_isa_iinfo[vector];
+
+ s = splx(iinfo_p->ipl);
+ (void) (iinfo_p->ifunc)(iinfo_p->iarg);
+ splx(s);
+}
+
+void milan_isa_intr(int, int);
void
-milan_isa_intr(vector)
-int vector;
+milan_isa_intr(vector, sr)
+ int vector, sr;
{
isa_intr_info_t *iinfo_p;
@@ -151,10 +165,22 @@
*((u_char *)AD_8259_MASTER) = 0x20;
iinfo_p = &milan_isa_iinfo[vector];
- if (iinfo_p->ifunc == NULL)
+ if (iinfo_p->ifunc == NULL) {
printf("milan_isa_intr: Stray interrupt: %d (mask:%04x)\n",
vector, imask_enable);
- else (void) (iinfo_p->ifunc)(iinfo_p->iarg);
+ return;
+ }
+ if ((sr & PSL_IPL) >= (iinfo_p->ipl & PSL_IPL)) {
+ /*
+ * We're running at a too high priority now.
+ */
+ add_sicallback((si_farg)isa_callback, (void*)vector, 0);
+ }
+ else {
+ s = splx(iinfo_p->ipl);
+ (void) (iinfo_p->ifunc)(iinfo_p->iarg);
+ splx(s);
+ }
}
Home |
Main Index |
Thread Index |
Old Index