Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/news68k Modify software interrupt handling a bit.
details: https://anonhg.NetBSD.org/src/rev/b2eca0584aaa
branches: trunk
changeset: 479987:b2eca0584aaa
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Wed Dec 29 05:01:13 1999 +0000
description:
Modify software interrupt handling a bit.
diffstat:
sys/arch/news68k/dev/zs.c | 4 +-
sys/arch/news68k/include/intr.h | 23 +++++++++--------
sys/arch/news68k/news68k/machdep.c | 47 +++++++++++++++++++++----------------
3 files changed, 41 insertions(+), 33 deletions(-)
diffs (161 lines):
diff -r f361a7524940 -r b2eca0584aaa sys/arch/news68k/dev/zs.c
--- a/sys/arch/news68k/dev/zs.c Wed Dec 29 05:00:43 1999 +0000
+++ b/sys/arch/news68k/dev/zs.c Wed Dec 29 05:01:13 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs.c,v 1.1 1999/12/09 14:53:06 tsutsui Exp $ */
+/* $NetBSD: zs.c,v 1.2 1999/12/29 05:01:13 tsutsui Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -112,7 +112,7 @@
};
static struct zsdevice *zsaddr[NZS];
-static u_long zs_sir;
+static u_char zs_sir;
/* Flags from cninit() */
static int zs_hwflags[NZS][2];
diff -r f361a7524940 -r b2eca0584aaa sys/arch/news68k/include/intr.h
--- a/sys/arch/news68k/include/intr.h Wed Dec 29 05:00:43 1999 +0000
+++ b/sys/arch/news68k/include/intr.h Wed Dec 29 05:01:13 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.h,v 1.1 1999/12/09 14:53:11 tsutsui Exp $ */
+/* $NetBSD: intr.h,v 1.2 1999/12/29 05:01:14 tsutsui Exp $ */
/*
*
@@ -66,22 +66,23 @@
/*
* simulated software interrupt register
*/
-extern u_long ssir;
+extern u_char ssir;
extern volatile u_char *ctrl_int2;
#define NSIR (sizeof(ssir) * 8)
-#define SIR_NET 0x1
-#define SIR_CLOCK 0x2
+#define SIR_NET 0
+#define SIR_CLOCK 1
+#define NEXT_SIR 2
#define siroff(x) ssir &= ~(x)
-#define setsoftint(x) do{ \
- ssir |= (x); \
- *ctrl_int2 = 0xff; \
- }while(0)
-#define setsoftnet() setsoftint(SIR_NET)
-#define setsoftclock() setsoftint(SIR_CLOCK)
+#define setsoftint(x) do { \
+ ssir |= (x); \
+ *ctrl_int2 = 0xff; \
+ } while (0)
+#define setsoftnet() setsoftint(1 << SIR_NET)
+#define setsoftclock() setsoftint(1 << SIR_CLOCK)
-u_long allocate_sir __P((void (*) __P((void *)), void *));
+u_char allocate_sir __P((void (*) __P((void *)), void *));
void init_sir __P((void));
#endif /* _KERNEL */
diff -r f361a7524940 -r b2eca0584aaa sys/arch/news68k/news68k/machdep.c
--- a/sys/arch/news68k/news68k/machdep.c Wed Dec 29 05:00:43 1999 +0000
+++ b/sys/arch/news68k/news68k/machdep.c Wed Dec 29 05:01:13 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.1 1999/12/09 14:53:17 tsutsui Exp $ */
+/* $NetBSD: machdep.c,v 1.2 1999/12/29 05:01:14 tsutsui Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -1035,47 +1035,48 @@
void intrhand_lev3 __P((void));
void intrhand_lev4 __P((void));
void intrhand_lev5 __P((void));
-#if NLE > 0
-int leintr __P((int));
-#endif
-#if NSI > 0
-int si_intr __P((void *));
-#endif
void (*sir_routines[NSIR]) __P((void *));
void *sir_args[NSIR];
-u_long ssir;
+u_char ssir;
int next_sir;
void
intrhand_lev2()
{
- int bit;
+ int bit, s;
+ u_char sintr;
/* disable level 2 interrupt */
*ctrl_int2 = 0;
+
+ s = splhigh();
+ sintr = ssir;
+ ssir = 0;
+ splx(s);
+
intrcnt[2]++;
uvmexp.intrs++;
- while ((bit = ffs(ssir)) != 0) {
- --bit;
- ssir &= ~(1 << bit);
- uvmexp.softs++;
- if (sir_routines[bit])
- sir_routines[bit](sir_args[bit]);
+ for (bit = 0; bit < next_sir; bit++) {
+ if (sintr & (1 << bit)) {
+ uvmexp.softs++;
+ if (sir_routines[bit])
+ sir_routines[bit](sir_args[bit]);
+ }
}
}
/*
* Allocation routines for software interrupts.
*/
-u_long
+u_char
allocate_sir(proc, arg)
void (*proc) __P((void *));
void *arg;
{
int bit;
- if( next_sir >= NSIR )
+ if (next_sir >= NSIR)
panic("allocate_sir: none left");
bit = next_sir++;
sir_routines[bit] = proc;
@@ -1088,9 +1089,9 @@
{
extern void netintr __P((void));
- sir_routines[0] = (void (*) __P((void *)))netintr;
- sir_routines[1] = (void (*) __P((void *)))softclock;
- next_sir = 2;
+ sir_routines[SIR_NET] = (void (*) __P((void *)))netintr;
+ sir_routines[SIR_CLOCK] = (void (*) __P((void *)))softclock;
+ next_sir = NEXT_SIR;
}
@@ -1112,6 +1113,12 @@
intrhand_lev4()
{
int stat;
+#if NLE > 0
+ extern int leintr __P((int));
+#endif
+#if NSI > 0
+ extern int si_intr __P((int));
+#endif
#define INTST_LANCE 0x04
#define INTST_SCSI 0x80
Home |
Main Index |
Thread Index |
Old Index