Subject: Re: RFC: Change SWI number base?
To: None <port-arm@netbsd.org>
From: David Laight <David.Laight@btinternet.com>
List: port-arm
Date: 01/08/2002 16:07:03
> > Ok - make the thumb code:
> >     .balign  4
> >     .short   syscall & 0xffff
> > entry:
> >     swi      syscall >> 16
> >     bcs      __cerror
> >     ret
> >
> > And do a 32 bit load from pc-4 (as in the current ARM version).
> 
> That is a truly evil hack.  Well done.

tu...

How we (netbsd) does the system call is something we will have to live
with - and own up to...
The above code has the simplicity of making the thumb code match the
existing arm interface.
It also leaves the glorious hack in one .S file.

I suspect it is also almost the cheapest, the swi code has the user PC
lurking - so the only issue is reading the syscall number into the data
cache.

Loading a 24bit constant takes 3 instructions on ARM (or a data read),
Doing it without a data read in thumb must be more - likely to spill
the stub into a second cache line?

I'd vote for the small stub...

> Unfortunately, it won't work on big-endian systems (which we might well
> end up supporting some day).

Has anyone built any hardware that expects to run arm big-endian?
I guess (like 68k) it would require byte ports on D24-31, so you
can't (sensibly) run anything other than what the hardware designer
built.

    David