diff options
author | Brian Gerst <brgerst@gmail.com> | 2009-02-10 09:51:46 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-11 06:40:45 -0500 |
commit | 253f29a4ae9cc6cdc7b94f96517f27a93885a6ce (patch) | |
tree | 09942e565938a6bac216b1725ccf607e01d09b20 /arch/x86/kernel/entry_32.S | |
parent | aa78bcfa01dec3cdbde3cda098ce32abbd9c3bf6 (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/kernel/entry_32.S')
-rw-r--r-- | arch/x86/kernel/entry_32.S | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index 5f5bd22adcd4..3de7b5710dc8 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -697,6 +697,26 @@ syscall_badsys: | |||
697 | END(syscall_badsys) | 697 | END(syscall_badsys) |
698 | CFI_ENDPROC | 698 | CFI_ENDPROC |
699 | 699 | ||
700 | /* | ||
701 | * System calls that need a pt_regs pointer. | ||
702 | */ | ||
703 | #define PTREGSCALL(name) \ | ||
704 | ALIGN; \ | ||
705 | ptregs_##name: \ | ||
706 | leal 4(%esp),%eax; \ | ||
707 | jmp sys_##name; | ||
708 | |||
709 | PTREGSCALL(iopl) | ||
710 | PTREGSCALL(fork) | ||
711 | PTREGSCALL(clone) | ||
712 | PTREGSCALL(vfork) | ||
713 | PTREGSCALL(execve) | ||
714 | PTREGSCALL(sigaltstack) | ||
715 | PTREGSCALL(sigreturn) | ||
716 | PTREGSCALL(rt_sigreturn) | ||
717 | PTREGSCALL(vm86) | ||
718 | PTREGSCALL(vm86old) | ||
719 | |||
700 | .macro FIXUP_ESPFIX_STACK | 720 | .macro FIXUP_ESPFIX_STACK |
701 | /* since we are on a wrong stack, we cant make it a C code :( */ | 721 | /* since we are on a wrong stack, we cant make it a C code :( */ |
702 | PER_CPU(gdt_page, %ebx) | 722 | PER_CPU(gdt_page, %ebx) |