linux-mips
[Top] [All Lists]

Re: handle_sys question

To: David Daney <david.daney@cavium.com>
Subject: Re: handle_sys question
From: Songmao Tian <kingkongmao@gmail.com>
Date: Wed, 23 May 2012 16:17:21 +0800
Cc: linux-mips <linux-mips@linux-mips.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=mtzBsZT7O6PhFEgDzAFMBCMKTX3lJfDLDyWFyBQapAw=; b=CQ6m3MR6553TjKFm1DxUwpq9U2zb22icj58wYqQ0a4v3MS2dK+TwidZBBfICsMcOdM s5U7zEopc5y5w22MZCb7gWw9OnbOxr8znveATsPRmyOVnk5BL07D53fQldSSkEsLSdPa n4zIBa9/Llo6TC4P2+8U62P4SXMB1LTO4so6paLPifhwU/sFPggXsKBPbaI83vtXtVpM p4auWhmmyxH7+L8bcYmmOTnDWKaFv9Y5kxq9fdnu9/IMyj0eI2660CDYiBhwhW026FJh U5m0WCEDQk+Q1DuyCpjMNPhXuo2unobOcn7JHOmG/Qe2zcCfoRHozQcdXs+L4RLxSzXT u20A==
In-reply-to: <4FBBED1F.5010307@cavium.com>
References: <CADSewLWvfVsQob-y5Q9mc31JpecHFd6=5dRhKxdH3VvT0HXJZQ@mail.gmail.com> <4FBBED1F.5010307@cavium.com>
Sender: linux-mips-bounce@linux-mips.org
OK, I find the usage. continue to read the code:-), thanks.

587 static int handle_signal(unsigned long sig, siginfo_t *info,
588     struct k_sigaction *ka, sigset_t *oldset, struct pt_regs *regs)
589 {              
590     int ret;
……
602     /* fallthrough */
603     case ERESTARTNOINTR:        /* Userland will reload $v0.  */
604         regs->regs[7] = regs->regs[26];
605         regs->cp0_epc -= 8;
606     }  



2012/5/23 David Daney <david.daney@cavium.com>
On 05/22/2012 02:40 AM, Songmao Tian wrote:
Hello all:
   In handle_sys there's a
50
<http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=arch/mips/kernel/scall32-o32.S;h=a632bc144efa1b9ca977a582864530e33ee039cb;hb=72c04af9a2d57b7945cf3de8e71461bd80695d50#l50>

        sw      a3, PT_R26(sp)          # save a3 for syscall restarting

I woner why it need to save  a3 in R26(k0) slot in the stack?


It has to go somewhere.  The K0 and K1 slots aren't used to save other things.

David Daney

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