Subject: Re: cpufunc.h
To: John Fremlin <firstname.lastname@example.org>
From: Ben Harris <email@example.com>
Date: 05/29/2001 21:52:42
On 29 May 2001, John Fremlin wrote:
> Ben Harris <firstname.lastname@example.org> writes:
> > On 29 May 2001, John Fremlin wrote:
> > > > I think it needs to be made clear that __SetCPSR is an internal
> > > > function, and things shouldn't call it directly.
> > >
> > > Why not? It's handy first thing in bootstrap where you don't care what
> > > the CPSR was before. It is also handy for the set_stackptr stuff.
> > In that case it should have a name that makes it clear how it
> > differs from SetCPSR (or SetCPSR should be renamed). I really don't
> > like the idea of having two public functions whose names differ only
> > in the number of underscores at the front.
> I guess I spend too much time with linux sources. SetCPSR is a damn
> fool name anyway and a damn fool primitive. However it is used in a
> bunch of places. I've changed __SetCPSR to set_cpsr in my local tree.
That's a more sensible name. Most of the occurrances of SetCPSR seem to
be being used to disable IRQs and restore their previous state, so we
should probably have an API specifically to do that.
> > > Is the current assembly SetCPSR even valid? It can clobber a bunch of
> > > registers on mode change. Are all these registers caller save in the
> > > abi?
> > r0-r3, r12 are all caller-saved.
> Then the current code setcpsr.S code is screwed because set_cpsr can
> clobber "r8","r9","r10","r11","r12","r13","r14".
This is only true if it's ever used to change mode, which I'm fairly sure
Ben Harris <email@example.com>
Portmaster, NetBSD/arm26 <URL:http://www.netbsd.org/Ports/arm26/>