implement splraiseipl() for sun2 and sun3. reviewed by Izumi Tsutsui.

This commit is contained in:
yamt 2006-03-29 08:55:40 +00:00
parent 610b4c0dee
commit 29b4acda94
3 changed files with 42 additions and 74 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: intr.h,v 1.6 2006/02/16 20:17:15 perry Exp $ */
/* $NetBSD: intr.h,v 1.7 2006/03/29 08:55:40 yamt Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -41,21 +41,23 @@
#include <machine/psl.h>
/*
* These are identical to the values used by hp300, but are not meaningful
* to sun3 code at this time.
*/
#define IPL_NONE 0 /* disable only this interrupt */
#define IPL_BIO 1 /* disable block I/O interrupts */
#define IPL_NET 2 /* disable network interrupts */
#define IPL_TTY 3 /* disable terminal interrupts */
#define IPL_TTYNOBUF 4 /* IPL_TTY + higher ISR priority */
#define IPL_SERIAL 4 /* disable serial interrupts */
#define IPL_CLOCK 5 /* disable clock interrupts */
#define IPL_HIGH 6 /* disable all interrupts */
#if defined(_KERNEL) && !defined(_LOCORE)
#define IPL_NONE 0
#define IPL_SOFTCLOCK (PSL_S|PSL_IPL1)
#define IPL_SOFTNET (PSL_S|PSL_IPL1)
#define IPL_BIO (PSL_S|PSL_IPL2)
#define IPL_NET (PSL_S|PSL_IPL3)
#define IPL_TTY (PSL_S|PSL_IPL4)
#define IPL_VM (PSL_S|PSL_IPL4)
/* Intersil clock hardware interrupts (hard-wired at 5) */
#define IPL_CLOCK (PSL_S|PSL_IPL5)
#define IPL_STATCLOCK IPL_CLOCK
#define IPL_SCHED (PSL_S|PSL_IPL7)
#define IPL_HIGH (PSL_S|PSL_IPL7)
#define IPL_LOCK (PSL_S|PSL_IPL7)
#define IPL_SERIAL (PSL_S|PSL_IPL4)
/*
* Define inline functions for PSL manipulation.
* These are as close to macros as one can get.
@ -89,29 +91,10 @@ _getsr(void)
/* IPL used by soft interrupts: netintr(), softclock() */
#define spllowersoftclock() spl1()
#define splsoftclock() splraise1()
#define splsoftnet() splraise1()
/* Highest block device (strategy) IPL. */
#define splbio() splraise2()
#define splraiseipl(x) _splraise(x)
/* Highest network interface IPL. */
#define splnet() splraise3()
/* Highest tty device IPL. */
#define spltty() splraise4()
/* Highest network, tty, or disk IPL. */
#define splvm() _splraise(PSL_S|PSL_IPL4)
/* Intersil clock hardware interrupts (hard-wired at 5) */
#define splclock() splraise5()
#define splstatclock() splclock()
/* Block out all interrupts (except NMI of course). */
#define splhigh() spl7()
#define splsched() spl7()
#define spllock() spl7()
#include <sys/spl.h>
#endif /* KERNEL && !_LOCORE */
#endif /* _SUN3_INTR_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: intr.h,v 1.6 2006/02/16 20:17:15 perry Exp $ */
/* $NetBSD: intr.h,v 1.7 2006/03/29 08:55:40 yamt Exp $ */
/*
* Copyright (c) 2001 Matt Fredette.
@ -46,13 +46,22 @@
#define _IPL_SOFT_LEVEL3 3
#define _IPL_SOFT_LEVEL_MIN 1
#define _IPL_SOFT_LEVEL_MAX 3
#define IPL_SOFTNET _IPL_SOFT_LEVEL1
#define IPL_SOFTCLOCK _IPL_SOFT_LEVEL1
#define IPL_SOFTSERIAL _IPL_SOFT_LEVEL3
#define IPL_BIO 2
#define IPL_NET 3
#define IPL_CLOCK 5
#define IPL_SERIAL 6
#define IPL_NONE 0
#define IPL_SOFTCLOCK (PSL_S|PSL_IPL1)
#define IPL_SOFTNET (PSL_S|PSL_IPL1)
#define IPL_BIO (PSL_S|PSL_IPL2)
#define IPL_NET (PSL_S|PSL_IPL3)
#define IPL_SOFTSERIAL (PSL_S|PSL_IPL3)
#define IPL_TTY (PSL_S|PSL_IPL4)
#define IPL_VM (PSL_S|PSL_IPL4)
/* Intersil or Am9513 clock hardware interrupts (hard-wired at 5) */
#define IPL_CLOCK (PSL_S|PSL_IPL5)
#define IPL_STATCLOCK IPL_CLOCK
#define IPL_SCHED (PSL_S|PSL_IPL7)
#define IPL_HIGH (PSL_S|PSL_IPL7)
#define IPL_LOCK (PSL_S|PSL_IPL7)
#define IPL_SERIAL (PSL_S|PSL_IPL6)
#ifdef _KERNEL
LIST_HEAD(sh_head, softintr_handler);
@ -123,42 +132,17 @@ _getsr(void)
/* IPL used by soft interrupts: netintr(), softclock() */
#define spllowersoftclock() spl1()
#define splsoftclock() splraise1()
#define splsoftnet() splraise1()
/* Highest block device (strategy) IPL. */
#define splbio() splraise2()
/* Highest network interface IPL. */
#define splnet() splraise3()
/* Highest tty device IPL. */
#define spltty() splraise4()
/*
* Requirement: imp >= (highest network, tty, or disk IPL)
* This is used mostly in the VM code.
* Note that the VM code runs at spl7 during kernel
* initialization, and later at spl0, so we have to
* use splraise to avoid enabling interrupts early.
*/
#define splvm() _splraise(PSL_S|PSL_IPL4)
/* Intersil or Am9513 clock hardware interrupts (hard-wired at 5) */
#define splclock() splraise5()
#define splstatclock() splclock()
/* Zilog Serial hardware interrupts (hard-wired at 6) */
#define splzs() spl6()
/* Block out all interrupts (except NMI of course). */
#define splhigh() spl7()
#define splsched() spl7()
#define spllock() spl7()
/* This returns true iff the spl given is spl0. */
#define is_spl0(s) (((s) & PSL_IPL7) == 0)
#define splraiseipl(x) _splraise(x)
#include <sys/spl.h>
#endif /* _KERNEL */
#endif /* _SUN68K_INTR_H */

View File

@ -1,4 +1,4 @@
/* $NetBSD: isr.c,v 1.7 2005/12/11 12:19:29 christos Exp $ */
/* $NetBSD: isr.c,v 1.8 2006/03/29 08:55:40 yamt Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: isr.c,v 1.7 2005/12/11 12:19:29 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: isr.c,v 1.8 2006/03/29 08:55:40 yamt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -306,6 +306,7 @@ softintr_establish(int ipl, void (*func)(void *), void *arg)
struct softintr_handler *sh;
struct softintr_head *shd;
ipl &= ~PSL_S;
if (ipl < _IPL_SOFT_LEVEL_MIN || ipl > _IPL_SOFT_LEVEL_MAX)
panic("softintr_establish: unsupported soft IPL");