|
| 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 | + |
| 30 | + |
| 31 | +/* core dump regs is in the order pt_regs, callee_regs, stop_pc (for gdb) */ |
| 32 | +#define ELF_NGREG ((sizeof(struct pt_regs) + sizeof(struct callee_regs) \ |
| 33 | + + sizeof(unsigned long)) / sizeof(elf_greg_t)) |
| 34 | + |
| 35 | +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; |
| 36 | + |
| 37 | +/* |
| 38 | + * To ensure that |
| 39 | + * -we don't load something for the wrong architecture. |
| 40 | + * -The userspace is using the correct syscall ABI |
| 41 | + */ |
| 42 | +struct elf32_hdr; |
| 43 | +extern int elf_check_arch(const struct elf32_hdr *); |
| 44 | +#define elf_check_arch elf_check_arch |
| 45 | + |
| 46 | +/* |
| 47 | + * These are used to set parameters in the core dumps. |
| 48 | + */ |
| 49 | +#define ELF_ARCH EM_ARCOMPACT |
| 50 | +#define ELF_CLASS ELFCLASS32 |
| 51 | + |
| 52 | +#ifdef CONFIG_CPU_BIG_ENDIAN |
| 53 | +#define ELF_DATA ELFDATA2MSB |
| 54 | +#else |
| 55 | +#define ELF_DATA ELFDATA2LSB |
| 56 | +#endif |
| 57 | + |
| 58 | +#ifdef __KERNEL__ |
| 59 | + |
| 60 | +#define CORE_DUMP_USE_REGSET |
| 61 | + |
| 62 | +#define ELF_EXEC_PAGESIZE PAGE_SIZE |
| 63 | + |
| 64 | +/* |
| 65 | + * This is the location that an ET_DYN program is loaded if exec'ed. Typical |
| 66 | + * use of this is to invoke "./ld.so someprog" to test out a new version of |
| 67 | + * the loader. We need to make sure that it is out of the way of the program |
| 68 | + * that it will "exec", and that there is sufficient room for the brk. |
| 69 | + */ |
| 70 | +#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3) |
| 71 | + |
| 72 | +/* |
| 73 | + * When the program starts, a1 contains a pointer to a function to be |
| 74 | + * registered with atexit, as per the SVR4 ABI. A value of 0 means we |
| 75 | + * have no such handler. |
| 76 | + */ |
| 77 | +#define ELF_PLAT_INIT(_r, load_addr) ((_r)->r0 = 0) |
| 78 | + |
| 79 | +/* |
| 80 | + * This yields a mask that user programs can use to figure out what |
| 81 | + * instruction set this cpu supports. |
| 82 | + */ |
| 83 | +#define ELF_HWCAP (0) |
| 84 | + |
| 85 | +/* |
| 86 | + * This yields a string that ld.so will use to load implementation |
| 87 | + * specific libraries for optimization. This is more specific in |
| 88 | + * intent than poking at uname or /proc/cpuinfo. |
| 89 | + */ |
| 90 | +#define ELF_PLATFORM (NULL) |
| 91 | + |
| 92 | +#define SET_PERSONALITY(ex) \ |
| 93 | + set_personality(PER_LINUX | (current->personality & (~PER_MASK))) |
| 94 | + |
| 95 | +#endif /* __KERNEL__ */ |
| 96 | + |
| 97 | +#endif |
0 commit comments