History

arm64: make asm/elf.h available to asm files

This reshuffles some code in asm/elf.h and puts a #ifndef __ASSEMBLY__ around its C definitions so that the CPP defines can be used in asm source files as well.

Ard Biesheuvel committed 10 years ago

Commit 4a2e0341 parent 2bf31a41 file · +13 −9Browse files

Unified · Split

arch/arm64/include/asm/elf.h+13−9
@@ -24,15 +24,6 @@ · 23 unmodified lines
2424 #include <asm/ptrace.h>
2525 #include <asm/user.h>
2626
27−typedef unsigned long elf_greg_t;
28−
29−#define ELF_NGREG (sizeof(struct user_pt_regs) / sizeof(elf_greg_t))
30−#define ELF_CORE_COPY_REGS(dest, regs) \
31− *(struct user_pt_regs *)&(dest) = (regs)->user_regs;
32−
33−typedef elf_greg_t elf_gregset_t[ELF_NGREG];
34−typedef struct user_fpsimd_state elf_fpregset_t;
35−
3627 /*
3728 * AArch64 static relocation types.
3829 */
@@ -127,6 +118,17 @@ typedef struct user_fpsimd_state elf_fpregset_t; · 88 unmodified lines
127118 */
128119 #define ELF_ET_DYN_BASE (2 * TASK_SIZE_64 / 3)
129120
121+#ifndef __ASSEMBLY__
122+
123+typedef unsigned long elf_greg_t;
124+
125+#define ELF_NGREG (sizeof(struct user_pt_regs) / sizeof(elf_greg_t))
126+#define ELF_CORE_COPY_REGS(dest, regs) \
127+ *(struct user_pt_regs *)&(dest) = (regs)->user_regs;
128+
129+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
130+typedef struct user_fpsimd_state elf_fpregset_t;
131+
130132 /*
131133 * When the program starts, a1 contains a pointer to a function to be
132134 * registered with atexit, as per the SVR4 ABI. A value of 0 means we have no
@@ -186,4 +188,6 @@ extern int aarch32_setup_vectors_page(struct linux_binprm *bprm, · 53 unmodified lines
186188
187189 #endif /* CONFIG_COMPAT */
188190
191+#endif /* !__ASSEMBLY__ */
192+
189193 #endif