Skip to contentSkip to conversation

Why does MIPS/Linux always reserve 32 bytes in the top of each process's kernel stack space

DISCUSSION zhan rongkai 2 participants 2 messages Jan 28, 2005 – Jan 29, 2005 MIPS

lore
Share & tools
lore
#0 lore raw

Hi, everyone:

Why does MIPS/Linux always reserve 32 bytes in the top of each process's kernel stack space.

See arch/mips/kernel/process.c:

int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
unsigned long unused, struct task_struct *p, struct pt_regs *regs)

{
	struct thread_info *ti = p->thread_info;
	struct pt_regs *childregs;
	long childksp;

	childksp = (unsigned long)ti + THREAD_SIZE - 32;
        ......
}
Signature · 1 line
Rongkai Zhan
#1 lore raw
Quoted 2 lines · zhan rongkai

Why does MIPS/Linux always reserve 32 bytes in the top of each process's kernel stack space.

Paranoia.

Ralf