Port-sparc64 archive

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

Re: Stack bias



On Tue, Aug 11, 2009 at 01:20:53AM +0100, raymond.meyer%rambler.ru@localhost 
wrote:
> OK, how does bias of 2047 allow to address more stack space, vs. 32-bit
> mode with no bias? What's the stack limit in 64 and 32-bit modes?

No, this is a misunderstanding. The bias just moves the center of the easily
addressable with small offsets items, assuming you are unlikely to pass
huge amounts of parameters to a function, but could well have lots of
local variables.

The stack size, or the overall addressable range, are not affected - but on
risc huge constants (or offsets) sometimes require extra instructions to
craft their value in a register.

Anyway, the main purpose of the bias is to have an odd stack pointer, so
the kernel can very easily know if it's dealing with a 32bit or 64bit
process in trap handlers, w/o even doing the full curlwp() dance to check
the process flags.

Martin


Home | Main Index | Thread Index | Old Index