Brian Xu - Sun Microsystems - Beijing China wrote:
> Greg Price ??:
>>
>>
>
>
> I still have the question that who produces those 'bias area' and when?
>
>
When the stack pointer is initialized for a thread when the thread is
created,
the bias is subtracted to get an initial stack pointer value. Again,
see the code
in thread_load() which is (at least) one place where the stack pointer
is initialized.
>
> It is obvious that before or just after the 'save' instruction, the
> %sp has been moved to the bottom of the bias. so it must be the 'call'
> or the 'save' instruction that does it. I want to know.
>
No. The save instruction doesn't need to do anything with the stack
pointer as far as the
bias is concerned. The bias is already "in" the stack pointer when the
save is executed.
The call also does not need to do anything with the stack pointer. It
is only when code
needs to access/store data on the stack, and when the thread is
initialized, that the
bias value needs to be used.
max