diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2011-08-18 15:02:59 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2011-11-02 09:14:50 -0400 |
commit | 27f85f12639fe821375a69900d96e0fbcc1450bf (patch) | |
tree | 9ca3ae7471b85059cd2c458569d3fc117c2ca670 /arch/um | |
parent | 3655c4d3c4bc105a36080c665b7294f471b0a1de (diff) |
um: merge arch/um/sys-{i386,x86_64}/asm
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/Makefile | 4 | ||||
-rw-r--r-- | arch/um/sys-i386/asm/elf.h | 125 | ||||
-rw-r--r-- | arch/um/sys-i386/asm/module.h | 13 | ||||
-rw-r--r-- | arch/um/sys-i386/asm/vm-flags.h | 14 | ||||
-rw-r--r-- | arch/um/sys-x86/asm/archparam.h (renamed from arch/um/sys-i386/asm/archparam.h) | 8 | ||||
-rw-r--r-- | arch/um/sys-x86/asm/checksum.h | 10 | ||||
-rw-r--r-- | arch/um/sys-x86/asm/checksum_32.h (renamed from arch/um/sys-i386/asm/checksum.h) | 0 | ||||
-rw-r--r-- | arch/um/sys-x86/asm/checksum_64.h (renamed from arch/um/sys-x86_64/asm/checksum.h) | 0 | ||||
-rw-r--r-- | arch/um/sys-x86/asm/elf.h (renamed from arch/um/sys-x86_64/asm/elf.h) | 145 | ||||
-rw-r--r-- | arch/um/sys-x86/asm/module.h | 23 | ||||
-rw-r--r-- | arch/um/sys-x86/asm/processor.h | 15 | ||||
-rw-r--r-- | arch/um/sys-x86/asm/processor_32.h (renamed from arch/um/sys-i386/asm/processor.h) | 9 | ||||
-rw-r--r-- | arch/um/sys-x86/asm/processor_64.h (renamed from arch/um/sys-x86_64/asm/processor.h) | 5 | ||||
-rw-r--r-- | arch/um/sys-x86/asm/ptrace.h | 5 | ||||
-rw-r--r-- | arch/um/sys-x86/asm/ptrace_32.h (renamed from arch/um/sys-i386/asm/ptrace.h) | 0 | ||||
-rw-r--r-- | arch/um/sys-x86/asm/ptrace_64.h (renamed from arch/um/sys-x86_64/asm/ptrace.h) | 0 | ||||
-rw-r--r-- | arch/um/sys-x86/asm/vm-flags.h (renamed from arch/um/sys-x86_64/asm/vm-flags.h) | 14 | ||||
-rw-r--r-- | arch/um/sys-x86_64/asm/archparam.h | 16 | ||||
-rw-r--r-- | arch/um/sys-x86_64/asm/module.h | 20 |
19 files changed, 192 insertions, 234 deletions
diff --git a/arch/um/Makefile b/arch/um/Makefile index 649aebcc6a4c..c1218705c2d3 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile | |||
@@ -21,10 +21,12 @@ core-y += $(ARCH_DIR)/kernel/ \ | |||
21 | MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include/shared/skas | 21 | MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include/shared/skas |
22 | 22 | ||
23 | include $(srctree)/$(ARCH_DIR)/Makefile-skas | 23 | include $(srctree)/$(ARCH_DIR)/Makefile-skas |
24 | include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH) | ||
24 | 25 | ||
25 | SHARED_HEADERS := $(ARCH_DIR)/include/shared | 26 | SHARED_HEADERS := $(ARCH_DIR)/include/shared |
26 | ARCH_INCLUDE := -I$(srctree)/$(SHARED_HEADERS) | 27 | ARCH_INCLUDE := -I$(srctree)/$(SHARED_HEADERS) |
27 | ARCH_INCLUDE += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH)/shared | 28 | ARCH_INCLUDE += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH)/shared |
29 | KBUILD_CPPFLAGS += -I$(srctree)/$(ARCH_DIR)/sys-$(HEADER_ARCH) | ||
28 | KBUILD_CPPFLAGS += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH) | 30 | KBUILD_CPPFLAGS += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH) |
29 | 31 | ||
30 | # -Dvmap=kernel_vmap prevents anything from referencing the libpcap.o symbol so | 32 | # -Dvmap=kernel_vmap prevents anything from referencing the libpcap.o symbol so |
@@ -46,8 +48,6 @@ USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\ | |||
46 | $(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \ | 48 | $(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \ |
47 | $(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64 -idirafter include | 49 | $(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64 -idirafter include |
48 | 50 | ||
49 | include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH) | ||
50 | |||
51 | #This will adjust *FLAGS accordingly to the platform. | 51 | #This will adjust *FLAGS accordingly to the platform. |
52 | include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) | 52 | include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) |
53 | 53 | ||
diff --git a/arch/um/sys-i386/asm/elf.h b/arch/um/sys-i386/asm/elf.h deleted file mode 100644 index 42305551d204..000000000000 --- a/arch/um/sys-i386/asm/elf.h +++ /dev/null | |||
@@ -1,125 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | #ifndef __UM_ELF_I386_H | ||
6 | #define __UM_ELF_I386_H | ||
7 | |||
8 | #include <asm/user.h> | ||
9 | #include "skas.h" | ||
10 | |||
11 | #define R_386_NONE 0 | ||
12 | #define R_386_32 1 | ||
13 | #define R_386_PC32 2 | ||
14 | #define R_386_GOT32 3 | ||
15 | #define R_386_PLT32 4 | ||
16 | #define R_386_COPY 5 | ||
17 | #define R_386_GLOB_DAT 6 | ||
18 | #define R_386_JMP_SLOT 7 | ||
19 | #define R_386_RELATIVE 8 | ||
20 | #define R_386_GOTOFF 9 | ||
21 | #define R_386_GOTPC 10 | ||
22 | #define R_386_NUM 11 | ||
23 | |||
24 | typedef unsigned long elf_greg_t; | ||
25 | |||
26 | #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) | ||
27 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | ||
28 | |||
29 | typedef struct user_i387_struct elf_fpregset_t; | ||
30 | |||
31 | /* | ||
32 | * This is used to ensure we don't load something for the wrong architecture. | ||
33 | */ | ||
34 | #define elf_check_arch(x) \ | ||
35 | (((x)->e_machine == EM_386) || ((x)->e_machine == EM_486)) | ||
36 | |||
37 | #define ELF_CLASS ELFCLASS32 | ||
38 | #define ELF_DATA ELFDATA2LSB | ||
39 | #define ELF_ARCH EM_386 | ||
40 | |||
41 | #define ELF_PLAT_INIT(regs, load_addr) do { \ | ||
42 | PT_REGS_EBX(regs) = 0; \ | ||
43 | PT_REGS_ECX(regs) = 0; \ | ||
44 | PT_REGS_EDX(regs) = 0; \ | ||
45 | PT_REGS_ESI(regs) = 0; \ | ||
46 | PT_REGS_EDI(regs) = 0; \ | ||
47 | PT_REGS_EBP(regs) = 0; \ | ||
48 | PT_REGS_EAX(regs) = 0; \ | ||
49 | } while (0) | ||
50 | |||
51 | #define ELF_EXEC_PAGESIZE 4096 | ||
52 | |||
53 | #define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3) | ||
54 | |||
55 | /* Shamelessly stolen from include/asm-i386/elf.h */ | ||
56 | |||
57 | #define ELF_CORE_COPY_REGS(pr_reg, regs) do { \ | ||
58 | pr_reg[0] = PT_REGS_EBX(regs); \ | ||
59 | pr_reg[1] = PT_REGS_ECX(regs); \ | ||
60 | pr_reg[2] = PT_REGS_EDX(regs); \ | ||
61 | pr_reg[3] = PT_REGS_ESI(regs); \ | ||
62 | pr_reg[4] = PT_REGS_EDI(regs); \ | ||
63 | pr_reg[5] = PT_REGS_EBP(regs); \ | ||
64 | pr_reg[6] = PT_REGS_EAX(regs); \ | ||
65 | pr_reg[7] = PT_REGS_DS(regs); \ | ||
66 | pr_reg[8] = PT_REGS_ES(regs); \ | ||
67 | /* fake once used fs and gs selectors? */ \ | ||
68 | pr_reg[9] = PT_REGS_DS(regs); \ | ||
69 | pr_reg[10] = PT_REGS_DS(regs); \ | ||
70 | pr_reg[11] = PT_REGS_SYSCALL_NR(regs); \ | ||
71 | pr_reg[12] = PT_REGS_IP(regs); \ | ||
72 | pr_reg[13] = PT_REGS_CS(regs); \ | ||
73 | pr_reg[14] = PT_REGS_EFLAGS(regs); \ | ||
74 | pr_reg[15] = PT_REGS_SP(regs); \ | ||
75 | pr_reg[16] = PT_REGS_SS(regs); \ | ||
76 | } while (0); | ||
77 | |||
78 | #define task_pt_regs(t) (&(t)->thread.regs) | ||
79 | |||
80 | struct task_struct; | ||
81 | |||
82 | extern int elf_core_copy_fpregs(struct task_struct *t, elf_fpregset_t *fpu); | ||
83 | |||
84 | #define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu) | ||
85 | |||
86 | extern long elf_aux_hwcap; | ||
87 | #define ELF_HWCAP (elf_aux_hwcap) | ||
88 | |||
89 | extern char * elf_aux_platform; | ||
90 | #define ELF_PLATFORM (elf_aux_platform) | ||
91 | |||
92 | #define SET_PERSONALITY(ex) do { } while (0) | ||
93 | |||
94 | extern unsigned long vsyscall_ehdr; | ||
95 | extern unsigned long vsyscall_end; | ||
96 | extern unsigned long __kernel_vsyscall; | ||
97 | |||
98 | #define VSYSCALL_BASE vsyscall_ehdr | ||
99 | #define VSYSCALL_END vsyscall_end | ||
100 | |||
101 | /* | ||
102 | * This is the range that is readable by user mode, and things | ||
103 | * acting like user mode such as get_user_pages. | ||
104 | */ | ||
105 | #define FIXADDR_USER_START VSYSCALL_BASE | ||
106 | #define FIXADDR_USER_END VSYSCALL_END | ||
107 | |||
108 | #define __HAVE_ARCH_GATE_AREA 1 | ||
109 | |||
110 | /* | ||
111 | * Architecture-neutral AT_ values in 0-17, leave some room | ||
112 | * for more of them, start the x86-specific ones at 32. | ||
113 | */ | ||
114 | #define AT_SYSINFO 32 | ||
115 | #define AT_SYSINFO_EHDR 33 | ||
116 | |||
117 | #define ARCH_DLINFO \ | ||
118 | do { \ | ||
119 | if ( vsyscall_ehdr ) { \ | ||
120 | NEW_AUX_ENT(AT_SYSINFO, __kernel_vsyscall); \ | ||
121 | NEW_AUX_ENT(AT_SYSINFO_EHDR, vsyscall_ehdr); \ | ||
122 | } \ | ||
123 | } while (0) | ||
124 | |||
125 | #endif | ||
diff --git a/arch/um/sys-i386/asm/module.h b/arch/um/sys-i386/asm/module.h deleted file mode 100644 index 5ead4a0b2e35..000000000000 --- a/arch/um/sys-i386/asm/module.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | #ifndef __UM_MODULE_I386_H | ||
2 | #define __UM_MODULE_I386_H | ||
3 | |||
4 | /* UML is simple */ | ||
5 | struct mod_arch_specific | ||
6 | { | ||
7 | }; | ||
8 | |||
9 | #define Elf_Shdr Elf32_Shdr | ||
10 | #define Elf_Sym Elf32_Sym | ||
11 | #define Elf_Ehdr Elf32_Ehdr | ||
12 | |||
13 | #endif | ||
diff --git a/arch/um/sys-i386/asm/vm-flags.h b/arch/um/sys-i386/asm/vm-flags.h deleted file mode 100644 index e0d24c568dbc..000000000000 --- a/arch/um/sys-i386/asm/vm-flags.h +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004 Jeff Dike (jdike@addtoit.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __VM_FLAGS_I386_H | ||
7 | #define __VM_FLAGS_I386_H | ||
8 | |||
9 | #define VM_DATA_DEFAULT_FLAGS \ | ||
10 | (VM_READ | VM_WRITE | \ | ||
11 | ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \ | ||
12 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | ||
13 | |||
14 | #endif | ||
diff --git a/arch/um/sys-i386/asm/archparam.h b/arch/um/sys-x86/asm/archparam.h index 2a18a884ca1b..c17cf68dda0f 100644 --- a/arch/um/sys-i386/asm/archparam.h +++ b/arch/um/sys-x86/asm/archparam.h | |||
@@ -1,10 +1,13 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) | 2 | * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) |
3 | * Copyright 2003 PathScale, Inc. | ||
3 | * Licensed under the GPL | 4 | * Licensed under the GPL |
4 | */ | 5 | */ |
5 | 6 | ||
6 | #ifndef __UM_ARCHPARAM_I386_H | 7 | #ifndef __UM_ARCHPARAM_H |
7 | #define __UM_ARCHPARAM_I386_H | 8 | #define __UM_ARCHPARAM_H |
9 | |||
10 | #ifdef CONFIG_X86_32 | ||
8 | 11 | ||
9 | #ifdef CONFIG_X86_PAE | 12 | #ifdef CONFIG_X86_PAE |
10 | #define LAST_PKMAP 512 | 13 | #define LAST_PKMAP 512 |
@@ -14,3 +17,4 @@ | |||
14 | 17 | ||
15 | #endif | 18 | #endif |
16 | 19 | ||
20 | #endif | ||
diff --git a/arch/um/sys-x86/asm/checksum.h b/arch/um/sys-x86/asm/checksum.h new file mode 100644 index 000000000000..b6efe2381b5d --- /dev/null +++ b/arch/um/sys-x86/asm/checksum.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef __UM_CHECKSUM_H | ||
2 | #define __UM_CHECKSUM_H | ||
3 | |||
4 | #ifdef CONFIG_X86_32 | ||
5 | # include "checksum_32.h" | ||
6 | #else | ||
7 | # include "checksum_64.h" | ||
8 | #endif | ||
9 | |||
10 | #endif | ||
diff --git a/arch/um/sys-i386/asm/checksum.h b/arch/um/sys-x86/asm/checksum_32.h index caab74252e27..caab74252e27 100644 --- a/arch/um/sys-i386/asm/checksum.h +++ b/arch/um/sys-x86/asm/checksum_32.h | |||
diff --git a/arch/um/sys-x86_64/asm/checksum.h b/arch/um/sys-x86/asm/checksum_64.h index a5be9031ea85..a5be9031ea85 100644 --- a/arch/um/sys-x86_64/asm/checksum.h +++ b/arch/um/sys-x86/asm/checksum_64.h | |||
diff --git a/arch/um/sys-x86_64/asm/elf.h b/arch/um/sys-x86/asm/elf.h index 11a2bfb38859..f3b0633b69a1 100644 --- a/arch/um/sys-x86_64/asm/elf.h +++ b/arch/um/sys-x86/asm/elf.h | |||
@@ -1,15 +1,103 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2003 PathScale, Inc. | 2 | * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
3 | * Copyright (C) 2003 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) | ||
4 | * | ||
5 | * Licensed under the GPL | 3 | * Licensed under the GPL |
6 | */ | 4 | */ |
7 | #ifndef __UM_ELF_X86_64_H | 5 | #ifndef __UM_ELF_X86_H |
8 | #define __UM_ELF_X86_64_H | 6 | #define __UM_ELF_X86_H |
9 | 7 | ||
10 | #include <asm/user.h> | 8 | #include <asm/user.h> |
11 | #include "skas.h" | 9 | #include "skas.h" |
12 | 10 | ||
11 | #ifdef CONFIG_X86_32 | ||
12 | |||
13 | #define R_386_NONE 0 | ||
14 | #define R_386_32 1 | ||
15 | #define R_386_PC32 2 | ||
16 | #define R_386_GOT32 3 | ||
17 | #define R_386_PLT32 4 | ||
18 | #define R_386_COPY 5 | ||
19 | #define R_386_GLOB_DAT 6 | ||
20 | #define R_386_JMP_SLOT 7 | ||
21 | #define R_386_RELATIVE 8 | ||
22 | #define R_386_GOTOFF 9 | ||
23 | #define R_386_GOTPC 10 | ||
24 | #define R_386_NUM 11 | ||
25 | |||
26 | /* | ||
27 | * This is used to ensure we don't load something for the wrong architecture. | ||
28 | */ | ||
29 | #define elf_check_arch(x) \ | ||
30 | (((x)->e_machine == EM_386) || ((x)->e_machine == EM_486)) | ||
31 | |||
32 | #define ELF_CLASS ELFCLASS32 | ||
33 | #define ELF_DATA ELFDATA2LSB | ||
34 | #define ELF_ARCH EM_386 | ||
35 | |||
36 | #define ELF_PLAT_INIT(regs, load_addr) do { \ | ||
37 | PT_REGS_EBX(regs) = 0; \ | ||
38 | PT_REGS_ECX(regs) = 0; \ | ||
39 | PT_REGS_EDX(regs) = 0; \ | ||
40 | PT_REGS_ESI(regs) = 0; \ | ||
41 | PT_REGS_EDI(regs) = 0; \ | ||
42 | PT_REGS_EBP(regs) = 0; \ | ||
43 | PT_REGS_EAX(regs) = 0; \ | ||
44 | } while (0) | ||
45 | |||
46 | /* Shamelessly stolen from include/asm-i386/elf.h */ | ||
47 | |||
48 | #define ELF_CORE_COPY_REGS(pr_reg, regs) do { \ | ||
49 | pr_reg[0] = PT_REGS_EBX(regs); \ | ||
50 | pr_reg[1] = PT_REGS_ECX(regs); \ | ||
51 | pr_reg[2] = PT_REGS_EDX(regs); \ | ||
52 | pr_reg[3] = PT_REGS_ESI(regs); \ | ||
53 | pr_reg[4] = PT_REGS_EDI(regs); \ | ||
54 | pr_reg[5] = PT_REGS_EBP(regs); \ | ||
55 | pr_reg[6] = PT_REGS_EAX(regs); \ | ||
56 | pr_reg[7] = PT_REGS_DS(regs); \ | ||
57 | pr_reg[8] = PT_REGS_ES(regs); \ | ||
58 | /* fake once used fs and gs selectors? */ \ | ||
59 | pr_reg[9] = PT_REGS_DS(regs); \ | ||
60 | pr_reg[10] = PT_REGS_DS(regs); \ | ||
61 | pr_reg[11] = PT_REGS_SYSCALL_NR(regs); \ | ||
62 | pr_reg[12] = PT_REGS_IP(regs); \ | ||
63 | pr_reg[13] = PT_REGS_CS(regs); \ | ||
64 | pr_reg[14] = PT_REGS_EFLAGS(regs); \ | ||
65 | pr_reg[15] = PT_REGS_SP(regs); \ | ||
66 | pr_reg[16] = PT_REGS_SS(regs); \ | ||
67 | } while (0); | ||
68 | |||
69 | extern char * elf_aux_platform; | ||
70 | #define ELF_PLATFORM (elf_aux_platform) | ||
71 | |||
72 | extern unsigned long vsyscall_ehdr; | ||
73 | extern unsigned long vsyscall_end; | ||
74 | extern unsigned long __kernel_vsyscall; | ||
75 | |||
76 | /* | ||
77 | * This is the range that is readable by user mode, and things | ||
78 | * acting like user mode such as get_user_pages. | ||
79 | */ | ||
80 | #define FIXADDR_USER_START vsyscall_ehdr | ||
81 | #define FIXADDR_USER_END vsyscall_end | ||
82 | |||
83 | |||
84 | /* | ||
85 | * Architecture-neutral AT_ values in 0-17, leave some room | ||
86 | * for more of them, start the x86-specific ones at 32. | ||
87 | */ | ||
88 | #define AT_SYSINFO 32 | ||
89 | #define AT_SYSINFO_EHDR 33 | ||
90 | |||
91 | #define ARCH_DLINFO \ | ||
92 | do { \ | ||
93 | if ( vsyscall_ehdr ) { \ | ||
94 | NEW_AUX_ENT(AT_SYSINFO, __kernel_vsyscall); \ | ||
95 | NEW_AUX_ENT(AT_SYSINFO_EHDR, vsyscall_ehdr); \ | ||
96 | } \ | ||
97 | } while (0) | ||
98 | |||
99 | #else | ||
100 | |||
13 | /* x86-64 relocation types, taken from asm-x86_64/elf.h */ | 101 | /* x86-64 relocation types, taken from asm-x86_64/elf.h */ |
14 | #define R_X86_64_NONE 0 /* No reloc */ | 102 | #define R_X86_64_NONE 0 /* No reloc */ |
15 | #define R_X86_64_64 1 /* Direct 64 bit */ | 103 | #define R_X86_64_64 1 /* Direct 64 bit */ |
@@ -31,13 +119,6 @@ | |||
31 | 119 | ||
32 | #define R_X86_64_NUM 16 | 120 | #define R_X86_64_NUM 16 |
33 | 121 | ||
34 | typedef unsigned long elf_greg_t; | ||
35 | |||
36 | #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) | ||
37 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | ||
38 | |||
39 | typedef struct user_i387_struct elf_fpregset_t; | ||
40 | |||
41 | /* | 122 | /* |
42 | * This is used to ensure we don't load something for the wrong architecture. | 123 | * This is used to ensure we don't load something for the wrong architecture. |
43 | */ | 124 | */ |
@@ -95,6 +176,30 @@ typedef struct user_i387_struct elf_fpregset_t; | |||
95 | (pr_reg)[25] = 0; \ | 176 | (pr_reg)[25] = 0; \ |
96 | (pr_reg)[26] = 0; | 177 | (pr_reg)[26] = 0; |
97 | 178 | ||
179 | #define ELF_PLATFORM "x86_64" | ||
180 | |||
181 | /* No user-accessible fixmap addresses, i.e. vsyscall */ | ||
182 | #define FIXADDR_USER_START 0 | ||
183 | #define FIXADDR_USER_END 0 | ||
184 | |||
185 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1 | ||
186 | struct linux_binprm; | ||
187 | extern int arch_setup_additional_pages(struct linux_binprm *bprm, | ||
188 | int uses_interp); | ||
189 | |||
190 | extern unsigned long um_vdso_addr; | ||
191 | #define AT_SYSINFO_EHDR 33 | ||
192 | #define ARCH_DLINFO NEW_AUX_ENT(AT_SYSINFO_EHDR, um_vdso_addr) | ||
193 | |||
194 | #endif | ||
195 | |||
196 | typedef unsigned long elf_greg_t; | ||
197 | |||
198 | #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) | ||
199 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | ||
200 | |||
201 | typedef struct user_i387_struct elf_fpregset_t; | ||
202 | |||
98 | #define task_pt_regs(t) (&(t)->thread.regs) | 203 | #define task_pt_regs(t) (&(t)->thread.regs) |
99 | 204 | ||
100 | struct task_struct; | 205 | struct task_struct; |
@@ -103,11 +208,6 @@ extern int elf_core_copy_fpregs(struct task_struct *t, elf_fpregset_t *fpu); | |||
103 | 208 | ||
104 | #define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu) | 209 | #define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu) |
105 | 210 | ||
106 | #ifdef TIF_IA32 /* XXX */ | ||
107 | #error XXX, indeed | ||
108 | clear_thread_flag(TIF_IA32); | ||
109 | #endif | ||
110 | |||
111 | #define ELF_EXEC_PAGESIZE 4096 | 211 | #define ELF_EXEC_PAGESIZE 4096 |
112 | 212 | ||
113 | #define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3) | 213 | #define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3) |
@@ -115,18 +215,7 @@ extern int elf_core_copy_fpregs(struct task_struct *t, elf_fpregset_t *fpu); | |||
115 | extern long elf_aux_hwcap; | 215 | extern long elf_aux_hwcap; |
116 | #define ELF_HWCAP (elf_aux_hwcap) | 216 | #define ELF_HWCAP (elf_aux_hwcap) |
117 | 217 | ||
118 | #define ELF_PLATFORM "x86_64" | ||
119 | |||
120 | #define SET_PERSONALITY(ex) do ; while(0) | 218 | #define SET_PERSONALITY(ex) do ; while(0) |
121 | |||
122 | #define __HAVE_ARCH_GATE_AREA 1 | 219 | #define __HAVE_ARCH_GATE_AREA 1 |
123 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1 | ||
124 | struct linux_binprm; | ||
125 | extern int arch_setup_additional_pages(struct linux_binprm *bprm, | ||
126 | int uses_interp); | ||
127 | |||
128 | extern unsigned long um_vdso_addr; | ||
129 | #define AT_SYSINFO_EHDR 33 | ||
130 | #define ARCH_DLINFO NEW_AUX_ENT(AT_SYSINFO_EHDR, um_vdso_addr) | ||
131 | 220 | ||
132 | #endif | 221 | #endif |
diff --git a/arch/um/sys-x86/asm/module.h b/arch/um/sys-x86/asm/module.h new file mode 100644 index 000000000000..61af80e932eb --- /dev/null +++ b/arch/um/sys-x86/asm/module.h | |||
@@ -0,0 +1,23 @@ | |||
1 | #ifndef __UM_MODULE_H | ||
2 | #define __UM_MODULE_H | ||
3 | |||
4 | /* UML is simple */ | ||
5 | struct mod_arch_specific | ||
6 | { | ||
7 | }; | ||
8 | |||
9 | #ifdef CONFIG_X86_32 | ||
10 | |||
11 | #define Elf_Shdr Elf32_Shdr | ||
12 | #define Elf_Sym Elf32_Sym | ||
13 | #define Elf_Ehdr Elf32_Ehdr | ||
14 | |||
15 | #else | ||
16 | |||
17 | #define Elf_Shdr Elf64_Shdr | ||
18 | #define Elf_Sym Elf64_Sym | ||
19 | #define Elf_Ehdr Elf64_Ehdr | ||
20 | |||
21 | #endif | ||
22 | |||
23 | #endif | ||
diff --git a/arch/um/sys-x86/asm/processor.h b/arch/um/sys-x86/asm/processor.h new file mode 100644 index 000000000000..d3ac1cecf0f4 --- /dev/null +++ b/arch/um/sys-x86/asm/processor.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef __UM_PROCESSOR_H | ||
2 | #define __UM_PROCESSOR_H | ||
3 | |||
4 | /* include faultinfo structure */ | ||
5 | #include <sysdep/faultinfo.h> | ||
6 | |||
7 | #ifdef CONFIG_X86_32 | ||
8 | # include "processor_32.h" | ||
9 | #else | ||
10 | # include "processor_64.h" | ||
11 | #endif | ||
12 | |||
13 | #include <asm/processor-generic.h> | ||
14 | |||
15 | #endif | ||
diff --git a/arch/um/sys-i386/asm/processor.h b/arch/um/sys-x86/asm/processor_32.h index 82a9061ab5be..ae0d189aafcf 100644 --- a/arch/um/sys-i386/asm/processor.h +++ b/arch/um/sys-x86/asm/processor_32.h | |||
@@ -6,15 +6,12 @@ | |||
6 | #ifndef __UM_PROCESSOR_I386_H | 6 | #ifndef __UM_PROCESSOR_I386_H |
7 | #define __UM_PROCESSOR_I386_H | 7 | #define __UM_PROCESSOR_I386_H |
8 | 8 | ||
9 | #include "linux/string.h" | 9 | #include <linux/string.h> |
10 | #include <sysdep/host_ldt.h> | 10 | #include <sysdep/host_ldt.h> |
11 | #include "asm/segment.h" | 11 | #include <asm/segment.h> |
12 | 12 | ||
13 | extern int host_has_cmov; | 13 | extern int host_has_cmov; |
14 | 14 | ||
15 | /* include faultinfo structure */ | ||
16 | #include "sysdep/faultinfo.h" | ||
17 | |||
18 | struct uml_tls_struct { | 15 | struct uml_tls_struct { |
19 | struct user_desc tls; | 16 | struct user_desc tls; |
20 | unsigned flushed:1; | 17 | unsigned flushed:1; |
@@ -73,6 +70,4 @@ static inline void rep_nop(void) | |||
73 | #define KSTK_ESP(tsk) KSTK_REG(tsk, UESP) | 70 | #define KSTK_ESP(tsk) KSTK_REG(tsk, UESP) |
74 | #define KSTK_EBP(tsk) KSTK_REG(tsk, EBP) | 71 | #define KSTK_EBP(tsk) KSTK_REG(tsk, EBP) |
75 | 72 | ||
76 | #include "asm/processor-generic.h" | ||
77 | |||
78 | #endif | 73 | #endif |
diff --git a/arch/um/sys-x86_64/asm/processor.h b/arch/um/sys-x86/asm/processor_64.h index 875a26a62614..6db812b24f48 100644 --- a/arch/um/sys-x86_64/asm/processor.h +++ b/arch/um/sys-x86/asm/processor_64.h | |||
@@ -7,9 +7,6 @@ | |||
7 | #ifndef __UM_PROCESSOR_X86_64_H | 7 | #ifndef __UM_PROCESSOR_X86_64_H |
8 | #define __UM_PROCESSOR_X86_64_H | 8 | #define __UM_PROCESSOR_X86_64_H |
9 | 9 | ||
10 | /* include faultinfo structure */ | ||
11 | #include "sysdep/faultinfo.h" | ||
12 | |||
13 | struct arch_thread { | 10 | struct arch_thread { |
14 | unsigned long debugregs[8]; | 11 | unsigned long debugregs[8]; |
15 | int debugregs_seq; | 12 | int debugregs_seq; |
@@ -51,6 +48,4 @@ static inline void arch_copy_thread(struct arch_thread *from, | |||
51 | #define KSTK_EIP(tsk) KSTK_REG(tsk, RIP) | 48 | #define KSTK_EIP(tsk) KSTK_REG(tsk, RIP) |
52 | #define KSTK_ESP(tsk) KSTK_REG(tsk, RSP) | 49 | #define KSTK_ESP(tsk) KSTK_REG(tsk, RSP) |
53 | 50 | ||
54 | #include "asm/processor-generic.h" | ||
55 | |||
56 | #endif | 51 | #endif |
diff --git a/arch/um/sys-x86/asm/ptrace.h b/arch/um/sys-x86/asm/ptrace.h new file mode 100644 index 000000000000..c8aca8c501b0 --- /dev/null +++ b/arch/um/sys-x86/asm/ptrace.h | |||
@@ -0,0 +1,5 @@ | |||
1 | #ifdef CONFIG_X86_32 | ||
2 | # include "ptrace_32.h" | ||
3 | #else | ||
4 | # include "ptrace_64.h" | ||
5 | #endif | ||
diff --git a/arch/um/sys-i386/asm/ptrace.h b/arch/um/sys-x86/asm/ptrace_32.h index 5d2a59112537..5d2a59112537 100644 --- a/arch/um/sys-i386/asm/ptrace.h +++ b/arch/um/sys-x86/asm/ptrace_32.h | |||
diff --git a/arch/um/sys-x86_64/asm/ptrace.h b/arch/um/sys-x86/asm/ptrace_64.h index 83d8c473b905..83d8c473b905 100644 --- a/arch/um/sys-x86_64/asm/ptrace.h +++ b/arch/um/sys-x86/asm/ptrace_64.h | |||
diff --git a/arch/um/sys-x86_64/asm/vm-flags.h b/arch/um/sys-x86/asm/vm-flags.h index 3978e55132d2..7c297e9e2413 100644 --- a/arch/um/sys-x86_64/asm/vm-flags.h +++ b/arch/um/sys-x86/asm/vm-flags.h | |||
@@ -4,8 +4,17 @@ | |||
4 | * Licensed under the GPL | 4 | * Licensed under the GPL |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #ifndef __VM_FLAGS_X86_64_H | 7 | #ifndef __VM_FLAGS_X86_H |
8 | #define __VM_FLAGS_X86_64_H | 8 | #define __VM_FLAGS_X86_H |
9 | |||
10 | #ifdef CONFIG_X86_32 | ||
11 | |||
12 | #define VM_DATA_DEFAULT_FLAGS \ | ||
13 | (VM_READ | VM_WRITE | \ | ||
14 | ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \ | ||
15 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | ||
16 | |||
17 | #else | ||
9 | 18 | ||
10 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | 19 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ |
11 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | 20 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |
@@ -13,3 +22,4 @@ | |||
13 | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | 22 | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |
14 | 23 | ||
15 | #endif | 24 | #endif |
25 | #endif | ||
diff --git a/arch/um/sys-x86_64/asm/archparam.h b/arch/um/sys-x86_64/asm/archparam.h deleted file mode 100644 index 6c083663b8d9..000000000000 --- a/arch/um/sys-x86_64/asm/archparam.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2003 PathScale, Inc. | ||
3 | * | ||
4 | * Licensed under the GPL | ||
5 | */ | ||
6 | |||
7 | #ifndef __UM_ARCHPARAM_X86_64_H | ||
8 | #define __UM_ARCHPARAM_X86_64_H | ||
9 | |||
10 | |||
11 | /* No user-accessible fixmap addresses, i.e. vsyscall */ | ||
12 | #define FIXADDR_USER_START 0 | ||
13 | #define FIXADDR_USER_END 0 | ||
14 | |||
15 | #endif | ||
16 | |||
diff --git a/arch/um/sys-x86_64/asm/module.h b/arch/um/sys-x86_64/asm/module.h deleted file mode 100644 index 8eb79c2d07d5..000000000000 --- a/arch/um/sys-x86_64/asm/module.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2003 PathScale, Inc. | ||
3 | * | ||
4 | * Licensed under the GPL | ||
5 | */ | ||
6 | |||
7 | #ifndef __UM_MODULE_X86_64_H | ||
8 | #define __UM_MODULE_X86_64_H | ||
9 | |||
10 | /* UML is simple */ | ||
11 | struct mod_arch_specific | ||
12 | { | ||
13 | }; | ||
14 | |||
15 | #define Elf_Shdr Elf64_Shdr | ||
16 | #define Elf_Sym Elf64_Sym | ||
17 | #define Elf_Ehdr Elf64_Ehdr | ||
18 | |||
19 | #endif | ||
20 | |||