linux-mips
[Top] [All Lists]

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

To: linux-mips@linux-mips.org
Subject: Why does MIPS/Linux always reserve 32 bytes in the top of each process's kernel stack space
From: zhan rongkai <zhanrk@gmail.com>
Date: Fri, 28 Jan 2005 10:59:26 +0800
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=OkGRGhH+ZFplJfK3kaFs3LWziHMJo0yfXII9a1pIA5Kupm618XGVO2kfb8GGhX64r4TIbEW2LbAgOFy9iBmZccPJmh4E4Cfps+H/N3mMp4TcTo5e+GEdq75Ef/gzCe9fHJEObm4t0+wk8tdXcl7e42OwvgYHmiUEZf7pk8RPUjo=
Original-recipient: rfc822;linux-mips@linux-mips.org
Reply-to: zhan rongkai <zhanrk@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
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;
        ......
}

-- 
Rongkai Zhan

<Prev in Thread] Current Thread [Next in Thread>