| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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__ | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 23 | #include <asm/a.out.h> | 
|  | 24 | #endif | 
|  | 25 | #ifndef __ASSEMBLY__ | 
|  | 26 | enum machine_type { | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 27 | #ifdef M_OLDSUN2 | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 28 | M__OLDSUN2 = M_OLDSUN2, | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 29 | #else | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 30 | M_OLDSUN2 = 0, | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 31 | #endif | 
|  | 32 | #ifdef M_68010 | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 33 | M__68010 = M_68010, | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 34 | #else | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 35 | M_68010 = 1, | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 36 | #endif | 
|  | 37 | #ifdef M_68020 | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 38 | M__68020 = M_68020, | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 39 | #else | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 40 | M_68020 = 2, | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 41 | #endif | 
|  | 42 | #ifdef M_SPARC | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 43 | M__SPARC = M_SPARC, | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 44 | #else | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 45 | M_SPARC = 3, | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 46 | #endif | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 47 | M_386 = 100, | 
|  | 48 | M_MIPS1 = 151, | 
|  | 49 | M_MIPS2 = 152 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 50 | }; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 51 | #ifndef N_MAGIC | 
|  | 52 | #define N_MAGIC(exec) ((exec).a_info & 0xffff) | 
|  | 53 | #endif | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 54 | #define N_MACHTYPE(exec) ((enum machine_type) (((exec).a_info >> 16) & 0xff)) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 55 | #define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff) | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 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)) | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 59 | #define N_SET_FLAGS(exec,flags) ((exec).a_info = ((exec).a_info & 0x00ffffff) | (((flags) & 0xff) << 24)) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 60 | #define OMAGIC 0407 | 
|  | 61 | #define NMAGIC 0410 | 
|  | 62 | #define ZMAGIC 0413 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 63 | #define QMAGIC 0314 | 
|  | 64 | #define CMAGIC 0421 | 
|  | 65 | #ifndef N_BADMAG | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 66 | #define N_BADMAG(x) (N_MAGIC(x) != OMAGIC && N_MAGIC(x) != NMAGIC && N_MAGIC(x) != ZMAGIC && N_MAGIC(x) != QMAGIC) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 67 | #endif | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 68 | #define _N_HDROFF(x) (1024 - sizeof(struct exec)) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 69 | #ifndef N_TXTOFF | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 70 | #define N_TXTOFF(x) (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof(struct exec) : (N_MAGIC(x) == QMAGIC ? 0 : sizeof(struct exec))) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 71 | #endif | 
|  | 72 | #ifndef N_DATOFF | 
|  | 73 | #define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text) | 
|  | 74 | #endif | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 75 | #ifndef N_TRELOFF | 
|  | 76 | #define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data) | 
|  | 77 | #endif | 
|  | 78 | #ifndef N_DRELOFF | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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)) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 83 | #endif | 
|  | 84 | #ifndef N_STROFF | 
|  | 85 | #define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x)) | 
|  | 86 | #endif | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 87 | #ifndef N_TXTADDR | 
|  | 88 | #define N_TXTADDR(x) (N_MAGIC(x) == QMAGIC ? PAGE_SIZE : 0) | 
|  | 89 | #endif | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 90 | #include <unistd.h> | 
|  | 91 | #if defined(__i386__) || defined(__mc68000__) | 
|  | 92 | #define SEGMENT_SIZE 1024 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 93 | #else | 
|  | 94 | #ifndef SEGMENT_SIZE | 
|  | 95 | #define SEGMENT_SIZE getpagesize() | 
|  | 96 | #endif | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 97 | #endif | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 98 | #define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE) | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 99 | #define _N_TXTENDADDR(x) (N_TXTADDR(x) + (x).a_text) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 100 | #ifndef N_DATADDR | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 101 | #define N_DATADDR(x) (N_MAGIC(x) == OMAGIC ? (_N_TXTENDADDR(x)) : (_N_SEGMENT_ROUND(_N_TXTENDADDR(x)))) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 102 | #endif | 
|  | 103 | #ifndef N_BSSADDR | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 104 | #define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data) | 
|  | 105 | #endif | 
|  | 106 | #ifndef N_NLIST_DECLARED | 
|  | 107 | struct nlist { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 108 | union { | 
|  | 109 | char * n_name; | 
|  | 110 | struct nlist * n_next; | 
|  | 111 | long n_strx; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 112 | } n_un; | 
|  | 113 | unsigned char n_type; | 
|  | 114 | char n_other; | 
|  | 115 | short n_desc; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 116 | unsigned long n_value; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 117 | }; | 
|  | 118 | #endif | 
|  | 119 | #ifndef N_UNDF | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 120 | #define N_UNDF 0 | 
|  | 121 | #endif | 
|  | 122 | #ifndef N_ABS | 
|  | 123 | #define N_ABS 2 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 124 | #endif | 
|  | 125 | #ifndef N_TEXT | 
|  | 126 | #define N_TEXT 4 | 
|  | 127 | #endif | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 128 | #ifndef N_DATA | 
|  | 129 | #define N_DATA 6 | 
|  | 130 | #endif | 
|  | 131 | #ifndef N_BSS | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 132 | #define N_BSS 8 | 
|  | 133 | #endif | 
|  | 134 | #ifndef N_FN | 
|  | 135 | #define N_FN 15 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 136 | #endif | 
|  | 137 | #ifndef N_EXT | 
|  | 138 | #define N_EXT 1 | 
|  | 139 | #endif | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 140 | #ifndef N_TYPE | 
|  | 141 | #define N_TYPE 036 | 
|  | 142 | #endif | 
|  | 143 | #ifndef N_STAB | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 144 | #define N_STAB 0340 | 
|  | 145 | #endif | 
|  | 146 | #define N_INDR 0xa | 
|  | 147 | #define N_SETA 0x14 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 148 | #define N_SETT 0x16 | 
|  | 149 | #define N_SETD 0x18 | 
|  | 150 | #define N_SETB 0x1A | 
|  | 151 | #define N_SETV 0x1C | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 152 | #ifndef N_RELOCATION_INFO_DECLARED | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 153 | struct relocation_info { | 
|  | 154 | int r_address; | 
|  | 155 | unsigned int r_symbolnum : 24; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 156 | unsigned int r_pcrel : 1; | 
|  | 157 | unsigned int r_length : 2; | 
|  | 158 | unsigned int r_extern : 1; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 159 | unsigned int r_pad : 4; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 160 | }; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 161 | #endif | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 162 | #endif | 
|  | 163 | #endif |