Subject: Re: Optimising m68k's _splraise()
To: None <steve@mctavish.co.uk>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: port-m68k
Date: 12/10/2000 11:46:25
In <Pine.NEB.4.21.0012092257580.12432-100000@oor-wullie.mctavish.co.uk>
steve@mctavish.co.uk wrote:

> 	if ((unsigned short)level >= PSL_HIGHIPL ||
> 	    (unsigned short)level > (unsigned short)sr)
> 		__asm __volatile("movw %0,%%sr" :: "di" (level));

I prefer to use (u_int16_t) rather than (unsigned short).
(though they are identical on m68k)

> I have a related optimisation for mvme68k's splx() function. It previously
> *always* called into locore's spl0() function if dropping to IPLLOW,
> regardless of whether or not a softint was pending. It now tests for a
> softint inline. This may be useful for other m68k ports which have
> simulated software interrupts.

Some ports have getsr() in locore.s, but sun3 has inline version.
getsr() is called from few place (mostly isrdispatch_vectored())
but is it worth to make it inline? In that case, is "clrl %0" needed?

(Actually, I don't know m68k asm very well :-)
---
Izumi Tsutsui
tsutsui@ceres.dti.ne.jp