Subject: Re: cpufunc.h
To: John Fremlin <vii@users.sourceforge.net>
From: Ben Harris <bjh21@netbsd.org>
List: port-arm
Date: 05/29/2001 18:37:45
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.

> 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.

> > I'm also slightly dubious about large-scale use of GCC extensions,
> > but if they stay in header files where we can find them, I shan't
> > mutter too loudly.
>
> At the moment they are spread all over the place in a disorganised
> way. The notion that NetBSD/arm is in any way portable to another
> compiler is quite frankly ridiculous.

That too.  Still, I'd rather not see it get any worse.

-- 
Ben Harris                                                   <bjh21@netbsd.org>
Portmaster, NetBSD/arm26               <URL:http://www.netbsd.org/Ports/arm26/>