Commit | Line | Data |
---|---|---|
3be80aae VG |
1 | /* |
2 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License version 2 as | |
6 | * published by the Free Software Foundation. | |
7 | */ | |
8 | ||
9 | #ifndef __ASM_ARC_ELF_H | |
10 | #define __ASM_ARC_ELF_H | |
11 | ||
12 | #include <asm/ptrace.h> | |
13 | ||
14 | #define EM_ARCOMPACT 93 | |
15 | ||
16 | /* Machine specific ELF Hdr flags */ | |
17 | #define EF_ARC_OSABI_MSK 0x00000f00 | |
18 | #define EF_ARC_OSABI_ORIG 0x00000000 /* MUST be zero for back-compat */ | |
19 | #define EF_ARC_OSABI_V2 0x00000200 | |
20 | ||
21 | /* ARC Relocations (kernel Modules only) */ | |
22 | #define R_ARC_32 0x4 | |
23 | #define R_ARC_32_ME 0x1B | |
24 | #define R_ARC_S25H_PCREL 0x10 | |
25 | #define R_ARC_S25W_PCREL 0x11 | |
26 | ||
27 | typedef unsigned long elf_greg_t; | |
28 | typedef unsigned long elf_fpregset_t; | |
29 | ||
5dc99e50 | 30 | #define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t)) |
3be80aae VG |
31 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; |
32 | ||
33 | /* | |
34 | * To ensure that | |
35 | * -we don't load something for the wrong architecture. | |
36 | * -The userspace is using the correct syscall ABI | |
37 | */ | |
38 | struct elf32_hdr; | |
39 | extern int elf_check_arch(const struct elf32_hdr *); | |
40 | #define elf_check_arch elf_check_arch | |
41 | ||
42 | /* | |
43 | * These are used to set parameters in the core dumps. | |
44 | */ | |
45 | #define ELF_ARCH EM_ARCOMPACT | |
46 | #define ELF_CLASS ELFCLASS32 | |
47 | ||
48 | #ifdef CONFIG_CPU_BIG_ENDIAN | |
49 | #define ELF_DATA ELFDATA2MSB | |
50 | #else | |
51 | #define ELF_DATA ELFDATA2LSB | |
52 | #endif | |
53 | ||
54 | #ifdef __KERNEL__ | |
55 | ||
56 | #define CORE_DUMP_USE_REGSET | |
57 | ||
58 | #define ELF_EXEC_PAGESIZE PAGE_SIZE | |
59 | ||
60 | /* | |
61 | * This is the location that an ET_DYN program is loaded if exec'ed. Typical | |
62 | * use of this is to invoke "./ld.so someprog" to test out a new version of | |
63 | * the loader. We need to make sure that it is out of the way of the program | |
64 | * that it will "exec", and that there is sufficient room for the brk. | |
65 | */ | |
66 | #define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3) | |
67 | ||
68 | /* | |
69 | * When the program starts, a1 contains a pointer to a function to be | |
70 | * registered with atexit, as per the SVR4 ABI. A value of 0 means we | |
71 | * have no such handler. | |
72 | */ | |
73 | #define ELF_PLAT_INIT(_r, load_addr) ((_r)->r0 = 0) | |
74 | ||
75 | /* | |
76 | * This yields a mask that user programs can use to figure out what | |
77 | * instruction set this cpu supports. | |
78 | */ | |
79 | #define ELF_HWCAP (0) | |
80 | ||
81 | /* | |
82 | * This yields a string that ld.so will use to load implementation | |
83 | * specific libraries for optimization. This is more specific in | |
84 | * intent than poking at uname or /proc/cpuinfo. | |
85 | */ | |
86 | #define ELF_PLATFORM (NULL) | |
87 | ||
88 | #define SET_PERSONALITY(ex) \ | |
89 | set_personality(PER_LINUX | (current->personality & (~PER_MASK))) | |
90 | ||
91 | #endif /* __KERNEL__ */ | |
92 | ||
93 | #endif |