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, Aug 22, 2009 at 05:02:17PM +0100, raymond.meyer%rambler.ru@localhost 
> 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?

Probably none :-)

There is a bug that say that the netbsd libraries don't conform to the
sparc ABI because gcc uses some of the global registers that the abi
says are reserved for applications.

Mostly the global registers are either scratch or have fixed values.

If you want a value preserved use a %i register!


David Laight: david%l8s.co.uk@localhost

Home | Main Index | Thread Index | Old Index