1*6f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 296433f6eSDavid Howells #ifndef _UAPI__ALPHA_A_OUT_H__ 396433f6eSDavid Howells #define _UAPI__ALPHA_A_OUT_H__ 496433f6eSDavid Howells 596433f6eSDavid Howells #include <linux/types.h> 696433f6eSDavid Howells 796433f6eSDavid Howells /* 896433f6eSDavid Howells * OSF/1 ECOFF header structs. ECOFF files consist of: 996433f6eSDavid Howells * - a file header (struct filehdr), 1096433f6eSDavid Howells * - an a.out header (struct aouthdr), 1196433f6eSDavid Howells * - one or more section headers (struct scnhdr). 1296433f6eSDavid Howells * The filhdr's "f_nscns" field contains the 1396433f6eSDavid Howells * number of section headers. 1496433f6eSDavid Howells */ 1596433f6eSDavid Howells 1696433f6eSDavid Howells struct filehdr 1796433f6eSDavid Howells { 1896433f6eSDavid Howells /* OSF/1 "file" header */ 1996433f6eSDavid Howells __u16 f_magic, f_nscns; 2096433f6eSDavid Howells __u32 f_timdat; 2196433f6eSDavid Howells __u64 f_symptr; 2296433f6eSDavid Howells __u32 f_nsyms; 2396433f6eSDavid Howells __u16 f_opthdr, f_flags; 2496433f6eSDavid Howells }; 2596433f6eSDavid Howells 2696433f6eSDavid Howells struct aouthdr 2796433f6eSDavid Howells { 2896433f6eSDavid Howells __u64 info; /* after that it looks quite normal.. */ 2996433f6eSDavid Howells __u64 tsize; 3096433f6eSDavid Howells __u64 dsize; 3196433f6eSDavid Howells __u64 bsize; 3296433f6eSDavid Howells __u64 entry; 3396433f6eSDavid Howells __u64 text_start; /* with a few additions that actually make sense */ 3496433f6eSDavid Howells __u64 data_start; 3596433f6eSDavid Howells __u64 bss_start; 3696433f6eSDavid Howells __u32 gprmask, fprmask; /* bitmask of general & floating point regs used in binary */ 3796433f6eSDavid Howells __u64 gpvalue; 3896433f6eSDavid Howells }; 3996433f6eSDavid Howells 4096433f6eSDavid Howells struct scnhdr 4196433f6eSDavid Howells { 4296433f6eSDavid Howells char s_name[8]; 4396433f6eSDavid Howells __u64 s_paddr; 4496433f6eSDavid Howells __u64 s_vaddr; 4596433f6eSDavid Howells __u64 s_size; 4696433f6eSDavid Howells __u64 s_scnptr; 4796433f6eSDavid Howells __u64 s_relptr; 4896433f6eSDavid Howells __u64 s_lnnoptr; 4996433f6eSDavid Howells __u16 s_nreloc; 5096433f6eSDavid Howells __u16 s_nlnno; 5196433f6eSDavid Howells __u32 s_flags; 5296433f6eSDavid Howells }; 5396433f6eSDavid Howells 5496433f6eSDavid Howells struct exec 5596433f6eSDavid Howells { 5696433f6eSDavid Howells /* OSF/1 "file" header */ 5796433f6eSDavid Howells struct filehdr fh; 5896433f6eSDavid Howells struct aouthdr ah; 5996433f6eSDavid Howells }; 6096433f6eSDavid Howells 6196433f6eSDavid Howells /* 6296433f6eSDavid Howells * Define's so that the kernel exec code can access the a.out header 6396433f6eSDavid Howells * fields... 6496433f6eSDavid Howells */ 6596433f6eSDavid Howells #define a_info ah.info 6696433f6eSDavid Howells #define a_text ah.tsize 6796433f6eSDavid Howells #define a_data ah.dsize 6896433f6eSDavid Howells #define a_bss ah.bsize 6996433f6eSDavid Howells #define a_entry ah.entry 7096433f6eSDavid Howells #define a_textstart ah.text_start 7196433f6eSDavid Howells #define a_datastart ah.data_start 7296433f6eSDavid Howells #define a_bssstart ah.bss_start 7396433f6eSDavid Howells #define a_gprmask ah.gprmask 7496433f6eSDavid Howells #define a_fprmask ah.fprmask 7596433f6eSDavid Howells #define a_gpvalue ah.gpvalue 7696433f6eSDavid Howells 7796433f6eSDavid Howells #define N_TXTADDR(x) ((x).a_textstart) 7896433f6eSDavid Howells #define N_DATADDR(x) ((x).a_datastart) 7996433f6eSDavid Howells #define N_BSSADDR(x) ((x).a_bssstart) 8096433f6eSDavid Howells #define N_DRSIZE(x) 0 8196433f6eSDavid Howells #define N_TRSIZE(x) 0 8296433f6eSDavid Howells #define N_SYMSIZE(x) 0 8396433f6eSDavid Howells 8496433f6eSDavid Howells #define AOUTHSZ sizeof(struct aouthdr) 8596433f6eSDavid Howells #define SCNHSZ sizeof(struct scnhdr) 8696433f6eSDavid Howells #define SCNROUND 16 8796433f6eSDavid Howells 8896433f6eSDavid Howells #define N_TXTOFF(x) \ 8996433f6eSDavid Howells ((long) N_MAGIC(x) == ZMAGIC ? 0 : \ 9096433f6eSDavid Howells (sizeof(struct exec) + (x).fh.f_nscns*SCNHSZ + SCNROUND - 1) & ~(SCNROUND - 1)) 9196433f6eSDavid Howells 9296433f6eSDavid Howells #endif /* _UAPI__ALPHA_A_OUT_H__ */ 93