diff options
-rw-r--r-- | arch/x86/vdso/Makefile | 3 | ||||
-rw-r--r-- | arch/x86/vdso/vdso-start.S | 2 | ||||
-rw-r--r-- | arch/x86/vdso/vma.c | 18 | ||||
-rw-r--r-- | include/asm-x86/vdso.h | 14 |
4 files changed, 22 insertions, 15 deletions
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile index d8200adae9fa..d2ec17044adc 100644 --- a/arch/x86/vdso/Makefile +++ b/arch/x86/vdso/Makefile | |||
@@ -3,8 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | # files to link into the vdso | 5 | # files to link into the vdso |
6 | # vdso-start.o has to be first | 6 | vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o vvar.o |
7 | vobjs-y := vdso-start.o vdso-note.o vclock_gettime.o vgetcpu.o vvar.o | ||
8 | 7 | ||
9 | # files to link into kernel | 8 | # files to link into kernel |
10 | obj-y := vma.o vdso.o vdso-syms.o | 9 | obj-y := vma.o vdso.o vdso-syms.o |
diff --git a/arch/x86/vdso/vdso-start.S b/arch/x86/vdso/vdso-start.S deleted file mode 100644 index 2dc2cdb84d67..000000000000 --- a/arch/x86/vdso/vdso-start.S +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | .globl vdso_kernel_start | ||
2 | vdso_kernel_start: | ||
diff --git a/arch/x86/vdso/vma.c b/arch/x86/vdso/vma.c index ff9333e5fb08..3fdd51497a83 100644 --- a/arch/x86/vdso/vma.c +++ b/arch/x86/vdso/vma.c | |||
@@ -11,23 +11,20 @@ | |||
11 | #include <asm/vsyscall.h> | 11 | #include <asm/vsyscall.h> |
12 | #include <asm/vgtod.h> | 12 | #include <asm/vgtod.h> |
13 | #include <asm/proto.h> | 13 | #include <asm/proto.h> |
14 | #include "voffset.h" | 14 | #include <asm/vdso.h> |
15 | 15 | ||
16 | int vdso_enabled = 1; | 16 | #include "vextern.h" /* Just for VMAGIC. */ |
17 | |||
18 | #define VEXTERN(x) extern typeof(__ ## x) *vdso_ ## x; | ||
19 | #include "vextern.h" | ||
20 | #undef VEXTERN | 17 | #undef VEXTERN |
21 | 18 | ||
22 | extern char vdso_kernel_start[], vdso_start[], vdso_end[]; | 19 | int vdso_enabled = 1; |
20 | |||
21 | extern char vdso_start[], vdso_end[]; | ||
23 | extern unsigned short vdso_sync_cpuid; | 22 | extern unsigned short vdso_sync_cpuid; |
24 | 23 | ||
25 | struct page **vdso_pages; | 24 | struct page **vdso_pages; |
26 | 25 | ||
27 | static inline void *var_ref(void *vbase, char *var, char *name) | 26 | static inline void *var_ref(void *p, char *name) |
28 | { | 27 | { |
29 | unsigned offset = var - &vdso_kernel_start[0] + VDSO_TEXT_OFFSET; | ||
30 | void *p = vbase + offset; | ||
31 | if (*(void **)p != (void *)VMAGIC) { | 28 | if (*(void **)p != (void *)VMAGIC) { |
32 | printk("VDSO: variable %s broken\n", name); | 29 | printk("VDSO: variable %s broken\n", name); |
33 | vdso_enabled = 0; | 30 | vdso_enabled = 0; |
@@ -62,9 +59,8 @@ static int __init init_vdso_vars(void) | |||
62 | vdso_enabled = 0; | 59 | vdso_enabled = 0; |
63 | } | 60 | } |
64 | 61 | ||
65 | #define V(x) *(typeof(x) *) var_ref(vbase, (char *)RELOC_HIDE(&x, 0), #x) | ||
66 | #define VEXTERN(x) \ | 62 | #define VEXTERN(x) \ |
67 | V(vdso_ ## x) = &__ ## x; | 63 | *(typeof(__ ## x) **) var_ref(VDSO64_SYMBOL(vbase, x), #x) = &__ ## x; |
68 | #include "vextern.h" | 64 | #include "vextern.h" |
69 | #undef VEXTERN | 65 | #undef VEXTERN |
70 | return 0; | 66 | return 0; |
diff --git a/include/asm-x86/vdso.h b/include/asm-x86/vdso.h new file mode 100644 index 000000000000..9379ec06fd1f --- /dev/null +++ b/include/asm-x86/vdso.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _ASM_X86_VDSO_H | ||
2 | #define _ASM_X86_VDSO_H 1 | ||
3 | |||
4 | extern const char VDSO64_PRELINK[]; | ||
5 | |||
6 | /* | ||
7 | * Given a pointer to the vDSO image, find the pointer to VDSO64_name | ||
8 | * as that symbol is defined in the vDSO sources or linker script. | ||
9 | */ | ||
10 | #define VDSO64_SYMBOL(base, name) ({ \ | ||
11 | extern const char VDSO64_##name[]; \ | ||
12 | (void *) (VDSO64_##name - VDSO64_PRELINK + (unsigned long) (base)); }) | ||
13 | |||
14 | #endif /* asm-x86/vdso.h */ | ||