aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-um
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-um')
-rw-r--r--include/asm-um/arch-signal-i386.h24
-rw-r--r--include/asm-um/archparam-i386.h137
-rw-r--r--include/asm-um/archparam-ppc.h20
-rw-r--r--include/asm-um/archparam-x86_64.h36
-rw-r--r--include/asm-um/common.lds.S9
-rw-r--r--include/asm-um/delay.h2
-rw-r--r--include/asm-um/elf-i386.h169
-rw-r--r--include/asm-um/elf-ppc.h54
-rw-r--r--include/asm-um/elf-x86_64.h73
-rw-r--r--include/asm-um/elf.h37
-rw-r--r--include/asm-um/fixmap.h1
-rw-r--r--include/asm-um/ipc.h7
-rw-r--r--include/asm-um/linkage.h7
-rw-r--r--include/asm-um/page.h5
-rw-r--r--include/asm-um/pgtable-3level.h4
-rw-r--r--include/asm-um/pgtable.h2
-rw-r--r--include/asm-um/processor-generic.h15
-rw-r--r--include/asm-um/processor-i386.h7
-rw-r--r--include/asm-um/processor-x86_64.h12
-rw-r--r--include/asm-um/ptrace-i386.h2
-rw-r--r--include/asm-um/ptrace-x86_64.h2
-rw-r--r--include/asm-um/setup.h3
-rw-r--r--include/asm-um/thread_info.h4
23 files changed, 348 insertions, 284 deletions
diff --git a/include/asm-um/arch-signal-i386.h b/include/asm-um/arch-signal-i386.h
index 99a9de4728da..e69de29bb2d1 100644
--- a/include/asm-um/arch-signal-i386.h
+++ b/include/asm-um/arch-signal-i386.h
@@ -1,24 +0,0 @@
1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#ifndef __UM_ARCH_SIGNAL_I386_H
7#define __UM_ARCH_SIGNAL_I386_H
8
9struct arch_signal_context {
10 unsigned long extrasigs[_NSIG_WORDS];
11};
12
13#endif
14
15/*
16 * Overrides for Emacs so that we follow Linus's tabbing style.
17 * Emacs will notice this stuff at the end of the file and automatically
18 * adjust the settings for this buffer only. This must remain at the end
19 * of the file.
20 * ---------------------------------------------------------------------------
21 * Local variables:
22 * c-file-style: "linux"
23 * End:
24 */
diff --git a/include/asm-um/archparam-i386.h b/include/asm-um/archparam-i386.h
index 6f78de5b621b..49e89b8d7e58 100644
--- a/include/asm-um/archparam-i386.h
+++ b/include/asm-um/archparam-i386.h
@@ -6,143 +6,6 @@
6#ifndef __UM_ARCHPARAM_I386_H 6#ifndef __UM_ARCHPARAM_I386_H
7#define __UM_ARCHPARAM_I386_H 7#define __UM_ARCHPARAM_I386_H
8 8
9/********* Bits for asm-um/elf.h ************/
10
11#include <asm/user.h>
12
13extern char * elf_aux_platform;
14#define ELF_PLATFORM (elf_aux_platform)
15
16#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
17
18typedef struct user_i387_struct elf_fpregset_t;
19typedef unsigned long elf_greg_t;
20
21#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
22typedef elf_greg_t elf_gregset_t[ELF_NGREG];
23
24#define ELF_DATA ELFDATA2LSB
25#define ELF_ARCH EM_386
26
27#define ELF_PLAT_INIT(regs, load_addr) do { \
28 PT_REGS_EBX(regs) = 0; \
29 PT_REGS_ECX(regs) = 0; \
30 PT_REGS_EDX(regs) = 0; \
31 PT_REGS_ESI(regs) = 0; \
32 PT_REGS_EDI(regs) = 0; \
33 PT_REGS_EBP(regs) = 0; \
34 PT_REGS_EAX(regs) = 0; \
35} while(0)
36
37/* Shamelessly stolen from include/asm-i386/elf.h */
38
39#define ELF_CORE_COPY_REGS(pr_reg, regs) do { \
40 pr_reg[0] = PT_REGS_EBX(regs); \
41 pr_reg[1] = PT_REGS_ECX(regs); \
42 pr_reg[2] = PT_REGS_EDX(regs); \
43 pr_reg[3] = PT_REGS_ESI(regs); \
44 pr_reg[4] = PT_REGS_EDI(regs); \
45 pr_reg[5] = PT_REGS_EBP(regs); \
46 pr_reg[6] = PT_REGS_EAX(regs); \
47 pr_reg[7] = PT_REGS_DS(regs); \
48 pr_reg[8] = PT_REGS_ES(regs); \
49 /* fake once used fs and gs selectors? */ \
50 pr_reg[9] = PT_REGS_DS(regs); \
51 pr_reg[10] = PT_REGS_DS(regs); \
52 pr_reg[11] = PT_REGS_SYSCALL_NR(regs); \
53 pr_reg[12] = PT_REGS_IP(regs); \
54 pr_reg[13] = PT_REGS_CS(regs); \
55 pr_reg[14] = PT_REGS_EFLAGS(regs); \
56 pr_reg[15] = PT_REGS_SP(regs); \
57 pr_reg[16] = PT_REGS_SS(regs); \
58} while(0);
59
60
61extern unsigned long vsyscall_ehdr;
62extern unsigned long vsyscall_end;
63extern unsigned long __kernel_vsyscall;
64
65#define VSYSCALL_BASE vsyscall_ehdr
66#define VSYSCALL_END vsyscall_end
67
68/*
69 * This is the range that is readable by user mode, and things
70 * acting like user mode such as get_user_pages.
71 */
72#define FIXADDR_USER_START VSYSCALL_BASE
73#define FIXADDR_USER_END VSYSCALL_END
74
75/*
76 * Architecture-neutral AT_ values in 0-17, leave some room
77 * for more of them, start the x86-specific ones at 32.
78 */
79#define AT_SYSINFO 32
80#define AT_SYSINFO_EHDR 33
81
82#define ARCH_DLINFO \
83do { \
84 if ( vsyscall_ehdr ) { \
85 NEW_AUX_ENT(AT_SYSINFO, __kernel_vsyscall); \
86 NEW_AUX_ENT(AT_SYSINFO_EHDR, vsyscall_ehdr); \
87 } \
88} while (0)
89
90/*
91 * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out
92 * extra segments containing the vsyscall DSO contents. Dumping its
93 * contents makes post-mortem fully interpretable later without matching up
94 * the same kernel and hardware config to see what PC values meant.
95 * Dumping its extra ELF program headers includes all the other information
96 * a debugger needs to easily find how the vsyscall DSO was being used.
97 */
98#define ELF_CORE_EXTRA_PHDRS \
99 (vsyscall_ehdr ? (((struct elfhdr *)vsyscall_ehdr)->e_phnum) : 0 )
100
101#define ELF_CORE_WRITE_EXTRA_PHDRS \
102if ( vsyscall_ehdr ) { \
103 const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \
104 const struct elf_phdr *const phdrp = \
105 (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \
106 int i; \
107 Elf32_Off ofs = 0; \
108 for (i = 0; i < ehdrp->e_phnum; ++i) { \
109 struct elf_phdr phdr = phdrp[i]; \
110 if (phdr.p_type == PT_LOAD) { \
111 ofs = phdr.p_offset = offset; \
112 offset += phdr.p_filesz; \
113 } \
114 else \
115 phdr.p_offset += ofs; \
116 phdr.p_paddr = 0; /* match other core phdrs */ \
117 DUMP_WRITE(&phdr, sizeof(phdr)); \
118 } \
119}
120#define ELF_CORE_WRITE_EXTRA_DATA \
121if ( vsyscall_ehdr ) { \
122 const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \
123 const struct elf_phdr *const phdrp = \
124 (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \
125 int i; \
126 for (i = 0; i < ehdrp->e_phnum; ++i) { \
127 if (phdrp[i].p_type == PT_LOAD) \
128 DUMP_WRITE((void *) phdrp[i].p_vaddr, \
129 phdrp[i].p_filesz); \
130 } \
131}
132
133#define R_386_NONE 0
134#define R_386_32 1
135#define R_386_PC32 2
136#define R_386_GOT32 3
137#define R_386_PLT32 4
138#define R_386_COPY 5
139#define R_386_GLOB_DAT 6
140#define R_386_JMP_SLOT 7
141#define R_386_RELATIVE 8
142#define R_386_GOTOFF 9
143#define R_386_GOTPC 10
144#define R_386_NUM 11
145
146/********* Nothing for asm-um/hardirq.h **********/ 9/********* Nothing for asm-um/hardirq.h **********/
147 10
148/********* Nothing for asm-um/hw_irq.h **********/ 11/********* Nothing for asm-um/hw_irq.h **********/
diff --git a/include/asm-um/archparam-ppc.h b/include/asm-um/archparam-ppc.h
index 0ebced92a762..172cd6ffacc4 100644
--- a/include/asm-um/archparam-ppc.h
+++ b/include/asm-um/archparam-ppc.h
@@ -1,26 +1,6 @@
1#ifndef __UM_ARCHPARAM_PPC_H 1#ifndef __UM_ARCHPARAM_PPC_H
2#define __UM_ARCHPARAM_PPC_H 2#define __UM_ARCHPARAM_PPC_H
3 3
4/********* Bits for asm-um/elf.h ************/
5
6#define ELF_PLATFORM (0)
7
8#define ELF_ET_DYN_BASE (0x08000000)
9
10/* the following stolen from asm-ppc/elf.h */
11#define ELF_NGREG 48 /* includes nip, msr, lr, etc. */
12#define ELF_NFPREG 33 /* includes fpscr */
13/* General registers */
14typedef unsigned long elf_greg_t;
15typedef elf_greg_t elf_gregset_t[ELF_NGREG];
16
17/* Floating point registers */
18typedef double elf_fpreg_t;
19typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
20
21#define ELF_DATA ELFDATA2MSB
22#define ELF_ARCH EM_PPC
23
24/********* Bits for asm-um/hw_irq.h **********/ 4/********* Bits for asm-um/hw_irq.h **********/
25 5
26struct hw_interrupt_type; 6struct hw_interrupt_type;
diff --git a/include/asm-um/archparam-x86_64.h b/include/asm-um/archparam-x86_64.h
index 96321c4892f1..270ed9586b68 100644
--- a/include/asm-um/archparam-x86_64.h
+++ b/include/asm-um/archparam-x86_64.h
@@ -7,42 +7,6 @@
7#ifndef __UM_ARCHPARAM_X86_64_H 7#ifndef __UM_ARCHPARAM_X86_64_H
8#define __UM_ARCHPARAM_X86_64_H 8#define __UM_ARCHPARAM_X86_64_H
9 9
10#include <asm/user.h>
11
12#define ELF_PLATFORM "x86_64"
13
14#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
15
16typedef unsigned long elf_greg_t;
17typedef struct { } elf_fpregset_t;
18
19#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
20typedef elf_greg_t elf_gregset_t[ELF_NGREG];
21
22#define ELF_DATA ELFDATA2LSB
23#define ELF_ARCH EM_X86_64
24
25#define ELF_PLAT_INIT(regs, load_addr) do { \
26 PT_REGS_RBX(regs) = 0; \
27 PT_REGS_RCX(regs) = 0; \
28 PT_REGS_RDX(regs) = 0; \
29 PT_REGS_RSI(regs) = 0; \
30 PT_REGS_RDI(regs) = 0; \
31 PT_REGS_RBP(regs) = 0; \
32 PT_REGS_RAX(regs) = 0; \
33 PT_REGS_R8(regs) = 0; \
34 PT_REGS_R9(regs) = 0; \
35 PT_REGS_R10(regs) = 0; \
36 PT_REGS_R11(regs) = 0; \
37 PT_REGS_R12(regs) = 0; \
38 PT_REGS_R13(regs) = 0; \
39 PT_REGS_R14(regs) = 0; \
40 PT_REGS_R15(regs) = 0; \
41} while (0)
42
43#ifdef TIF_IA32 /* XXX */
44 clear_thread_flag(TIF_IA32);
45#endif
46 10
47/* No user-accessible fixmap addresses, i.e. vsyscall */ 11/* No user-accessible fixmap addresses, i.e. vsyscall */
48#define FIXADDR_USER_START 0 12#define FIXADDR_USER_START 0
diff --git a/include/asm-um/common.lds.S b/include/asm-um/common.lds.S
index a3d6aab0e74d..1010153faaf9 100644
--- a/include/asm-um/common.lds.S
+++ b/include/asm-um/common.lds.S
@@ -8,11 +8,6 @@
8 _sdata = .; 8 _sdata = .;
9 PROVIDE (sdata = .); 9 PROVIDE (sdata = .);
10 10
11 . = ALIGN(16); /* Exception table */
12 __start___ex_table = .;
13 __ex_table : { *(__ex_table) }
14 __stop___ex_table = .;
15
16 RODATA 11 RODATA
17 12
18 .unprotected : { *(.unprotected) } 13 .unprotected : { *(.unprotected) }
@@ -20,6 +15,10 @@
20 PROVIDE (_unprotected_end = .); 15 PROVIDE (_unprotected_end = .);
21 16
22 . = ALIGN(4096); 17 . = ALIGN(4096);
18 __start___ex_table = .;
19 __ex_table : { *(__ex_table) }
20 __stop___ex_table = .;
21
23 __uml_setup_start = .; 22 __uml_setup_start = .;
24 .uml.setup.init : { *(.uml.setup.init) } 23 .uml.setup.init : { *(.uml.setup.init) }
25 __uml_setup_end = .; 24 __uml_setup_end = .;
diff --git a/include/asm-um/delay.h b/include/asm-um/delay.h
index 40695576ca60..0985bda66750 100644
--- a/include/asm-um/delay.h
+++ b/include/asm-um/delay.h
@@ -4,4 +4,6 @@
4#include "asm/arch/delay.h" 4#include "asm/arch/delay.h"
5#include "asm/archparam.h" 5#include "asm/archparam.h"
6 6
7#define MILLION 1000000
8
7#endif 9#endif
diff --git a/include/asm-um/elf-i386.h b/include/asm-um/elf-i386.h
new file mode 100644
index 000000000000..b72e23519e00
--- /dev/null
+++ b/include/asm-um/elf-i386.h
@@ -0,0 +1,169 @@
1/*
2 * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
3 * Licensed under the GPL
4 */
5#ifndef __UM_ELF_I386_H
6#define __UM_ELF_I386_H
7
8#include "user.h"
9
10#define R_386_NONE 0
11#define R_386_32 1
12#define R_386_PC32 2
13#define R_386_GOT32 3
14#define R_386_PLT32 4
15#define R_386_COPY 5
16#define R_386_GLOB_DAT 6
17#define R_386_JMP_SLOT 7
18#define R_386_RELATIVE 8
19#define R_386_GOTOFF 9
20#define R_386_GOTPC 10
21#define R_386_NUM 11
22
23typedef unsigned long elf_greg_t;
24
25#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
26typedef elf_greg_t elf_gregset_t[ELF_NGREG];
27
28typedef struct user_i387_struct elf_fpregset_t;
29
30/*
31 * This is used to ensure we don't load something for the wrong architecture.
32 */
33#define elf_check_arch(x) \
34 (((x)->e_machine == EM_386) || ((x)->e_machine == EM_486))
35
36#define ELF_CLASS ELFCLASS32
37#define ELF_DATA ELFDATA2LSB
38#define ELF_ARCH EM_386
39
40#define ELF_PLAT_INIT(regs, load_addr) do { \
41 PT_REGS_EBX(regs) = 0; \
42 PT_REGS_ECX(regs) = 0; \
43 PT_REGS_EDX(regs) = 0; \
44 PT_REGS_ESI(regs) = 0; \
45 PT_REGS_EDI(regs) = 0; \
46 PT_REGS_EBP(regs) = 0; \
47 PT_REGS_EAX(regs) = 0; \
48} while(0)
49
50#define USE_ELF_CORE_DUMP
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
78extern long elf_aux_hwcap;
79#define ELF_HWCAP (elf_aux_hwcap)
80
81extern char * elf_aux_platform;
82#define ELF_PLATFORM (elf_aux_platform)
83
84#define SET_PERSONALITY(ex, ibcs2) do ; while(0)
85
86extern unsigned long vsyscall_ehdr;
87extern unsigned long vsyscall_end;
88extern unsigned long __kernel_vsyscall;
89
90#define VSYSCALL_BASE vsyscall_ehdr
91#define VSYSCALL_END vsyscall_end
92
93/*
94 * This is the range that is readable by user mode, and things
95 * acting like user mode such as get_user_pages.
96 */
97#define FIXADDR_USER_START VSYSCALL_BASE
98#define FIXADDR_USER_END VSYSCALL_END
99
100/*
101 * Architecture-neutral AT_ values in 0-17, leave some room
102 * for more of them, start the x86-specific ones at 32.
103 */
104#define AT_SYSINFO 32
105#define AT_SYSINFO_EHDR 33
106
107#define ARCH_DLINFO \
108do { \
109 if ( vsyscall_ehdr ) { \
110 NEW_AUX_ENT(AT_SYSINFO, __kernel_vsyscall); \
111 NEW_AUX_ENT(AT_SYSINFO_EHDR, vsyscall_ehdr); \
112 } \
113} while (0)
114
115/*
116 * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out
117 * extra segments containing the vsyscall DSO contents. Dumping its
118 * contents makes post-mortem fully interpretable later without matching up
119 * the same kernel and hardware config to see what PC values meant.
120 * Dumping its extra ELF program headers includes all the other information
121 * a debugger needs to easily find how the vsyscall DSO was being used.
122 */
123#define ELF_CORE_EXTRA_PHDRS \
124 (vsyscall_ehdr ? (((struct elfhdr *)vsyscall_ehdr)->e_phnum) : 0 )
125
126#define ELF_CORE_WRITE_EXTRA_PHDRS \
127if ( vsyscall_ehdr ) { \
128 const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \
129 const struct elf_phdr *const phdrp = \
130 (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \
131 int i; \
132 Elf32_Off ofs = 0; \
133 for (i = 0; i < ehdrp->e_phnum; ++i) { \
134 struct elf_phdr phdr = phdrp[i]; \
135 if (phdr.p_type == PT_LOAD) { \
136 ofs = phdr.p_offset = offset; \
137 offset += phdr.p_filesz; \
138 } \
139 else \
140 phdr.p_offset += ofs; \
141 phdr.p_paddr = 0; /* match other core phdrs */ \
142 DUMP_WRITE(&phdr, sizeof(phdr)); \
143 } \
144}
145#define ELF_CORE_WRITE_EXTRA_DATA \
146if ( vsyscall_ehdr ) { \
147 const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \
148 const struct elf_phdr *const phdrp = \
149 (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \
150 int i; \
151 for (i = 0; i < ehdrp->e_phnum; ++i) { \
152 if (phdrp[i].p_type == PT_LOAD) \
153 DUMP_WRITE((void *) phdrp[i].p_vaddr, \
154 phdrp[i].p_filesz); \
155 } \
156}
157
158#endif
159
160/*
161 * Overrides for Emacs so that we follow Linus's tabbing style.
162 * Emacs will notice this stuff at the end of the file and automatically
163 * adjust the settings for this buffer only. This must remain at the end
164 * of the file.
165 * ---------------------------------------------------------------------------
166 * Local variables:
167 * c-file-style: "linux"
168 * End:
169 */
diff --git a/include/asm-um/elf-ppc.h b/include/asm-um/elf-ppc.h
new file mode 100644
index 000000000000..2998cf925042
--- /dev/null
+++ b/include/asm-um/elf-ppc.h
@@ -0,0 +1,54 @@
1#ifndef __UM_ELF_PPC_H
2#define __UM_ELF_PPC_H
3
4#include "linux/config.h"
5
6extern long elf_aux_hwcap;
7#define ELF_HWCAP (elf_aux_hwcap)
8
9#define SET_PERSONALITY(ex, ibcs2) do ; while(0)
10
11#define ELF_EXEC_PAGESIZE 4096
12
13#define elf_check_arch(x) (1)
14
15#ifdef CONFIG_64_BIT
16#define ELF_CLASS ELFCLASS64
17#else
18#define ELF_CLASS ELFCLASS32
19#endif
20
21#define USE_ELF_CORE_DUMP
22
23#define R_386_NONE 0
24#define R_386_32 1
25#define R_386_PC32 2
26#define R_386_GOT32 3
27#define R_386_PLT32 4
28#define R_386_COPY 5
29#define R_386_GLOB_DAT 6
30#define R_386_JMP_SLOT 7
31#define R_386_RELATIVE 8
32#define R_386_GOTOFF 9
33#define R_386_GOTPC 10
34#define R_386_NUM 11
35
36#define ELF_PLATFORM (0)
37
38#define ELF_ET_DYN_BASE (0x08000000)
39
40/* the following stolen from asm-ppc/elf.h */
41#define ELF_NGREG 48 /* includes nip, msr, lr, etc. */
42#define ELF_NFPREG 33 /* includes fpscr */
43/* General registers */
44typedef unsigned long elf_greg_t;
45typedef elf_greg_t elf_gregset_t[ELF_NGREG];
46
47/* Floating point registers */
48typedef double elf_fpreg_t;
49typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
50
51#define ELF_DATA ELFDATA2MSB
52#define ELF_ARCH EM_PPC
53
54#endif
diff --git a/include/asm-um/elf-x86_64.h b/include/asm-um/elf-x86_64.h
new file mode 100644
index 000000000000..19309d001aa0
--- /dev/null
+++ b/include/asm-um/elf-x86_64.h
@@ -0,0 +1,73 @@
1/*
2 * Copyright 2003 PathScale, Inc.
3 *
4 * Licensed under the GPL
5 */
6#ifndef __UM_ELF_X86_64_H
7#define __UM_ELF_X86_64_H
8
9#include <asm/user.h>
10
11typedef unsigned long elf_greg_t;
12
13#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
14typedef elf_greg_t elf_gregset_t[ELF_NGREG];
15
16typedef struct { } elf_fpregset_t;
17
18/*
19 * This is used to ensure we don't load something for the wrong architecture.
20 */
21#define elf_check_arch(x) \
22 ((x)->e_machine == EM_X86_64)
23
24#define ELF_CLASS ELFCLASS64
25#define ELF_DATA ELFDATA2LSB
26#define ELF_ARCH EM_X86_64
27
28#define ELF_PLAT_INIT(regs, load_addr) do { \
29 PT_REGS_RBX(regs) = 0; \
30 PT_REGS_RCX(regs) = 0; \
31 PT_REGS_RDX(regs) = 0; \
32 PT_REGS_RSI(regs) = 0; \
33 PT_REGS_RDI(regs) = 0; \
34 PT_REGS_RBP(regs) = 0; \
35 PT_REGS_RAX(regs) = 0; \
36 PT_REGS_R8(regs) = 0; \
37 PT_REGS_R9(regs) = 0; \
38 PT_REGS_R10(regs) = 0; \
39 PT_REGS_R11(regs) = 0; \
40 PT_REGS_R12(regs) = 0; \
41 PT_REGS_R13(regs) = 0; \
42 PT_REGS_R14(regs) = 0; \
43 PT_REGS_R15(regs) = 0; \
44} while (0)
45
46#ifdef TIF_IA32 /* XXX */
47 clear_thread_flag(TIF_IA32); \
48#endif
49
50#define USE_ELF_CORE_DUMP
51#define ELF_EXEC_PAGESIZE 4096
52
53#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
54
55extern long elf_aux_hwcap;
56#define ELF_HWCAP (elf_aux_hwcap)
57
58#define ELF_PLATFORM "x86_64"
59
60#define SET_PERSONALITY(ex, ibcs2) do ; while(0)
61
62#endif
63
64/*
65 * Overrides for Emacs so that we follow Linus's tabbing style.
66 * Emacs will notice this stuff at the end of the file and automatically
67 * adjust the settings for this buffer only. This must remain at the end
68 * of the file.
69 * ---------------------------------------------------------------------------
70 * Local variables:
71 * c-file-style: "linux"
72 * End:
73 */
diff --git a/include/asm-um/elf.h b/include/asm-um/elf.h
index b3a7258f9971..e69de29bb2d1 100644
--- a/include/asm-um/elf.h
+++ b/include/asm-um/elf.h
@@ -1,37 +0,0 @@
1#ifndef __UM_ELF_H
2#define __UM_ELF_H
3
4#include "linux/config.h"
5#include "asm/archparam.h"
6
7extern long elf_aux_hwcap;
8#define ELF_HWCAP (elf_aux_hwcap)
9
10#define SET_PERSONALITY(ex, ibcs2) do ; while(0)
11
12#define ELF_EXEC_PAGESIZE 4096
13
14#define elf_check_arch(x) (1)
15
16#ifdef CONFIG_64_BIT
17#define ELF_CLASS ELFCLASS64
18#else
19#define ELF_CLASS ELFCLASS32
20#endif
21
22#define USE_ELF_CORE_DUMP
23
24#define R_386_NONE 0
25#define R_386_32 1
26#define R_386_PC32 2
27#define R_386_GOT32 3
28#define R_386_PLT32 4
29#define R_386_COPY 5
30#define R_386_GLOB_DAT 6
31#define R_386_JMP_SLOT 7
32#define R_386_RELATIVE 8
33#define R_386_GOTOFF 9
34#define R_386_GOTPC 10
35#define R_386_NUM 11
36
37#endif
diff --git a/include/asm-um/fixmap.h b/include/asm-um/fixmap.h
index 900f3fbb9fab..ae0ca3932d50 100644
--- a/include/asm-um/fixmap.h
+++ b/include/asm-um/fixmap.h
@@ -4,6 +4,7 @@
4#include <linux/config.h> 4#include <linux/config.h>
5#include <asm/kmap_types.h> 5#include <asm/kmap_types.h>
6#include <asm/archparam.h> 6#include <asm/archparam.h>
7#include <asm/elf.h>
7 8
8/* 9/*
9 * Here we define all the compile-time 'special' virtual 10 * Here we define all the compile-time 'special' virtual
diff --git a/include/asm-um/ipc.h b/include/asm-um/ipc.h
index e2ddc47f3e52..a46e3d9c2a3f 100644
--- a/include/asm-um/ipc.h
+++ b/include/asm-um/ipc.h
@@ -1,6 +1 @@
1#ifndef __UM_IPC_H #include <asm-generic/ipc.h>
2#define __UM_IPC_H
3
4#include "asm/arch/ipc.h"
5
6#endif
diff --git a/include/asm-um/linkage.h b/include/asm-um/linkage.h
index 27011652b015..7dfce37adc8b 100644
--- a/include/asm-um/linkage.h
+++ b/include/asm-um/linkage.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_LINKAGE_H 1#ifndef __ASM_UM_LINKAGE_H
2#define __ASM_LINKAGE_H 2#define __ASM_UM_LINKAGE_H
3 3
4#define FASTCALL(x) x __attribute__((regparm(3))) 4#include "asm/arch/linkage.h"
5#define fastcall __attribute__((regparm(3)))
6 5
7#endif 6#endif
diff --git a/include/asm-um/page.h b/include/asm-um/page.h
index 3620a08dc9f3..504ea8e486b0 100644
--- a/include/asm-um/page.h
+++ b/include/asm-um/page.h
@@ -27,7 +27,7 @@ struct page;
27#define clear_user_page(page, vaddr, pg) clear_page(page) 27#define clear_user_page(page, vaddr, pg) clear_page(page)
28#define copy_user_page(to, from, vaddr, pg) copy_page(to, from) 28#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
29 29
30#if defined(CONFIG_3_LEVEL_PGTABLES) && !defined(CONFIG_64_BIT) 30#if defined(CONFIG_3_LEVEL_PGTABLES) && !defined(CONFIG_64BIT)
31 31
32typedef struct { unsigned long pte_low, pte_high; } pte_t; 32typedef struct { unsigned long pte_low, pte_high; } pte_t;
33typedef struct { unsigned long long pmd; } pmd_t; 33typedef struct { unsigned long long pmd; } pmd_t;
@@ -45,6 +45,9 @@ typedef struct { unsigned long pgd; } pgd_t;
45 ({ (pte).pte_high = (phys) >> 32; \ 45 ({ (pte).pte_high = (phys) >> 32; \
46 (pte).pte_low = (phys) | pgprot_val(prot); }) 46 (pte).pte_low = (phys) | pgprot_val(prot); })
47 47
48#define pmd_val(x) ((x).pmd)
49#define __pmd(x) ((pmd_t) { (x) } )
50
48typedef unsigned long long pfn_t; 51typedef unsigned long long pfn_t;
49typedef unsigned long long phys_t; 52typedef unsigned long long phys_t;
50 53
diff --git a/include/asm-um/pgtable-3level.h b/include/asm-um/pgtable-3level.h
index bdbc3f97e20b..65e8bfc55fc4 100644
--- a/include/asm-um/pgtable-3level.h
+++ b/include/asm-um/pgtable-3level.h
@@ -145,11 +145,11 @@ static inline pmd_t pfn_pmd(pfn_t page_nr, pgprot_t pgprot)
145 */ 145 */
146#define PTE_FILE_MAX_BITS 32 146#define PTE_FILE_MAX_BITS 32
147 147
148#ifdef CONFIG_64_BIT 148#ifdef CONFIG_64BIT
149 149
150#define pte_to_pgoff(p) ((p).pte >> 32) 150#define pte_to_pgoff(p) ((p).pte >> 32)
151 151
152#define pgoff_to_pte(off) ((pte_t) { ((off) < 32) | _PAGE_FILE }) 152#define pgoff_to_pte(off) ((pte_t) { ((off) << 32) | _PAGE_FILE })
153 153
154#else 154#else
155 155
diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h
index 71f9c0c78c0c..510e513c7f88 100644
--- a/include/asm-um/pgtable.h
+++ b/include/asm-um/pgtable.h
@@ -106,7 +106,7 @@ extern unsigned long end_iomem;
106/* 106/*
107 * Define this if things work differently on an i386 and an i486: 107 * Define this if things work differently on an i386 and an i486:
108 * it will (on an i486) warn about kernel memory accesses that are 108 * it will (on an i486) warn about kernel memory accesses that are
109 * done without a 'verify_area(VERIFY_WRITE,..)' 109 * done without a 'access_ok(VERIFY_WRITE,..)'
110 */ 110 */
111#undef TEST_VERIFY_AREA 111#undef TEST_VERIFY_AREA
112 112
diff --git a/include/asm-um/processor-generic.h b/include/asm-um/processor-generic.h
index 038ba6fc88b8..b2fc94fbc2d9 100644
--- a/include/asm-um/processor-generic.h
+++ b/include/asm-um/processor-generic.h
@@ -17,12 +17,13 @@ struct task_struct;
17struct mm_struct; 17struct mm_struct;
18 18
19struct thread_struct { 19struct thread_struct {
20 /* This flag is set to 1 before calling do_fork (and analyzed in
21 * copy_thread) to mark that we are begin called from userspace (fork /
22 * vfork / clone), and reset to 0 after. It is left to 0 when called
23 * from kernelspace (i.e. kernel_thread() or fork_idle(), as of 2.6.11). */
20 int forking; 24 int forking;
21 int nsyscalls; 25 int nsyscalls;
22 struct pt_regs regs; 26 struct pt_regs regs;
23 unsigned long cr2;
24 int err;
25 unsigned long trap_no;
26 int singlestep_syscall; 27 int singlestep_syscall;
27 void *fault_addr; 28 void *fault_addr;
28 void *fault_catcher; 29 void *fault_catcher;
@@ -70,8 +71,6 @@ struct thread_struct {
70 .forking = 0, \ 71 .forking = 0, \
71 .nsyscalls = 0, \ 72 .nsyscalls = 0, \
72 .regs = EMPTY_REGS, \ 73 .regs = EMPTY_REGS, \
73 .cr2 = 0, \
74 .err = 0, \
75 .fault_addr = NULL, \ 74 .fault_addr = NULL, \
76 .prev_sched = NULL, \ 75 .prev_sched = NULL, \
77 .temp_stack = 0, \ 76 .temp_stack = 0, \
@@ -89,7 +88,11 @@ extern struct task_struct *alloc_task_struct(void);
89extern void release_thread(struct task_struct *); 88extern void release_thread(struct task_struct *);
90extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); 89extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
91extern void dump_thread(struct pt_regs *regs, struct user *u); 90extern void dump_thread(struct pt_regs *regs, struct user *u);
92extern void prepare_to_copy(struct task_struct *tsk); 91
92static inline void prepare_to_copy(struct task_struct *tsk)
93{
94}
95
93 96
94extern unsigned long thread_saved_pc(struct task_struct *t); 97extern unsigned long thread_saved_pc(struct task_struct *t);
95 98
diff --git a/include/asm-um/processor-i386.h b/include/asm-um/processor-i386.h
index 2deb8f1adbf1..431bad3ae9d7 100644
--- a/include/asm-um/processor-i386.h
+++ b/include/asm-um/processor-i386.h
@@ -9,13 +9,18 @@
9extern int host_has_xmm; 9extern int host_has_xmm;
10extern int host_has_cmov; 10extern int host_has_cmov;
11 11
12/* include faultinfo structure */
13#include "sysdep/faultinfo.h"
14
12struct arch_thread { 15struct arch_thread {
13 unsigned long debugregs[8]; 16 unsigned long debugregs[8];
14 int debugregs_seq; 17 int debugregs_seq;
18 struct faultinfo faultinfo;
15}; 19};
16 20
17#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \ 21#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \
18 .debugregs_seq = 0 } 22 .debugregs_seq = 0, \
23 .faultinfo = { 0, 0, 0 } }
19 24
20#include "asm/arch/user.h" 25#include "asm/arch/user.h"
21 26
diff --git a/include/asm-um/processor-x86_64.h b/include/asm-um/processor-x86_64.h
index a1ae3a4cd938..0beb9a42ae05 100644
--- a/include/asm-um/processor-x86_64.h
+++ b/include/asm-um/processor-x86_64.h
@@ -7,9 +7,13 @@
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 "asm/arch/user.h" 10/* include faultinfo structure */
11#include "sysdep/faultinfo.h"
11 12
12struct arch_thread { 13struct arch_thread {
14 unsigned long debugregs[8];
15 int debugregs_seq;
16 struct faultinfo faultinfo;
13}; 17};
14 18
15/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ 19/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
@@ -20,7 +24,11 @@ extern inline void rep_nop(void)
20 24
21#define cpu_relax() rep_nop() 25#define cpu_relax() rep_nop()
22 26
23#define INIT_ARCH_THREAD { } 27#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \
28 .debugregs_seq = 0, \
29 .faultinfo = { 0, 0, 0 } }
30
31#include "asm/arch/user.h"
24 32
25#define current_text_addr() \ 33#define current_text_addr() \
26 ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; }) 34 ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; })
diff --git a/include/asm-um/ptrace-i386.h b/include/asm-um/ptrace-i386.h
index 9e47590ec293..04222f35c43e 100644
--- a/include/asm-um/ptrace-i386.h
+++ b/include/asm-um/ptrace-i386.h
@@ -6,6 +6,8 @@
6#ifndef __UM_PTRACE_I386_H 6#ifndef __UM_PTRACE_I386_H
7#define __UM_PTRACE_I386_H 7#define __UM_PTRACE_I386_H
8 8
9#define HOST_AUDIT_ARCH AUDIT_ARCH_I386
10
9#include "sysdep/ptrace.h" 11#include "sysdep/ptrace.h"
10#include "asm/ptrace-generic.h" 12#include "asm/ptrace-generic.h"
11 13
diff --git a/include/asm-um/ptrace-x86_64.h b/include/asm-um/ptrace-x86_64.h
index c34be39b78b2..be51219a8ffe 100644
--- a/include/asm-um/ptrace-x86_64.h
+++ b/include/asm-um/ptrace-x86_64.h
@@ -14,6 +14,8 @@
14#include "asm/ptrace-generic.h" 14#include "asm/ptrace-generic.h"
15#undef signal_fault 15#undef signal_fault
16 16
17#define HOST_AUDIT_ARCH AUDIT_ARCH_X86_64
18
17void signal_fault(struct pt_regs_subarch *regs, void *frame, char *where); 19void signal_fault(struct pt_regs_subarch *regs, void *frame, char *where);
18 20
19#define FS_BASE (21 * sizeof(unsigned long)) 21#define FS_BASE (21 * sizeof(unsigned long))
diff --git a/include/asm-um/setup.h b/include/asm-um/setup.h
index c85252e803c1..99f086301f4c 100644
--- a/include/asm-um/setup.h
+++ b/include/asm-um/setup.h
@@ -2,7 +2,8 @@
2#define SETUP_H_INCLUDED 2#define SETUP_H_INCLUDED
3 3
4/* POSIX mandated with _POSIX_ARG_MAX that we can rely on 4096 chars in the 4/* POSIX mandated with _POSIX_ARG_MAX that we can rely on 4096 chars in the
5 * command line, so this choice is ok.*/ 5 * command line, so this choice is ok.
6 */
6 7
7#define COMMAND_LINE_SIZE 4096 8#define COMMAND_LINE_SIZE 4096
8 9
diff --git a/include/asm-um/thread_info.h b/include/asm-um/thread_info.h
index bffb577bc54e..a10ea155907e 100644
--- a/include/asm-um/thread_info.h
+++ b/include/asm-um/thread_info.h
@@ -72,12 +72,14 @@ static inline struct thread_info *current_thread_info(void)
72 */ 72 */
73#define TIF_RESTART_BLOCK 4 73#define TIF_RESTART_BLOCK 4
74#define TIF_MEMDIE 5 74#define TIF_MEMDIE 5
75#define TIF_SYSCALL_AUDIT 6
75 76
76#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 77#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
77#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 78#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
78#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) 79#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
79#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 80#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
80#define _TIF_RESTART_BLOCK (1 << TIF_RESTART_BLOCK) 81#define _TIF_MEMDIE (1 << TIF_MEMDIE)
82#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
81 83
82#endif 84#endif
83 85