Implement support for softintrs.
Reviewed, corrected and tested by aymeric@.
This commit is contained in:
parent
0cc210063b
commit
4eca7e7c2d
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: files.ofppc,v 1.25 2007/01/14 22:18:02 aymeric Exp $
|
||||
# $NetBSD: files.ofppc,v 1.26 2007/03/10 14:15:48 jmmv Exp $
|
||||
#
|
||||
# NetBSD/ofppc configuration info
|
||||
#
|
||||
|
@ -24,6 +24,8 @@ file dev/cons.c
|
|||
file dev/cninit.c
|
||||
|
||||
file arch/powerpc/powerpc/procfs_machdep.c procfs
|
||||
file arch/powerpc/powerpc/softintr.c
|
||||
|
||||
#
|
||||
# CPU specific OpenFirmware code
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: firepower_intr.c,v 1.9 2006/11/24 21:20:05 wiz Exp $ */
|
||||
/* $NetBSD: firepower_intr.c,v 1.10 2007/03/10 14:15:48 jmmv Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2001 Wasabi Systems, Inc.
|
||||
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: firepower_intr.c,v 1.9 2006/11/24 21:20:05 wiz Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: firepower_intr.c,v 1.10 2007/03/10 14:15:48 jmmv Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -749,11 +749,9 @@ firepower_pciide_compat_intr_establish(void *v, struct device *dev,
|
|||
void
|
||||
firepower_do_softnet()
|
||||
{
|
||||
int pisr, s;
|
||||
int s;
|
||||
|
||||
s = splsoftnet();
|
||||
pisr = netisr;
|
||||
netisr = 0;
|
||||
softnet(pisr);
|
||||
softintr__run(IPL_SOFTNET);
|
||||
splx(s);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: intr.h,v 1.8 2007/02/16 02:53:49 ad Exp $ */
|
||||
/* $NetBSD: intr.h,v 1.9 2007/03/10 14:15:48 jmmv Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2001 Wasabi Systems, Inc.
|
||||
|
@ -98,6 +98,10 @@
|
|||
#ifdef _KERNEL
|
||||
#ifndef _LOCORE
|
||||
|
||||
#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
|
||||
#include <powerpc/softintr.h>
|
||||
#endif
|
||||
|
||||
struct clockframe;
|
||||
|
||||
extern int imask[];
|
||||
|
@ -133,6 +137,7 @@ extern struct machvec machine_interface;
|
|||
|
||||
#define setsoftnet() setsoftintr(IPL_SOFTNET)
|
||||
#define setsoftclock() setsoftintr(IPL_SOFTCLOCK)
|
||||
#define setsoftserial() setsoftintr(IPL_SERIAL)
|
||||
|
||||
/*
|
||||
* Software interrupt support.
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* $NetBSD: types.h,v 1.6 2006/09/13 07:14:35 gdamore Exp $ */
|
||||
/* $NetBSD: types.h,v 1.7 2007/03/10 14:15:48 jmmv Exp $ */
|
||||
|
||||
#include <powerpc/types.h>
|
||||
|
||||
#define __HAVE_DEVICE_REGISTER
|
||||
#define __HAVE_GENERIC_SOFT_INTERRUPTS
|
||||
#define __HAVE_GENERIC_TODR
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: machdep.c,v 1.90 2007/02/09 21:55:07 ad Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.91 2007/03/10 14:15:48 jmmv Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
||||
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.90 2007/02/09 21:55:07 ad Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.91 2007/03/10 14:15:48 jmmv Exp $");
|
||||
|
||||
#include "opt_compat_netbsd.h"
|
||||
#include "opt_ddb.h"
|
||||
|
@ -64,6 +64,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.90 2007/02/09 21:55:07 ad Exp $");
|
|||
#include <dev/ofw/openfirm.h>
|
||||
|
||||
#include <machine/autoconf.h>
|
||||
#include <machine/intr.h>
|
||||
#include <machine/pmap.h>
|
||||
#include <machine/powerpc.h>
|
||||
#include <machine/trap.h>
|
||||
|
@ -188,6 +189,9 @@ cpu_startup()
|
|||
*/
|
||||
splhigh();
|
||||
mtmsr(mfmsr() | PSL_EE | PSL_RI);
|
||||
#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
|
||||
softintr__init();
|
||||
#endif
|
||||
if (platform.softintr_init != NULL)
|
||||
platform.softintr_init();
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ofwgen_intr.c,v 1.10 2006/11/24 21:20:05 wiz Exp $ */
|
||||
/* $NetBSD: ofwgen_intr.c,v 1.11 2007/03/10 14:15:48 jmmv Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1997 Wolfgang Solfrank.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ofwgen_intr.c,v 1.10 2006/11/24 21:20:05 wiz Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ofwgen_intr.c,v 1.11 2007/03/10 14:15:48 jmmv Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -202,17 +202,15 @@ do_pending_int(void)
|
|||
cpl |= imask[IPL_SOFTCLOCK];
|
||||
ipending &= ~B(IPL_SOFTCLOCK);
|
||||
mtmsr(emsr);
|
||||
softclock(NULL);
|
||||
softintr__run(IPL_SOFTCLOCK);
|
||||
continue;
|
||||
}
|
||||
if ((ipending & B(IPL_SOFTNET)) != 0 &&
|
||||
(cpl & B(IPL_SOFTNET)) == 0) {
|
||||
int pisr = netisr;
|
||||
netisr = 0;
|
||||
cpl |= imask[IPL_SOFTNET];
|
||||
ipending &= ~B(IPL_SOFTNET);
|
||||
mtmsr(emsr);
|
||||
softnet(pisr);
|
||||
softintr__run(IPL_SOFTNET);
|
||||
continue;
|
||||
}
|
||||
if ((ipending & B(IPL_SOFT)) != 0 &&
|
||||
|
@ -323,17 +321,15 @@ intr_return(struct clockframe *frame, int level)
|
|||
cpl |= imask[IPL_SOFTCLOCK];
|
||||
ipending &= ~B(IPL_SOFTCLOCK);
|
||||
mtmsr(emsr);
|
||||
softclock(NULL);
|
||||
softintr__run(IPL_SOFTCLOCK);
|
||||
continue;
|
||||
}
|
||||
if ((ipending & B(IPL_SOFTNET)) != 0 &&
|
||||
(cpl & B(IPL_SOFTNET)) == 0) {
|
||||
int pisr = netisr;
|
||||
netisr = 0;
|
||||
cpl |= imask[IPL_SOFTNET];
|
||||
ipending &= ~B(IPL_SOFTNET);
|
||||
mtmsr(emsr);
|
||||
softnet(pisr);
|
||||
softintr__run(IPL_SOFTNET);
|
||||
continue;
|
||||
}
|
||||
if ((ipending & B(IPL_SOFT)) != 0 &&
|
||||
|
|
Loading…
Reference in New Issue