Port-sparc64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sparc v9 global register usage



On Sat, 22 Aug 2009, raymond.meyer%rambler.ru@localhost wrote:

> What ABI does NetBSD follow on sparc v9 in regard to global registers,
> i.e. is it different to the following:
> 
> http://developers.sun.com/solaris/articles/sparcv9abi.html
> 
> Say I have the following code:
> 
> 1. set global reg G to memory address;
> 2. call library function;
> 3. use global reg G to load data at that memory address;
> 
> At line 3 I get segmentation fault, I assume that's because when I call
> library function at line 2, it resets that global register to some
> other value.
> 
> So, what global registers can I use which are not volatile across
> function/library calls?

I wouldn't use globals.  Quite a few of the assembly language routines in 
libc are directly from the SPARC v8 or predate the current V9 ABI code 
thus have different register use conventions.  I suppose someone who has 
lots of time to waste could audit the register use in the libraries and 
ld.so and make them V9 ABI compiant.

Eduardo


Home | Main Index | Thread Index | Old Index