aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/signal.c
diff options
context:
space:
mode:
authorBrian Gerst <brgerst@gmail.com>2009-02-11 16:43:58 -0500
committerH. Peter Anvin <hpa@linux.intel.com>2009-02-11 14:00:56 -0800
commitb12bdaf11f935d7be030207e3c77faeaeab8ded3 (patch)
treee41f325f01614f7cf2eb78350fbd7440afe39cf8 /arch/x86/kernel/signal.c
parent1c0040047d5499599cc231ca3f105be3ceff8562 (diff)
downloadkernel_samsung_tuna-b12bdaf11f935d7be030207e3c77faeaeab8ded3.zip
kernel_samsung_tuna-b12bdaf11f935d7be030207e3c77faeaeab8ded3.tar.gz
kernel_samsung_tuna-b12bdaf11f935d7be030207e3c77faeaeab8ded3.tar.bz2
x86: use regparm(3) for passed-in pt_regs pointer
Some syscalls need to access the pt_regs structure, either to copy user register state or to modifiy it. This patch adds stubs to load the address of the pt_regs struct into the %eax register, and changes the syscalls to take the pointer as an argument instead of relying on the assumption that the pt_regs structure overlaps the function arguments. Drop the use of regparm(1) due to concern about gcc bugs, and to move in the direction of the eventual removal of regparm(0) for asmlinkage. Signed-off-by: Brian Gerst <brgerst@gmail.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/kernel/signal.c')
-rw-r--r--arch/x86/kernel/signal.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index d7a1583..ccfb274 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -549,23 +549,27 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
#endif /* CONFIG_X86_32 */
#ifdef CONFIG_X86_32
-ptregscall int
-sys_sigaltstack(struct pt_regs *regs, const stack_t __user *uss,
- stack_t __user *uoss)
+int sys_sigaltstack(struct pt_regs *regs)
+{
+ const stack_t __user *uss = (const stack_t __user *)regs->bx;
+ stack_t __user *uoss = (stack_t __user *)regs->cx;
+
+ return do_sigaltstack(uss, uoss, regs->sp);
+}
#else /* !CONFIG_X86_32 */
asmlinkage long
sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
struct pt_regs *regs)
-#endif /* CONFIG_X86_32 */
{
return do_sigaltstack(uss, uoss, regs->sp);
}
+#endif /* CONFIG_X86_32 */
/*
* Do a signal return; undo the signal stack.
*/
#ifdef CONFIG_X86_32
-ptregscall unsigned long sys_sigreturn(struct pt_regs *regs)
+unsigned long sys_sigreturn(struct pt_regs *regs)
{
struct sigframe __user *frame;
unsigned long ax;
@@ -629,13 +633,16 @@ badframe:
}
#ifdef CONFIG_X86_32
-ptregscall int sys_rt_sigreturn(struct pt_regs *regs)
+int sys_rt_sigreturn(struct pt_regs *regs)
+{
+ return do_rt_sigreturn(regs);
+}
#else /* !CONFIG_X86_32 */
asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
-#endif /* CONFIG_X86_32 */
{
return do_rt_sigreturn(regs);
}
+#endif /* CONFIG_X86_32 */
/*
* OK, we're invoking a handler: