1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _UAPI__A_OUT_GNU_H__ 20 #define _UAPI__A_OUT_GNU_H__ 21 #define __GNU_EXEC_MACROS__ 22 #ifndef __STRUCT_EXEC_OVERRIDE__ 23 #include <asm/a.out.h> 24 #endif 25 #ifndef __ASSEMBLY__ 26 enum machine_type { 27 #ifdef M_OLDSUN2 28 M__OLDSUN2 = M_OLDSUN2, 29 #else 30 M_OLDSUN2 = 0, 31 #endif 32 #ifdef M_68010 33 M__68010 = M_68010, 34 #else 35 M_68010 = 1, 36 #endif 37 #ifdef M_68020 38 M__68020 = M_68020, 39 #else 40 M_68020 = 2, 41 #endif 42 #ifdef M_SPARC 43 M__SPARC = M_SPARC, 44 #else 45 M_SPARC = 3, 46 #endif 47 M_386 = 100, 48 M_MIPS1 = 151, 49 M_MIPS2 = 152 50 }; 51 #ifndef N_MAGIC 52 #define N_MAGIC(exec) ((exec).a_info & 0xffff) 53 #endif 54 #define N_MACHTYPE(exec) ((enum machine_type) (((exec).a_info >> 16) & 0xff)) 55 #define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff) 56 #define N_SET_INFO(exec,magic,type,flags) ((exec).a_info = ((magic) & 0xffff) | (((int) (type) & 0xff) << 16) | (((flags) & 0xff) << 24)) 57 #define N_SET_MAGIC(exec,magic) ((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff))) 58 #define N_SET_MACHTYPE(exec,machtype) ((exec).a_info = ((exec).a_info & 0xff00ffff) | ((((int) (machtype)) & 0xff) << 16)) 59 #define N_SET_FLAGS(exec,flags) ((exec).a_info = ((exec).a_info & 0x00ffffff) | (((flags) & 0xff) << 24)) 60 #define OMAGIC 0407 61 #define NMAGIC 0410 62 #define ZMAGIC 0413 63 #define QMAGIC 0314 64 #define CMAGIC 0421 65 #ifndef N_BADMAG 66 #define N_BADMAG(x) (N_MAGIC(x) != OMAGIC && N_MAGIC(x) != NMAGIC && N_MAGIC(x) != ZMAGIC && N_MAGIC(x) != QMAGIC) 67 #endif 68 #define _N_HDROFF(x) (1024 - sizeof(struct exec)) 69 #ifndef N_TXTOFF 70 #define N_TXTOFF(x) (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof(struct exec) : (N_MAGIC(x) == QMAGIC ? 0 : sizeof(struct exec))) 71 #endif 72 #ifndef N_DATOFF 73 #define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text) 74 #endif 75 #ifndef N_TRELOFF 76 #define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data) 77 #endif 78 #ifndef N_DRELOFF 79 #define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x)) 80 #endif 81 #ifndef N_SYMOFF 82 #define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x)) 83 #endif 84 #ifndef N_STROFF 85 #define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x)) 86 #endif 87 #ifndef N_TXTADDR 88 #define N_TXTADDR(x) (N_MAGIC(x) == QMAGIC ? PAGE_SIZE : 0) 89 #endif 90 #if defined(vax) || defined(hp300) || defined(pyr) 91 #define SEGMENT_SIZE page_size 92 #endif 93 #ifdef sony 94 #define SEGMENT_SIZE 0x2000 95 #endif 96 #ifdef is68k 97 #define SEGMENT_SIZE 0x20000 98 #endif 99 #if defined(m68k) && defined(PORTAR) 100 #define PAGE_SIZE 0x400 101 #define SEGMENT_SIZE PAGE_SIZE 102 #endif 103 #ifdef linux 104 #include <unistd.h> 105 #if defined(__i386__) || defined(__mc68000__) 106 #define SEGMENT_SIZE 1024 107 #else 108 #ifndef SEGMENT_SIZE 109 #define SEGMENT_SIZE getpagesize() 110 #endif 111 #endif 112 #endif 113 #define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE) 114 #define _N_TXTENDADDR(x) (N_TXTADDR(x) + (x).a_text) 115 #ifndef N_DATADDR 116 #define N_DATADDR(x) (N_MAGIC(x) == OMAGIC ? (_N_TXTENDADDR(x)) : (_N_SEGMENT_ROUND(_N_TXTENDADDR(x)))) 117 #endif 118 #ifndef N_BSSADDR 119 #define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data) 120 #endif 121 #ifndef N_NLIST_DECLARED 122 struct nlist { 123 union { 124 char * n_name; 125 struct nlist * n_next; 126 long n_strx; 127 } n_un; 128 unsigned char n_type; 129 char n_other; 130 short n_desc; 131 unsigned long n_value; 132 }; 133 #endif 134 #ifndef N_UNDF 135 #define N_UNDF 0 136 #endif 137 #ifndef N_ABS 138 #define N_ABS 2 139 #endif 140 #ifndef N_TEXT 141 #define N_TEXT 4 142 #endif 143 #ifndef N_DATA 144 #define N_DATA 6 145 #endif 146 #ifndef N_BSS 147 #define N_BSS 8 148 #endif 149 #ifndef N_FN 150 #define N_FN 15 151 #endif 152 #ifndef N_EXT 153 #define N_EXT 1 154 #endif 155 #ifndef N_TYPE 156 #define N_TYPE 036 157 #endif 158 #ifndef N_STAB 159 #define N_STAB 0340 160 #endif 161 #define N_INDR 0xa 162 #define N_SETA 0x14 163 #define N_SETT 0x16 164 #define N_SETD 0x18 165 #define N_SETB 0x1A 166 #define N_SETV 0x1C 167 #ifndef N_RELOCATION_INFO_DECLARED 168 struct relocation_info { 169 int r_address; 170 unsigned int r_symbolnum : 24; 171 unsigned int r_pcrel : 1; 172 unsigned int r_length : 2; 173 unsigned int r_extern : 1; 174 #ifdef NS32K 175 unsigned r_bsr : 1; 176 unsigned r_disp : 1; 177 unsigned r_pad : 2; 178 #else 179 unsigned int r_pad : 4; 180 #endif 181 }; 182 #endif 183 #endif 184 #endif 185