1/*
2 * This header was generated from the Linux kernel headers by update_headers.py,
3 * to provide necessary information from kernel to userspace, such as constants,
4 * structures, and macros, and thus, contains no copyrightable information.
5 */
6#define  E_SYMNMLEN  8
7#define  E_FILNMLEN 14
8#define  E_DIMNUM    4
9
10#define COFF_SHORT_L(ps) ((short)(((unsigned short)((unsigned char)ps[1])<<8)|\
11				  ((unsigned short)((unsigned char)ps[0]))))
12#define COFF_LONG_L(ps) (((long)(((unsigned long)((unsigned char)ps[3])<<24) |\
13				 ((unsigned long)((unsigned char)ps[2])<<16) |\
14				 ((unsigned long)((unsigned char)ps[1])<<8)  |\
15				 ((unsigned long)((unsigned char)ps[0])))))
16
17#define COFF_SHORT_H(ps) ((short)(((unsigned short)((unsigned char)ps[0])<<8)|\
18				  ((unsigned short)((unsigned char)ps[1]))))
19#define COFF_LONG_H(ps) (((long)(((unsigned long)((unsigned char)ps[0])<<24) |\
20				 ((unsigned long)((unsigned char)ps[1])<<16) |\
21				 ((unsigned long)((unsigned char)ps[2])<<8)  |\
22				 ((unsigned long)((unsigned char)ps[3])))))
23#define COFF_LONG(v)   COFF_LONG_L(v)
24#define COFF_SHORT(v)  COFF_SHORT_L(v)
25struct COFF_filehdr {
26	char f_magic[2];
27	char f_nscns[2];
28	char f_timdat[4];
29	char f_symptr[4];
30	char f_nsyms[4];
31	char f_opthdr[2];
32	char f_flags[2];
33};
34#define  COFF_F_RELFLG		0000001
35#define  COFF_F_EXEC		0000002
36#define  COFF_F_LNNO		0000004
37#define  COFF_F_LSYMS		0000010
38#define  COFF_F_MINMAL		0000020
39#define  COFF_F_UPDATE		0000040
40#define  COFF_F_SWABD		0000100
41#define  COFF_F_AR16WR		0000200
42#define  COFF_F_AR32WR		0000400
43#define  COFF_F_AR32W		0001000
44#define  COFF_F_PATCH		0002000
45#define  COFF_F_NODF		0002000
46#define	COFF_I386MAGIC	        0x14c
47#if 0
48#define COFF_I386PTXMAGIC	0x154
49#define COFF_I386AIXMAGIC	0x175
50#define COFF_I386BADMAG(x) ((COFF_SHORT((x).f_magic) != COFF_I386MAGIC) \
51			  && COFF_SHORT((x).f_magic) != COFF_I386PTXMAGIC \
52			  && COFF_SHORT((x).f_magic) != COFF_I386AIXMAGIC)
53#else
54#define COFF_I386BADMAG(x) (COFF_SHORT((x).f_magic) != COFF_I386MAGIC)
55#endif
56#define	COFF_FILHDR	struct COFF_filehdr
57#define	COFF_FILHSZ	sizeof(COFF_FILHDR)
58typedef struct
59{
60  char 	magic[2];
61  char	vstamp[2];
62  char	tsize[4];
63  char	dsize[4];
64  char	bsize[4];
65  char	entry[4];
66  char 	text_start[4];
67  char 	data_start[4];
68}
69COFF_AOUTHDR;
70#define COFF_AOUTSZ (sizeof(COFF_AOUTHDR))
71#define COFF_STMAGIC	0401
72#define COFF_OMAGIC     0404
73#define COFF_JMAGIC     0407
74#define COFF_DMAGIC     0410
75#define COFF_ZMAGIC     0413
76#define COFF_SHMAGIC	0443
77struct COFF_scnhdr {
78  char		s_name[8];
79  char		s_paddr[4];
80  char		s_vaddr[4];
81  char		s_size[4];
82  char		s_scnptr[4];
83  char		s_relptr[4];
84  char		s_lnnoptr[4];
85  char		s_nreloc[2];
86  char		s_nlnno[2];
87  char		s_flags[4];
88};
89#define	COFF_SCNHDR	struct COFF_scnhdr
90#define	COFF_SCNHSZ	sizeof(COFF_SCNHDR)
91#define COFF_TEXT	".text"
92#define COFF_DATA	".data"
93#define COFF_BSS	".bss"
94#define COFF_COMMENT    ".comment"
95#define COFF_LIB        ".lib"
96#define COFF_SECT_TEXT  0
97#define COFF_SECT_DATA  1
98#define COFF_SECT_BSS   2
99#define COFF_SECT_REQD  3
100#define COFF_STYP_REG     0x00
101#define COFF_STYP_DSECT   0x01
102#define COFF_STYP_NOLOAD  0x02
103#define COFF_STYP_GROUP   0x04
104#define COFF_STYP_PAD     0x08
105#define COFF_STYP_COPY    0x10
106#define COFF_STYP_TEXT    0x20
107#define COFF_STYP_DATA    0x40
108#define COFF_STYP_BSS     0x80
109#define COFF_STYP_INFO   0x200
110#define COFF_STYP_OVER   0x400
111#define COFF_STYP_LIB    0x800
112struct COFF_slib {
113  char		sl_entsz[4];
114  char		sl_pathndx[4];
115};
116#define	COFF_SLIBHD	struct COFF_slib
117#define	COFF_SLIBSZ	sizeof(COFF_SLIBHD)
118struct COFF_lineno {
119  union {
120    char l_symndx[4];
121    char l_paddr[4];
122  } l_addr;
123  char l_lnno[2];
124};
125#define	COFF_LINENO	struct COFF_lineno
126#define	COFF_LINESZ	6
127#define COFF_E_SYMNMLEN	 8
128#define COFF_E_FILNMLEN	14
129#define COFF_E_DIMNUM	 4
130struct COFF_syment
131{
132  union {
133    char e_name[E_SYMNMLEN];
134    struct {
135      char e_zeroes[4];
136      char e_offset[4];
137    } e;
138  } e;
139  char e_value[4];
140  char e_scnum[2];
141  char e_type[2];
142  char e_sclass[1];
143  char e_numaux[1];
144};
145#define COFF_N_BTMASK	(0xf)
146#define COFF_N_TMASK	(0x30)
147#define COFF_N_BTSHFT	(4)
148#define COFF_N_TSHIFT	(2)
149
150union COFF_auxent {
151  struct {
152    char x_tagndx[4];
153    union {
154      struct {
155	char  x_lnno[2];
156	char  x_size[2];
157      } x_lnsz;
158      char x_fsize[4];
159    } x_misc;
160    union {
161      struct {
162	char x_lnnoptr[4];
163	char x_endndx[4];
164      } x_fcn;
165      struct {
166	char x_dimen[E_DIMNUM][2];
167      } x_ary;
168    } x_fcnary;
169    char x_tvndx[2];
170  } x_sym;
171  union {
172    char x_fname[E_FILNMLEN];
173    struct {
174      char x_zeroes[4];
175      char x_offset[4];
176    } x_n;
177  } x_file;
178  struct {
179    char x_scnlen[4];
180    char x_nreloc[2];
181    char x_nlinno[2];
182  } x_scn;
183
184  struct {
185    char x_tvfill[4];
186    char x_tvlen[2];
187    char x_tvran[2][2];
188  } x_tv;
189};
190#define	COFF_SYMENT	struct COFF_syment
191#define	COFF_SYMESZ	18
192#define	COFF_AUXENT	union COFF_auxent
193#define	COFF_AUXESZ	18
194#define COFF_ETEXT	"etext"
195struct COFF_reloc {
196  char r_vaddr[4];
197  char r_symndx[4];
198  char r_type[2];
199};
200#define COFF_RELOC struct COFF_reloc
201#define COFF_RELSZ 10
202#define COFF_DEF_DATA_SECTION_ALIGNMENT  4
203#define COFF_DEF_BSS_SECTION_ALIGNMENT   4
204#define COFF_DEF_TEXT_SECTION_ALIGNMENT  4
205#define COFF_DEF_SECTION_ALIGNMENT       4
206