diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-11-09 09:07:52 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-11-30 07:24:45 -0500 |
commit | 4a5222ca435c2af7466e5d262389609978a8e576 (patch) | |
tree | 1510f4dd35cf3d61a9e7ba1b2b44fa0246289b02 | |
parent | beea494d5e09f9e2172894ec84324b94244826a9 (diff) |
[ARM] Arrange asm-arm/elf.h so it can be included by assembly
Prepare elf.h so that assembly code can include this file.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | include/asm-arm/elf.h | 92 |
1 files changed, 49 insertions, 43 deletions
diff --git a/include/asm-arm/elf.h b/include/asm-arm/elf.h index 17f0c656d272..30942431e9fb 100644 --- a/include/asm-arm/elf.h +++ b/include/asm-arm/elf.h | |||
@@ -1,17 +1,22 @@ | |||
1 | #ifndef __ASMARM_ELF_H | 1 | #ifndef __ASMARM_ELF_H |
2 | #define __ASMARM_ELF_H | 2 | #define __ASMARM_ELF_H |
3 | 3 | ||
4 | 4 | #ifndef __ASSEMBLY__ | |
5 | /* | 5 | /* |
6 | * ELF register definitions.. | 6 | * ELF register definitions.. |
7 | */ | 7 | */ |
8 | |||
9 | #include <asm/ptrace.h> | 8 | #include <asm/ptrace.h> |
10 | #include <asm/user.h> | 9 | #include <asm/user.h> |
11 | 10 | ||
12 | typedef unsigned long elf_greg_t; | 11 | typedef unsigned long elf_greg_t; |
13 | typedef unsigned long elf_freg_t[3]; | 12 | typedef unsigned long elf_freg_t[3]; |
14 | 13 | ||
14 | #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t)) | ||
15 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | ||
16 | |||
17 | typedef struct user_fp elf_fpregset_t; | ||
18 | #endif | ||
19 | |||
15 | #define EM_ARM 40 | 20 | #define EM_ARM 40 |
16 | #define EF_ARM_APCS26 0x08 | 21 | #define EF_ARM_APCS26 0x08 |
17 | #define EF_ARM_SOFT_FLOAT 0x200 | 22 | #define EF_ARM_SOFT_FLOAT 0x200 |
@@ -23,11 +28,6 @@ typedef unsigned long elf_freg_t[3]; | |||
23 | #define R_ARM_CALL 28 | 28 | #define R_ARM_CALL 28 |
24 | #define R_ARM_JUMP24 29 | 29 | #define R_ARM_JUMP24 29 |
25 | 30 | ||
26 | #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t)) | ||
27 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | ||
28 | |||
29 | typedef struct user_fp elf_fpregset_t; | ||
30 | |||
31 | /* | 31 | /* |
32 | * These are used to set parameters in the core dumps. | 32 | * These are used to set parameters in the core dumps. |
33 | */ | 33 | */ |
@@ -42,10 +42,50 @@ typedef struct user_fp elf_fpregset_t; | |||
42 | #ifdef __KERNEL__ | 42 | #ifdef __KERNEL__ |
43 | #include <asm/procinfo.h> | 43 | #include <asm/procinfo.h> |
44 | 44 | ||
45 | #ifndef __ASSEMBLY__ | ||
46 | /* | ||
47 | * This yields a mask that user programs can use to figure out what | ||
48 | * instruction set this cpu supports. | ||
49 | */ | ||
50 | #define ELF_HWCAP (elf_hwcap) | ||
51 | extern unsigned int elf_hwcap; | ||
52 | |||
53 | /* | ||
54 | * This yields a string that ld.so will use to load implementation | ||
55 | * specific libraries for optimization. This is more specific in | ||
56 | * intent than poking at uname or /proc/cpuinfo. | ||
57 | * | ||
58 | * For now we just provide a fairly general string that describes the | ||
59 | * processor family. This could be made more specific later if someone | ||
60 | * implemented optimisations that require it. 26-bit CPUs give you | ||
61 | * "v1l" for ARM2 (no SWP) and "v2l" for anything else (ARM1 isn't | ||
62 | * supported). 32-bit CPUs give you "v3[lb]" for anything based on an | ||
63 | * ARM6 or ARM7 core and "armv4[lb]" for anything based on a StrongARM-1 | ||
64 | * core. | ||
65 | */ | ||
66 | #define ELF_PLATFORM_SIZE 8 | ||
67 | #define ELF_PLATFORM (elf_platform) | ||
68 | |||
69 | extern char elf_platform[]; | ||
70 | #endif | ||
71 | |||
45 | /* | 72 | /* |
46 | * This is used to ensure we don't load something for the wrong architecture. | 73 | * This is used to ensure we don't load something for the wrong architecture. |
47 | */ | 74 | */ |
48 | #define elf_check_arch(x) ( ((x)->e_machine == EM_ARM) && (ELF_PROC_OK((x))) ) | 75 | #define elf_check_arch(x) ((x)->e_machine == EM_ARM && ELF_PROC_OK(x)) |
76 | |||
77 | /* | ||
78 | * 32-bit code is always OK. Some cpus can do 26-bit, some can't. | ||
79 | */ | ||
80 | #define ELF_PROC_OK(x) (ELF_THUMB_OK(x) && ELF_26BIT_OK(x)) | ||
81 | |||
82 | #define ELF_THUMB_OK(x) \ | ||
83 | ((elf_hwcap & HWCAP_THUMB && ((x)->e_entry & 1) == 1) || \ | ||
84 | ((x)->e_entry & 3) == 0) | ||
85 | |||
86 | #define ELF_26BIT_OK(x) \ | ||
87 | ((elf_hwcap & HWCAP_26BIT && (x)->e_flags & EF_ARM_APCS26) || \ | ||
88 | ((x)->e_flags & EF_ARM_APCS26) == 0) | ||
49 | 89 | ||
50 | #define USE_ELF_CORE_DUMP | 90 | #define USE_ELF_CORE_DUMP |
51 | #define ELF_EXEC_PAGESIZE 4096 | 91 | #define ELF_EXEC_PAGESIZE 4096 |
@@ -62,40 +102,6 @@ typedef struct user_fp elf_fpregset_t; | |||
62 | have no such handler. */ | 102 | have no such handler. */ |
63 | #define ELF_PLAT_INIT(_r, load_addr) (_r)->ARM_r0 = 0 | 103 | #define ELF_PLAT_INIT(_r, load_addr) (_r)->ARM_r0 = 0 |
64 | 104 | ||
65 | /* This yields a mask that user programs can use to figure out what | ||
66 | instruction set this cpu supports. */ | ||
67 | |||
68 | #define ELF_HWCAP (elf_hwcap) | ||
69 | |||
70 | /* This yields a string that ld.so will use to load implementation | ||
71 | specific libraries for optimization. This is more specific in | ||
72 | intent than poking at uname or /proc/cpuinfo. */ | ||
73 | |||
74 | /* For now we just provide a fairly general string that describes the | ||
75 | processor family. This could be made more specific later if someone | ||
76 | implemented optimisations that require it. 26-bit CPUs give you | ||
77 | "v1l" for ARM2 (no SWP) and "v2l" for anything else (ARM1 isn't | ||
78 | supported). 32-bit CPUs give you "v3[lb]" for anything based on an | ||
79 | ARM6 or ARM7 core and "armv4[lb]" for anything based on a StrongARM-1 | ||
80 | core. */ | ||
81 | |||
82 | #define ELF_PLATFORM_SIZE 8 | ||
83 | extern char elf_platform[]; | ||
84 | #define ELF_PLATFORM (elf_platform) | ||
85 | |||
86 | /* | ||
87 | * 32-bit code is always OK. Some cpus can do 26-bit, some can't. | ||
88 | */ | ||
89 | #define ELF_PROC_OK(x) (ELF_THUMB_OK(x) && ELF_26BIT_OK(x)) | ||
90 | |||
91 | #define ELF_THUMB_OK(x) \ | ||
92 | (( (elf_hwcap & HWCAP_THUMB) && ((x)->e_entry & 1) == 1) || \ | ||
93 | ((x)->e_entry & 3) == 0) | ||
94 | |||
95 | #define ELF_26BIT_OK(x) \ | ||
96 | (( (elf_hwcap & HWCAP_26BIT) && (x)->e_flags & EF_ARM_APCS26) || \ | ||
97 | ((x)->e_flags & EF_ARM_APCS26) == 0) | ||
98 | |||
99 | #ifndef CONFIG_IWMMXT | 105 | #ifndef CONFIG_IWMMXT |
100 | 106 | ||
101 | /* Old NetWinder binaries were compiled in such a way that the iBCS | 107 | /* Old NetWinder binaries were compiled in such a way that the iBCS |
@@ -104,7 +110,7 @@ extern char elf_platform[]; | |||
104 | there is no other ELF system currently supported by iBCS. | 110 | there is no other ELF system currently supported by iBCS. |
105 | @@ Could print a warning message to encourage users to upgrade. */ | 111 | @@ Could print a warning message to encourage users to upgrade. */ |
106 | #define SET_PERSONALITY(ex,ibcs2) \ | 112 | #define SET_PERSONALITY(ex,ibcs2) \ |
107 | set_personality(((ex).e_flags&EF_ARM_APCS26 ?PER_LINUX :PER_LINUX_32BIT)) | 113 | set_personality(((ex).e_flags & EF_ARM_APCS26 ? PER_LINUX : PER_LINUX_32BIT)) |
108 | 114 | ||
109 | #else | 115 | #else |
110 | 116 | ||