Subject: Re: cpufunc.h
To: John Fremlin <>
From: Ben Harris <>
List: port-arm
Date: 05/29/2001 15:28:10
On 29 May 2001, John Fremlin wrote:

> Ben Harris <> writes:
> > For the first, we presumably don't have an existing SetCPSR,
> One exists already. The __SetCPSR is just a simpler primitive -
> i.e. no worrying about bitmasks etc.

Hrm.  So SetCPSR should really be called SetSomeOfCPSR? *grin*  I think it
needs to be made clear that __SetCPSR is an internal function, and things
shouldn't call it directly.

> > > Would this patch be accepted?
> >
> > Probably.  I really need to overhaul cpufunc properly one day, but
> > patches to make it nicer are always helpful.
> Here is the patch. After it is merged and explicit extern decls are
> fixed, the assembly files implementing the stackptr and CPSR routines
> can be removed. Note that the psionw port is not yet able to usefully
> test these routines, so they might be doing completely the wrong
> thing, and because I renamed the __?et_stack_pointer functions the
> patch might not even compile :-)

Hmm.  I don't like the idea of splitting up the stack-pointer setting
functions.  GCC is entitled to bugger around with the stack in between the
mode change and setting the stack pointer, and this could mess up an
entirely different stack from the one it's meant to be running on.

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

Ben Harris                                                   <>
Portmaster, NetBSD/arm26               <URL:>