Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
elf.h
Go to the documentation of this file.
1 /*
2  * linux/arch/unicore32/include/asm/elf.h
3  *
4  * Code specific to PKUnity SoC and UniCore ISA
5  *
6  * Copyright (C) 2001-2010 GUAN Xue-tao
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11  */
12 
13 #ifndef __UNICORE_ELF_H__
14 #define __UNICORE_ELF_H__
15 
16 #include <asm/hwcap.h>
17 
18 /*
19  * ELF register definitions..
20  */
21 #include <asm/ptrace.h>
22 
23 typedef unsigned long elf_greg_t;
24 typedef unsigned long elf_freg_t[3];
25 
26 #define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t))
28 
29 typedef struct fp_state elf_fpregset_t;
30 
31 #define EM_UNICORE 110
32 
33 #define R_UNICORE_NONE 0
34 #define R_UNICORE_PC24 1
35 #define R_UNICORE_ABS32 2
36 #define R_UNICORE_CALL 28
37 #define R_UNICORE_JUMP24 29
38 
39 /*
40  * These are used to set parameters in the core dumps.
41  */
42 #define ELF_CLASS ELFCLASS32
43 #define ELF_DATA ELFDATA2LSB
44 #define ELF_ARCH EM_UNICORE
45 
46 /*
47  * This yields a string that ld.so will use to load implementation
48  * specific libraries for optimization. This is more specific in
49  * intent than poking at uname or /proc/cpuinfo.
50  *
51  */
52 #define ELF_PLATFORM_SIZE 8
53 #define ELF_PLATFORM (elf_platform)
54 
55 extern char elf_platform[];
56 
57 struct elf32_hdr;
58 
59 /*
60  * This is used to ensure we don't load something for the wrong architecture.
61  */
62 extern int elf_check_arch(const struct elf32_hdr *);
63 #define elf_check_arch elf_check_arch
64 
65 struct task_struct;
66 int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs);
67 #define ELF_CORE_COPY_TASK_REGS dump_task_regs
68 
69 #define ELF_EXEC_PAGESIZE 4096
70 
71 /* This is the location that an ET_DYN program is loaded if exec'ed. Typical
72  use of this is to invoke "./ld.so someprog" to test out a new version of
73  the loader. We need to make sure that it is out of the way of the program
74  that it will "exec", and that there is sufficient room for the brk. */
75 
76 #define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
77 
78 /* When the program starts, a1 contains a pointer to a function to be
79  registered with atexit, as per the SVR4 ABI. A value of 0 means we
80  have no such handler. */
81 #define ELF_PLAT_INIT(_r, load_addr) {(_r)->UCreg_00 = 0; }
82 
83 extern void elf_set_personality(const struct elf32_hdr *);
84 #define SET_PERSONALITY(ex) elf_set_personality(&(ex))
85 
86 struct mm_struct;
87 extern unsigned long arch_randomize_brk(struct mm_struct *mm);
88 #define arch_randomize_brk arch_randomize_brk
89 
90 extern int vectors_user_mapping(void);
91 #define arch_setup_additional_pages(bprm, uses_interp) vectors_user_mapping()
92 #define ARCH_HAS_SETUP_ADDITIONAL_PAGES
93 
94 #endif