aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/elf.h
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2008-03-23 04:02:08 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:23 -0400
commit486386f6c1b5144ccc8eb2f28def1712e1dd6c3d (patch)
tree6ce278b24589fcc15aa1a28d8032195ef428db4b /include/asm-x86/elf.h
parent0c6f6abf6e63227b1e6e22e412c3f63c0163a520 (diff)
include/asm-x86/elf.h: checkpatch cleanups - formatting only
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/elf.h')
-rw-r--r--include/asm-x86/elf.h107
1 files changed, 60 insertions, 47 deletions
diff --git a/include/asm-x86/elf.h b/include/asm-x86/elf.h
index 77325646e2f4..8f232dc5b5fe 100644
--- a/include/asm-x86/elf.h
+++ b/include/asm-x86/elf.h
@@ -11,7 +11,7 @@
11 11
12typedef unsigned long elf_greg_t; 12typedef unsigned long elf_greg_t;
13 13
14#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) 14#define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
15typedef elf_greg_t elf_gregset_t[ELF_NGREG]; 15typedef elf_greg_t elf_gregset_t[ELF_NGREG];
16 16
17typedef struct user_i387_struct elf_fpregset_t; 17typedef struct user_i387_struct elf_fpregset_t;
@@ -100,10 +100,11 @@ extern unsigned int vdso_enabled;
100 We might as well make sure everything else is cleared too (except for %esp), 100 We might as well make sure everything else is cleared too (except for %esp),
101 just to make things more deterministic. 101 just to make things more deterministic.
102 */ 102 */
103#define ELF_PLAT_INIT(_r, load_addr) do { \ 103#define ELF_PLAT_INIT(_r, load_addr) \
104 _r->bx = 0; _r->cx = 0; _r->dx = 0; \ 104 do { \
105 _r->si = 0; _r->di = 0; _r->bp = 0; \ 105 _r->bx = 0; _r->cx = 0; _r->dx = 0; \
106 _r->ax = 0; \ 106 _r->si = 0; _r->di = 0; _r->bp = 0; \
107 _r->ax = 0; \
107} while (0) 108} while (0)
108 109
109/* 110/*
@@ -111,24 +112,25 @@ extern unsigned int vdso_enabled;
111 * now struct_user_regs, they are different) 112 * now struct_user_regs, they are different)
112 */ 113 */
113 114
114#define ELF_CORE_COPY_REGS(pr_reg, regs) do { \ 115#define ELF_CORE_COPY_REGS(pr_reg, regs) \
115 pr_reg[0] = regs->bx; \ 116do { \
116 pr_reg[1] = regs->cx; \ 117 pr_reg[0] = regs->bx; \
117 pr_reg[2] = regs->dx; \ 118 pr_reg[1] = regs->cx; \
118 pr_reg[3] = regs->si; \ 119 pr_reg[2] = regs->dx; \
119 pr_reg[4] = regs->di; \ 120 pr_reg[3] = regs->si; \
120 pr_reg[5] = regs->bp; \ 121 pr_reg[4] = regs->di; \
121 pr_reg[6] = regs->ax; \ 122 pr_reg[5] = regs->bp; \
122 pr_reg[7] = regs->ds & 0xffff; \ 123 pr_reg[6] = regs->ax; \
123 pr_reg[8] = regs->es & 0xffff; \ 124 pr_reg[7] = regs->ds & 0xffff; \
124 pr_reg[9] = regs->fs & 0xffff; \ 125 pr_reg[8] = regs->es & 0xffff; \
125 savesegment(gs, pr_reg[10]); \ 126 pr_reg[9] = regs->fs & 0xffff; \
126 pr_reg[11] = regs->orig_ax; \ 127 savesegment(gs, pr_reg[10]); \
127 pr_reg[12] = regs->ip; \ 128 pr_reg[11] = regs->orig_ax; \
128 pr_reg[13] = regs->cs & 0xffff; \ 129 pr_reg[12] = regs->ip; \
129 pr_reg[14] = regs->flags; \ 130 pr_reg[13] = regs->cs & 0xffff; \
130 pr_reg[15] = regs->sp; \ 131 pr_reg[14] = regs->flags; \
131 pr_reg[16] = regs->ss & 0xffff; \ 132 pr_reg[15] = regs->sp; \
133 pr_reg[16] = regs->ss & 0xffff; \
132} while (0); 134} while (0);
133 135
134#define ELF_PLATFORM (utsname()->machine) 136#define ELF_PLATFORM (utsname()->machine)
@@ -139,7 +141,7 @@ extern unsigned int vdso_enabled;
139/* 141/*
140 * This is used to ensure we don't load something for the wrong architecture. 142 * This is used to ensure we don't load something for the wrong architecture.
141 */ 143 */
142#define elf_check_arch(x) \ 144#define elf_check_arch(x) \
143 ((x)->e_machine == EM_X86_64) 145 ((x)->e_machine == EM_X86_64)
144 146
145#define compat_elf_check_arch(x) elf_check_arch_ia32(x) 147#define compat_elf_check_arch(x) elf_check_arch_ia32(x)
@@ -168,24 +170,30 @@ static inline void elf_common_init(struct thread_struct *t,
168 t->ds = t->es = ds; 170 t->ds = t->es = ds;
169} 171}
170 172
171#define ELF_PLAT_INIT(_r, load_addr) do { \ 173#define ELF_PLAT_INIT(_r, load_addr) \
172 elf_common_init(&current->thread, _r, 0); \ 174do { \
173 clear_thread_flag(TIF_IA32); \ 175 elf_common_init(&current->thread, _r, 0); \
176 clear_thread_flag(TIF_IA32); \
174} while (0) 177} while (0)
175 178
176#define COMPAT_ELF_PLAT_INIT(regs, load_addr) \ 179#define COMPAT_ELF_PLAT_INIT(regs, load_addr) \
177 elf_common_init(&current->thread, regs, __USER_DS) 180 elf_common_init(&current->thread, regs, __USER_DS)
178#define compat_start_thread(regs, ip, sp) do { \ 181
179 start_ia32_thread(regs, ip, sp); \ 182#define compat_start_thread(regs, ip, sp) \
180 set_fs(USER_DS); \ 183do { \
181 } while (0) 184 start_ia32_thread(regs, ip, sp); \
182#define COMPAT_SET_PERSONALITY(ex, ibcs2) do { \ 185 set_fs(USER_DS); \
183 if (test_thread_flag(TIF_IA32)) \ 186} while (0)
184 clear_thread_flag(TIF_ABI_PENDING); \ 187
185 else \ 188#define COMPAT_SET_PERSONALITY(ex, ibcs2) \
186 set_thread_flag(TIF_ABI_PENDING); \ 189do { \
187 current->personality |= force_personality32; \ 190 if (test_thread_flag(TIF_IA32)) \
188 } while (0) 191 clear_thread_flag(TIF_ABI_PENDING); \
192 else \
193 set_thread_flag(TIF_ABI_PENDING); \
194 current->personality |= force_personality32; \
195} while (0)
196
189#define COMPAT_ELF_PLATFORM ("i686") 197#define COMPAT_ELF_PLATFORM ("i686")
190 198
191/* 199/*
@@ -194,7 +202,8 @@ static inline void elf_common_init(struct thread_struct *t,
194 * getting dumped. 202 * getting dumped.
195 */ 203 */
196 204
197#define ELF_CORE_COPY_REGS(pr_reg, regs) do { \ 205#define ELF_CORE_COPY_REGS(pr_reg, regs) \
206do { \
198 unsigned v; \ 207 unsigned v; \
199 (pr_reg)[0] = (regs)->r15; \ 208 (pr_reg)[0] = (regs)->r15; \
200 (pr_reg)[1] = (regs)->r14; \ 209 (pr_reg)[1] = (regs)->r14; \
@@ -268,10 +277,12 @@ extern int force_personality32;
268 277
269struct task_struct; 278struct task_struct;
270 279
271#define ARCH_DLINFO_IA32(vdso_enabled) \ 280#define ARCH_DLINFO_IA32(vdso_enabled) \
272do if (vdso_enabled) { \ 281do { \
282 if (vdso_enabled) { \
273 NEW_AUX_ENT(AT_SYSINFO, VDSO_ENTRY); \ 283 NEW_AUX_ENT(AT_SYSINFO, VDSO_ENTRY); \
274 NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_CURRENT_BASE); \ 284 NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_CURRENT_BASE); \
285 } \
275} while (0) 286} while (0)
276 287
277#ifdef CONFIG_X86_32 288#ifdef CONFIG_X86_32
@@ -289,9 +300,11 @@ do if (vdso_enabled) { \
289/* 1GB for 64bit, 8MB for 32bit */ 300/* 1GB for 64bit, 8MB for 32bit */
290#define STACK_RND_MASK (test_thread_flag(TIF_IA32) ? 0x7ff : 0x3fffff) 301#define STACK_RND_MASK (test_thread_flag(TIF_IA32) ? 0x7ff : 0x3fffff)
291 302
292#define ARCH_DLINFO \ 303#define ARCH_DLINFO \
293do if (vdso_enabled) { \ 304do { \
294 NEW_AUX_ENT(AT_SYSINFO_EHDR,(unsigned long)current->mm->context.vdso);\ 305 if (vdso_enabled) \
306 NEW_AUX_ENT(AT_SYSINFO_EHDR, \
307 (unsigned long)current->mm->context.vdso); \
295} while (0) 308} while (0)
296 309
297#define AT_SYSINFO 32 310#define AT_SYSINFO 32
@@ -304,8 +317,8 @@ do if (vdso_enabled) { \
304 317
305#define VDSO_CURRENT_BASE ((unsigned long)current->mm->context.vdso) 318#define VDSO_CURRENT_BASE ((unsigned long)current->mm->context.vdso)
306 319
307#define VDSO_ENTRY \ 320#define VDSO_ENTRY \
308 ((unsigned long) VDSO32_SYMBOL(VDSO_CURRENT_BASE, vsyscall)) 321 ((unsigned long)VDSO32_SYMBOL(VDSO_CURRENT_BASE, vsyscall))
309 322
310struct linux_binprm; 323struct linux_binprm;
311 324