aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/linkage.h
diff options
context:
space:
mode:
authorBrian Gerst <brgerst@gmail.com>2009-02-10 09:51:46 -0500
committerIngo Molnar <mingo@elte.hu>2009-02-11 12:40:45 +0100
commit253f29a4ae9cc6cdc7b94f96517f27a93885a6ce (patch)
tree09942e565938a6bac216b1725ccf607e01d09b20 /arch/x86/include/asm/linkage.h
parentaa78bcfa01dec3cdbde3cda098ce32abbd9c3bf6 (diff)
x86: pass in pt_regs pointer for syscalls that need it
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 regparm(1) to receive the pt_regs pointer as the first argument. Signed-off-by: Brian Gerst <brgerst@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include/asm/linkage.h')
-rw-r--r--arch/x86/include/asm/linkage.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/include/asm/linkage.h b/arch/x86/include/asm/linkage.h
index 5d98d0b68ff..2fd5926fb97 100644
--- a/arch/x86/include/asm/linkage.h
+++ b/arch/x86/include/asm/linkage.h
@@ -18,6 +18,13 @@
#define asmregparm __attribute__((regparm(3)))
/*
+ * For syscalls that need a pointer to the pt_regs struct (ie. fork).
+ * The regs pointer is passed in %eax as the first argument. The
+ * remaining function arguments remain on the stack.
+ */
+#define ptregscall __attribute__((regparm(1)))
+
+/*
* Make sure the compiler doesn't do anything stupid with the
* arguments on the stack - they are owned by the *caller*, not
* the callee. This just fools gcc into not spilling into them,