Fix softnet intr handling (to be like the generic ppc softintr).

This commit is contained in:
matt 2004-06-01 00:49:41 +00:00
parent 5e4b83e60b
commit 3c0ef6aa5f
2 changed files with 14 additions and 35 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: extintr.c,v 1.11 2003/07/15 02:54:45 lukem Exp $ */
/* $NetBSD: extintr.c,v 1.12 2004/06/01 00:49:41 matt Exp $ */
/*
* Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.11 2003/07/15 02:54:45 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.12 2004/06/01 00:49:41 matt Exp $");
#include "opt_marvell.h"
#include "opt_kgdb.h"
@ -156,6 +156,8 @@ struct intrhand {
struct intrsource intr_sources[NIRQ];
struct intrhand *softnet_handlers[32];
const char intr_source_strings[NIRQ][16] = {
"unknown 0", "dev", "dma", "cpu",
"idma 01", "idma 23", "idma 45", "idma 67",
@ -269,23 +271,6 @@ cntlzw(int x)
return a;
}
static void
xsoftnet(void *arg)
{
int pendisr;
__asm __volatile(
"1: lwarx %0,0,%2\n"
" stwcx. %1,0,%2\n"
" bne- 1b\n"
" sync"
: "=&r"(pendisr)
: "r"(0), "r"(&netisr)
: "cr0");
softnet(pendisr);
}
void *softnet_si;
/*
* softintr_init - establish softclock, softnet; reserve SIR_HWCLOCK
*/
@ -294,9 +279,11 @@ softintr_init(void)
{
intr_sources[SIR_HWCLOCK].is_type = IST_CLOCK; /* exclusive */
softnet_si = softintr_establish(IPL_SOFTNET, xsoftnet, NULL);
if (softnet_si == NULL)
panic("softintr_init: cannot softintr_establish IPL_SOFTNET");
#define DONETISR(n, f) \
softnet_handlers[(n)] = \
softintr_establish(IPL_SOFTNET, (void (*)(void *))(f), NULL)
#include <net/netisr_dispatch.h>
#undef DONETISR
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: marvell_intr.h,v 1.6 2003/09/03 21:33:36 matt Exp $ */
/* $NetBSD: marvell_intr.h,v 1.7 2004/06/01 00:49:41 matt Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -476,6 +476,10 @@ spllower(int ncpl)
#define splsoftnet() splraise(IPL_SOFTNET)
#define splsoftserial() splraise(IPL_SOFTSERIAL)
struct intrhand;
extern struct intrhand *softnet_handlers[];
#define schednetisr(an_isr) softintr_schedule(softnet_handlers[(an_isr)])
#define __HAVE_GENERIC_SOFT_INTERRUPTS /* should be in <machine/types.h> */
void *softintr_establish(int level, void (*fun)(void *), void *arg);
void softintr_disestablish(void *cookie);
@ -512,18 +516,6 @@ void softserial(void);
#endif
void strayintr(int);
#define schednetisr(isr) do { \
__asm __volatile( \
"1: lwarx 0,0,%1\n" \
" or 0,0,%0\n" \
" stwcx. 0,0,%1\n" \
" bne- 1b" \
: \
: "r"(1 << (isr)), "b"(&netisr) \
: "cr0", "r0"); \
softintr_schedule(softnet_si); \
} while (/*CONSTCOND*/ 0)
/*
* defines for indexing intrcnt
*/