Subject: Re: splraiseipl()
To: None <>
From: Izumi Tsutsui <>
List: tech-kern
Date: 05/08/2006 19:08:24
In article <> wrote:

> > - style of '#define<space>' or '#define<tab>' shouldn't be changed
> >   in each file
> then i'll change all of them to use "#define<tab>".  ok?

Ah, okay, now I see intr.h of luna68k and next68k are already

> > - is splsoft() still needed?
> i don't know.

At least it can be removed from news68k/include/intr.h.

> > - do you have any idea for hp300? should all spl levels refer hp300_ipls[]?
> do you mean how to implement splraiseipl() for hp300?
> it can be similar to mac68k, i guess.
> what's level specific macro?

On hp300, some spl levels (bio, net, tty etc.) are computed
at boot time, but others (high, soft) could be constants.
I know such micro optimization would not be so useful,
but I thought it might be better if it could be specified easily.

> > - it looks weird a bit to define IPL_* macro as (PSL_S|PSL_IPL?)
> >   because IPL_* macros are used to specify interrupt priority order
> >   on some ports (hp300, some mips etc).
> how are hp300 and mips related to this patch?

On hp300, IPL_* macros already have some meaning:
>> /*
>>  * Interrupt "levels".  These are a more abstract representation
>>  * of interrupt levels, and do not have the same meaning as m68k
>>  * CPU interrupt levels.  They serve two purposes:
>>  *
>>  *      - properly order ISRs in the list for that CPU ipl
>>  *      - compute CPU PSL values for the spl*() calls.
>>  */
>>#define IPL_NONE        0       /* disable only this interrupt */

but in <sys/spl.h> IPL_* macros are used as opaque values passed
to splraise(). Maybe we should rename either of them, but it
might cause some confusion to use existing names for splraiseipl(),
as you wrote in PR/33218.

If we introduce new independent SPL_* macros, we could define them like:
#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_CLOCK	5	/* disable clock interrupts */
#define	IPL_HIGH	6	/* disable all interrupts */
#define	spllowersoftclock() spl1()

#define	SPL_BIO		(hp300_ipls[HP300_IPL_BIO])
#define	SPL_NET		(hp300_ipls[HP300_IPL_NET])
#define	SPL_TTY		(hp300_ipls[HP300_IPL_TTY])
#define	SPL_SERIAL	(hp300_ipls[HP300_IPL_TTY])
#define	SPL_VM		(hp300_ipls[HP300_IPL_VM])
then all m68k ports could have the same meanings of SPL_*,
definition of splraiseipl() could be defined as
"#define splraiseipl(ipl) _splraise(ipl)" in common <m68k/psl.h>.

Just my two cents...
Izumi Tsutsui