Subject: Re: RFC: Change SWI number base?
To: David Laight <david@l8s.co.uk>
From: Richard Earnshaw <rearnsha@arm.com>
List: port-arm
Date: 01/14/2002 14:43:09
> Presumably the return sequence has to be 'bx lr', rather than anything
> else?  Or will the cpu leap to thumb if a normal instruction loads an
> odd pc?

Yes, though on ARM v5T there is an option to make ldr pc and ldm ..., pc} 
also switch into the appropriate mode (though you still need bx lr rather 
than mov pc, lr).

> Presumably the return sequence has to be 'bx lr', rather than anything
> else?  Or will the cpu leap to thumb if a normal instruction loads an
> odd pc?

Thumb mode is determined by bit 0 of the PC (since the real pc will 
*always* be at least half-word aligned).

> > I believe that what we want is exactly the same as several interfaces
> > already in libc, eg:
> > 
> > #ifdef __weak_alias
> > __weak_alias(isatty,_isatty)
> > #endif
> > 
> > int
> > isatty(fd)
> >         int fd;
> > ...
> 
> I wonder sometimes if there should be an option to force references to
> hit the 'reserved' part of the namespace.  It is too easy to forget,
> when writing library code, to explicitely add an '_' to all the
> functions from system header files that are not defined by POSIX!

Let's not take this thread down there as well :-)

R.

You're in a twisty maze of little passages, all different