Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/macppc Add latent generic soft interrupt support.
details: https://anonhg.NetBSD.org/src/rev/2fc21168feeb
branches: trunk
changeset: 559855:2fc21168feeb
user: matt <matt%NetBSD.org@localhost>
date: Wed Mar 24 19:42:04 2004 +0000
description:
Add latent generic soft interrupt support.
diffstat:
sys/arch/macppc/dev/zs.c | 21 +++++++++++++++++++--
sys/arch/macppc/include/autoconf.h | 4 +++-
sys/arch/macppc/include/intr.h | 13 ++++---------
sys/arch/macppc/include/z8530var.h | 5 ++++-
sys/arch/macppc/macppc/extintr.c | 20 ++++++++++++++++++--
sys/arch/macppc/macppc/machdep.c | 6 ++++--
6 files changed, 52 insertions(+), 17 deletions(-)
diffs (260 lines):
diff -r 92b517b5b43a -r 2fc21168feeb sys/arch/macppc/dev/zs.c
--- a/sys/arch/macppc/dev/zs.c Wed Mar 24 19:37:10 2004 +0000
+++ b/sys/arch/macppc/dev/zs.c Wed Mar 24 19:42:04 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs.c,v 1.28 2003/12/04 13:05:16 keihan Exp $ */
+/* $NetBSD: zs.c,v 1.29 2004/03/24 19:42:04 matt Exp $ */
/*
* Copyright (c) 1996, 1998 Bill Studenmund
@@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.28 2003/12/04 13:05:16 keihan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.29 2004/03/24 19:42:04 matt Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -395,6 +395,11 @@
intr_establish(intr[1][1], IST_LEVEL, IPL_TTY, zs_txdma_int, (void *)1);
#endif
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
+ zsc->zsc_si = softintr_establish(IPL_SOFTSERIAL,
+ (void (*)(void *)) zsc_intr_soft, zsc);
+#endif
+
/*
* Set the master interrupt enable and interrupt vector.
* (common to both channels, do it on A)
@@ -455,7 +460,9 @@
#endif
}
+#ifndef __HAVE_GENERIC_SOFT_INTERRUPTS
static int zssoftpending;
+#endif
/*
* Our ZS chips all share a common, autovectored interrupt,
@@ -477,17 +484,22 @@
if ((zsc->zsc_cs[0]->cs_softreq) ||
(zsc->zsc_cs[1]->cs_softreq))
{
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
+ softintr_schedule(zsc->zsc_si);
+#else
/* zsc_req_softint(zsc); */
/* We are at splzs here, so no need to lock. */
if (zssoftpending == 0) {
zssoftpending = 1;
setsoftserial();
}
+#endif
}
}
return (rval);
}
+#ifndef __HAVE_GENERIC_SOFT_INTERRUPTS
/*
* Similar scheme as for zshard (look at all of them)
*/
@@ -516,6 +528,7 @@
}
return (1);
}
+#endif
#ifdef ZS_TXDMA
int
@@ -535,10 +548,14 @@
zstty_txdma_int(cs);
if (cs->cs_softreq) {
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
+ softintr_schedule(zsc->zsc_si);
+#else
if (zssoftpending == 0) {
zssoftpending = 1;
setsoftserial();
}
+#endif
}
return 1;
}
diff -r 92b517b5b43a -r 2fc21168feeb sys/arch/macppc/include/autoconf.h
--- a/sys/arch/macppc/include/autoconf.h Wed Mar 24 19:37:10 2004 +0000
+++ b/sys/arch/macppc/include/autoconf.h Wed Mar 24 19:42:04 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.h,v 1.5 2002/07/05 18:45:17 matt Exp $ */
+/* $NetBSD: autoconf.h,v 1.6 2004/03/24 19:42:04 matt Exp $ */
/*-
* Copyright (C) 1998 Internet Research Institute, Inc.
@@ -82,10 +82,12 @@
int ofb_is_console __P((void));
int ofb_cnattach __P((void));
+#ifndef __HAVE_GENERIC_SOFT_INTERRUPTS
/* these are in dev/zs.c */
int zssoft __P((void *));
/* these are in ../../dev/ic/com.c */
void comsoft __P((void));
+#endif
#endif /* _MACHINE_AUTOCONF_H_ */
diff -r 92b517b5b43a -r 2fc21168feeb sys/arch/macppc/include/intr.h
--- a/sys/arch/macppc/include/intr.h Wed Mar 24 19:37:10 2004 +0000
+++ b/sys/arch/macppc/include/intr.h Wed Mar 24 19:42:04 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.h,v 1.20 2003/09/03 21:33:32 matt Exp $ */
+/* $NetBSD: intr.h,v 1.21 2004/03/24 19:42:04 matt Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -65,6 +65,9 @@
#define IST_LEVEL 3 /* level-triggered */
#ifndef _LOCORE
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
+#include <powerpc/softintr.h>
+#endif
/*
* Interrupt handler chains. intr_establish() inserts a handler into
@@ -134,14 +137,6 @@
#define setsoftnet() softintr(SIR_NET)
#define setsoftserial() softintr(SIR_SERIAL)
-extern long intrcnt[];
-
-#define CNT_IRQ0 0
-#define CNT_CLOCK 64
-#define CNT_SOFTCLOCK 65
-#define CNT_SOFTNET 66
-#define CNT_SOFTSERIAL 67
-
#ifdef MULTIPROCESSOR
#define MACPPC_IPI_HALT 0x0001
#define MACPPC_IPI_FLUSH_FPU 0x0002
diff -r 92b517b5b43a -r 2fc21168feeb sys/arch/macppc/include/z8530var.h
--- a/sys/arch/macppc/include/z8530var.h Wed Mar 24 19:37:10 2004 +0000
+++ b/sys/arch/macppc/include/z8530var.h Wed Mar 24 19:42:04 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: z8530var.h,v 1.7 2003/08/07 16:28:24 agc Exp $ */
+/* $NetBSD: z8530var.h,v 1.8 2004/03/24 19:42:04 matt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -140,6 +140,9 @@
dbdma_regmap_t *zsc_txdmareg[2];
dbdma_command_t *zsc_txdmacmd[2];
/* XXX tx only, for now */
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
+ void *zsc_si; /* softintr handler */
+#endif
};
/*
diff -r 92b517b5b43a -r 2fc21168feeb sys/arch/macppc/macppc/extintr.c
--- a/sys/arch/macppc/macppc/extintr.c Wed Mar 24 19:37:10 2004 +0000
+++ b/sys/arch/macppc/macppc/extintr.c Wed Mar 24 19:42:04 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: extintr.c,v 1.41 2004/02/13 11:36:15 wiz Exp $ */
+/* $NetBSD: extintr.c,v 1.42 2004/03/24 19:42:53 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -74,7 +74,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.41 2004/02/13 11:36:15 wiz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.42 2004/03/24 19:42:53 matt Exp $");
#include "opt_multiprocessor.h"
@@ -726,7 +726,11 @@
splsoftserial();
mtmsr(emsr);
KERNEL_LOCK(LK_CANRECURSE|LK_EXCLUSIVE);
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
+ softintr__run(IPL_SOFTSERIAL);
+#else
softserial();
+#endif
KERNEL_UNLOCK();
mtmsr(dmsr);
ci->ci_cpl = pcpl;
@@ -734,14 +738,22 @@
goto again;
}
if ((ci->ci_ipending & ~pcpl) & (1 << SIR_NET)) {
+#ifndef __HAVE_GENERIC_SOFT_INTERRUPTS
int pisr;
+#endif
ci->ci_ipending &= ~(1 << SIR_NET);
splsoftnet();
+#ifndef __HAVE_GENERIC_SOFT_INTERRUPTS
pisr = netisr;
netisr = 0;
+#endif
mtmsr(emsr);
KERNEL_LOCK(LK_CANRECURSE|LK_EXCLUSIVE);
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
+ softintr__run(IPL_SOFTNET);
+#else
softnet(pisr);
+#endif
KERNEL_UNLOCK();
mtmsr(dmsr);
ci->ci_cpl = pcpl;
@@ -753,7 +765,11 @@
splsoftclock();
mtmsr(emsr);
KERNEL_LOCK(LK_CANRECURSE|LK_EXCLUSIVE);
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
+ softintr__run(IPL_SOFTCLOCK);
+#else
softclock(NULL);
+#endif
KERNEL_UNLOCK();
mtmsr(dmsr);
ci->ci_cpl = pcpl;
diff -r 92b517b5b43a -r 2fc21168feeb sys/arch/macppc/macppc/machdep.c
--- a/sys/arch/macppc/macppc/machdep.c Wed Mar 24 19:37:10 2004 +0000
+++ b/sys/arch/macppc/macppc/machdep.c Wed Mar 24 19:42:04 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.129 2003/10/20 00:12:10 matt Exp $ */
+/* $NetBSD: machdep.c,v 1.130 2004/03/24 19:44:20 matt Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.129 2003/10/20 00:12:10 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.130 2004/03/24 19:44:20 matt Exp $");
#include "opt_compat_netbsd.h"
#include "opt_ddb.h"
@@ -302,6 +302,7 @@
printf("dumpsys: TBD\n");
}
+#ifndef __HAVE_GENERIC_SOFT_INTERRUPTS
#include "zsc.h"
#include "com.h"
/*
@@ -317,6 +318,7 @@
comsoft();
#endif
}
+#endif
#if 0
/*
Home |
Main Index |
Thread Index |
Old Index