Linux MIPS Architecture development
 help / color / mirror / Atom feed
* understanding head.S
@ 2008-06-05 10:02 Chetan Nanda
  2008-06-05 11:15 ` Wang, Baojun
  0 siblings, 1 reply; 3+ messages in thread
From: Chetan Nanda @ 2008-06-05 10:02 UTC (permalink / raw)
  To: linux-mips

Hi All,
I was reading the boot code for MIPS.
in head.S file before jumping to 'start_kernel' it calculate the stack
pointer address as follow:

"
	PTR_LA		$28, init_thread_union
	PTR_ADDIU	sp, $28, _THREAD_SIZE - 32
	set_saved_sp	sp, t0, t1
	PTR_SUBU	sp, 4 * SZREG		# init stack pointer
"

Can anyone please explains me this 4 lines of code?
Why ' _THREAD_SIZE - 32' is added in 'sp' ?
What 'set_saved_sp' will do ?
and then why we subtract '4 * SZREG' from 'sp' ?

Please hep me to understand this code better.

Thanks,
Chetan Nanda

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-06-06  1:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-05 10:02 understanding head.S Chetan Nanda
2008-06-05 11:15 ` Wang, Baojun
2008-06-06  1:24   ` David VomLehn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox