diff options
author | Roland McGrath <roland@redhat.com> | 2008-01-30 07:30:43 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:30:43 -0500 |
commit | 00f8b1bc0e44ba94fb33e1fbd8ac82841d7cc570 (patch) | |
tree | 40921e3470a9ebbeb799939f03137af91987ac19 /arch/x86/vdso | |
parent | 36197c92a20c142fc2a068e0366053d770fa0096 (diff) |
x86 vDSO: ia32 vdso32-syscall build
This puts the syscall version of the 32-bit vDSO in arch/x86/vdso/vdso32/
for 64-bit IA32 support. This is not used yet, but it paves the way for
consolidating the 32-bit vDSO source and build logic all in one place.
Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/vdso')
-rw-r--r-- | arch/x86/vdso/Makefile | 1 | ||||
-rw-r--r-- | arch/x86/vdso/vdso32/sigreturn.S | 9 | ||||
-rw-r--r-- | arch/x86/vdso/vdso32/syscall.S | 69 |
3 files changed, 76 insertions, 3 deletions
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile index 1efe785979a2..1127c716df02 100644 --- a/arch/x86/vdso/Makefile +++ b/arch/x86/vdso/Makefile | |||
@@ -71,6 +71,7 @@ $(obj)/%-syms.lds: $(obj)/%.so.dbg FORCE | |||
71 | # | 71 | # |
72 | obj-$(VDSO32-y) += vdso32-syms.lds | 72 | obj-$(VDSO32-y) += vdso32-syms.lds |
73 | vdso32.so-$(CONFIG_X86_32) += int80 | 73 | vdso32.so-$(CONFIG_X86_32) += int80 |
74 | vdso32.so-$(CONFIG_COMPAT) += syscall | ||
74 | vdso32.so-$(VDSO32-y) += sysenter | 75 | vdso32.so-$(VDSO32-y) += sysenter |
75 | 76 | ||
76 | CPPFLAGS_vdso32.lds = $(CPPFLAGS_vdso.lds) | 77 | CPPFLAGS_vdso32.lds = $(CPPFLAGS_vdso.lds) |
diff --git a/arch/x86/vdso/vdso32/sigreturn.S b/arch/x86/vdso/vdso32/sigreturn.S index 778f4649e32f..8d65a0a0eb70 100644 --- a/arch/x86/vdso/vdso32/sigreturn.S +++ b/arch/x86/vdso/vdso32/sigreturn.S | |||
@@ -6,9 +6,12 @@ | |||
6 | * routines are constant for all vsyscall implementations. | 6 | * routines are constant for all vsyscall implementations. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <asm/unistd.h> | 9 | #include <asm/unistd_32.h> |
10 | #include <asm/asm-offsets.h> | 10 | #include <asm/asm-offsets.h> |
11 | 11 | ||
12 | #ifndef SYSCALL_ENTER_KERNEL | ||
13 | #define SYSCALL_ENTER_KERNEL int $0x80 | ||
14 | #endif | ||
12 | 15 | ||
13 | /* XXX | 16 | /* XXX |
14 | Should these be named "_sigtramp" or something? | 17 | Should these be named "_sigtramp" or something? |
@@ -22,7 +25,7 @@ __kernel_sigreturn: | |||
22 | .LSTART_sigreturn: | 25 | .LSTART_sigreturn: |
23 | popl %eax /* XXX does this mean it needs unwind info? */ | 26 | popl %eax /* XXX does this mean it needs unwind info? */ |
24 | movl $__NR_sigreturn, %eax | 27 | movl $__NR_sigreturn, %eax |
25 | int $0x80 | 28 | SYSCALL_ENTER_KERNEL |
26 | .LEND_sigreturn: | 29 | .LEND_sigreturn: |
27 | .size __kernel_sigreturn,.-.LSTART_sigreturn | 30 | .size __kernel_sigreturn,.-.LSTART_sigreturn |
28 | 31 | ||
@@ -32,7 +35,7 @@ __kernel_sigreturn: | |||
32 | __kernel_rt_sigreturn: | 35 | __kernel_rt_sigreturn: |
33 | .LSTART_rt_sigreturn: | 36 | .LSTART_rt_sigreturn: |
34 | movl $__NR_rt_sigreturn, %eax | 37 | movl $__NR_rt_sigreturn, %eax |
35 | int $0x80 | 38 | SYSCALL_ENTER_KERNEL |
36 | .LEND_rt_sigreturn: | 39 | .LEND_rt_sigreturn: |
37 | .size __kernel_rt_sigreturn,.-.LSTART_rt_sigreturn | 40 | .size __kernel_rt_sigreturn,.-.LSTART_rt_sigreturn |
38 | .balign 32 | 41 | .balign 32 |
diff --git a/arch/x86/vdso/vdso32/syscall.S b/arch/x86/vdso/vdso32/syscall.S new file mode 100644 index 000000000000..333bfb552c88 --- /dev/null +++ b/arch/x86/vdso/vdso32/syscall.S | |||
@@ -0,0 +1,69 @@ | |||
1 | /* | ||
2 | * Code for the vsyscall page. This version uses the syscall instruction. | ||
3 | */ | ||
4 | |||
5 | #include <asm/asm-offsets.h> | ||
6 | #include <asm/segment.h> | ||
7 | |||
8 | .text | ||
9 | .globl __kernel_vsyscall | ||
10 | .type __kernel_vsyscall,@function | ||
11 | __kernel_vsyscall: | ||
12 | .LSTART_vsyscall: | ||
13 | push %ebp | ||
14 | .Lpush_ebp: | ||
15 | movl %ecx, %ebp | ||
16 | syscall | ||
17 | movl $__USER32_DS, %ecx | ||
18 | movl %ecx, %ss | ||
19 | movl %ebp, %ecx | ||
20 | popl %ebp | ||
21 | .Lpop_ebp: | ||
22 | ret | ||
23 | .LEND_vsyscall: | ||
24 | .size __kernel_vsyscall,.-.LSTART_vsyscall | ||
25 | |||
26 | .section .eh_frame,"a",@progbits | ||
27 | .LSTARTFRAME: | ||
28 | .long .LENDCIE-.LSTARTCIE | ||
29 | .LSTARTCIE: | ||
30 | .long 0 /* CIE ID */ | ||
31 | .byte 1 /* Version number */ | ||
32 | .string "zR" /* NUL-terminated augmentation string */ | ||
33 | .uleb128 1 /* Code alignment factor */ | ||
34 | .sleb128 -4 /* Data alignment factor */ | ||
35 | .byte 8 /* Return address register column */ | ||
36 | .uleb128 1 /* Augmentation value length */ | ||
37 | .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */ | ||
38 | .byte 0x0c /* DW_CFA_def_cfa */ | ||
39 | .uleb128 4 | ||
40 | .uleb128 4 | ||
41 | .byte 0x88 /* DW_CFA_offset, column 0x8 */ | ||
42 | .uleb128 1 | ||
43 | .align 4 | ||
44 | .LENDCIE: | ||
45 | |||
46 | .long .LENDFDE1-.LSTARTFDE1 /* Length FDE */ | ||
47 | .LSTARTFDE1: | ||
48 | .long .LSTARTFDE1-.LSTARTFRAME /* CIE pointer */ | ||
49 | .long .LSTART_vsyscall-. /* PC-relative start address */ | ||
50 | .long .LEND_vsyscall-.LSTART_vsyscall | ||
51 | .uleb128 0 /* Augmentation length */ | ||
52 | /* What follows are the instructions for the table generation. | ||
53 | We have to record all changes of the stack pointer. */ | ||
54 | .byte 0x40 + .Lpush_ebp-.LSTART_vsyscall /* DW_CFA_advance_loc */ | ||
55 | .byte 0x0e /* DW_CFA_def_cfa_offset */ | ||
56 | .uleb128 8 | ||
57 | .byte 0x85, 0x02 /* DW_CFA_offset %ebp -8 */ | ||
58 | .byte 0x40 + .Lpop_ebp-.Lpush_ebp /* DW_CFA_advance_loc */ | ||
59 | .byte 0xc5 /* DW_CFA_restore %ebp */ | ||
60 | .byte 0x0e /* DW_CFA_def_cfa_offset */ | ||
61 | .uleb128 4 | ||
62 | .align 4 | ||
63 | .LENDFDE1: | ||
64 | |||
65 | /* | ||
66 | * Get the common code for the sigreturn entry points. | ||
67 | */ | ||
68 | #define SYSCALL_ENTER_KERNEL syscall | ||
69 | #include "sigreturn.S" | ||