Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/sys As discussed with Christos, rename the definitions i...
details: https://anonhg.NetBSD.org/src/rev/9f0909d7b896
branches: trunk
changeset: 477619:9f0909d7b896
user: kleink <kleink%NetBSD.org@localhost>
date: Mon Oct 25 13:47:10 1999 +0000
description:
As discussed with Christos, rename the definitions in this file to match those
found in various SVR4 ABIs.
diffstat:
sys/sys/exec_elf.h | 514 ++++++++++++++++++++++++++++------------------------
1 files changed, 276 insertions(+), 238 deletions(-)
diffs (truncated from 671 to 300 lines):
diff -r 79f0f494f6a6 -r 9f0909d7b896 sys/sys/exec_elf.h
--- a/sys/sys/exec_elf.h Mon Oct 25 10:51:46 1999 +0000
+++ b/sys/sys/exec_elf.h Mon Oct 25 13:47:10 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: exec_elf.h,v 1.26 1999/10/23 08:45:49 erh Exp $ */
+/* $NetBSD: exec_elf.h,v 1.27 1999/10/25 13:47:10 kleink Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -41,97 +41,114 @@
#include <machine/types.h>
-typedef u_int8_t Elf_Byte;
+typedef u_int8_t Elf_Byte;
-typedef u_int32_t Elf32_Addr;
-typedef u_int32_t Elf32_Off;
-typedef int32_t Elf32_Sword;
-typedef u_int32_t Elf32_Word;
-typedef u_int16_t Elf32_Half;
+typedef u_int32_t Elf32_Addr;
+#define ELF32_FSZ_ADDR 4
+typedef u_int32_t Elf32_Off;
+#define ELF32_FSZ_OFF 4
+typedef int32_t Elf32_Sword;
+#define ELF32_FSZ_SWORD 4
+typedef u_int32_t Elf32_Word;
+#define ELF32_FSZ_WORD 4
+typedef u_int16_t Elf32_Half;
+#define ELF32_FSZ_HALF 2
-typedef u_int64_t Elf64_Addr;
-typedef u_int64_t Elf64_Off;
-typedef int64_t Elf64_Sword;
-typedef int32_t Elf64_Shalf;
-typedef u_int64_t Elf64_Word;
-typedef u_int32_t Elf64_Half;
-typedef u_int16_t Elf64_Quarter;
+typedef u_int64_t Elf64_Addr;
+#define ELF64_FSZ_ADDR 8
+typedef u_int64_t Elf64_Off;
+#define ELF64_FSZ_OFF 8
+typedef int64_t Elf64_Sword;
+#define ELF64_FSZ_SWORD 8
+typedef int32_t Elf64_Shalf;
+#define ELF64_FSZ_SHALF 4
+typedef u_int64_t Elf64_Word;
+#define ELF64_FSZ_WORD 8
+typedef u_int32_t Elf64_Half;
+#define ELF64_FSZ_HALF 4
+typedef u_int16_t Elf64_Quarter;
+#define ELF64_FSZ_QUARTER 2
-#define ELF_IDSIZE 16
+#define ELF_NIDENT 16
-enum Elf_e_type {
- Elf_et_none = 0,
- Elf_et_rel,
- Elf_et_exec,
- Elf_et_dyn,
- Elf_et_core,
- Elf_et_num
-};
+#define ET_NONE 0
+#define ET_REL 1
+#define ET_EXEC 2
+#define ET_DYN 3
+#define ET_CORE 4
+#define ET_NUM 5
-enum Elf_e_machine {
- Elf_em_none = 0,
- Elf_em_m32,
- Elf_em_sparc,
- Elf_em_386,
- Elf_em_68k,
- Elf_em_88k,
- Elf_em_486,
- Elf_em_860,
- Elf_em_mips,
- Elf_em_mips_rs3_le = 10,
- Elf_em_rs6000,
- Elf_em_parisc = 15,
- Elf_em_ncube,
- Elf_em_vpp500,
- Elf_em_sparc32plus,
- Elf_em_ppc = 20,
- Elf_em_arm = 40,
- Elf_em_alpha = 41,
- Elf_em_sh = 42,
- Elf_em_sparc64 = 43,
- Elf_em_vax = 75,
- Elf_em_alpha_exp = 0x9026,
- Elf_em_num
-};
+#define EM_NONE 0 /* No machine */
+#define EM_M32 1 /* AT&T WE 32100 */
+#define EM_SPARC 2 /* SPARC */
+#define EM_386 3 /* Intel 80386 */
+#define EM_68K 4 /* Motorola 68000 */
+#define EM_88K 5 /* Motorola 88000 */
+#define EM_486 6 /* Intel 80486 */
+#define EM_860 7 /* Intel 80860 */
+#define EM_MIPS 8 /* MIPS I Architecture */
+#define EM_S370 9 /* Amdahl UTS on System/370 */
+#define EM_MIPS_RS3_LE 10 /* MIPS RS3000 Little-endian */
+#define EM_RS6000 11 /* IBM RS/6000 XXX reserved */
+#define EM_PARISC 15 /* Hewlett-Packard PA-RISC */
+#define EM_NCUBE 16 /* NCube XXX reserved */
+#define EM_VPP500 17 /* Fujitsu VPP500 */
+#define EM_SPARC32PLUS 18 /* Enhanced instruction set SPARC */
+#define EM_960 19 /* Intel 80960 */
+#define EM_PPC 20 /* PowerPC */
+#define EM_V800 36 /* NEC V800 */
+#define EM_FR20 37 /* Fujitsu FR20 */
+#define EM_RH32 38 /* TRW RH-32 */
+#define EM_RCE 39 /* Motorola RCE */
+#define EM_ARM 40 /* Advanced RISC Machines ARM */
+#define EM_ALPHA 41 /* DIGITAL Alpha */
+#define EM_SH 42 /* Hitachi Super-H */
+#define EM_SPARCV9 43 /* SPARC Version 9 */
+#define EM_TRICORE 44 /* Siemens Tricore */
+#define EM_ARC 45 /* Argonaut RISC Core */
+#define EM_H8_300 46 /* Hitachi H8/300 */
+#define EM_H8_300H 47 /* Hitachi H8/300H */
+#define EM_H8S 48 /* Hitachi H8S */
+#define EM_H8_500 49 /* Hitachi H8/500 */
+#define EM_IA_64 50 /* Intel Merced Processor */
+#define EM_MIPS_X 51 /* Stanford MIPS-X */
+#define EM_COLDFIRE 52 /* Motorola Coldfire */
+#define EM_68HC12 53 /* Motorola MC68HC12 */
+#define EM_VAX 75 /* DIGITAL VAX */
+#define EM_ALPHA_EXP 36902 /* used by NetBSD/alpha; obsolete */
+#define EM_NUM 36903
-enum Elf_e_class {
- Elf_ec_invalid = 0,
- Elf_ec_32bit,
- Elf_ec_64bit
-};
+#define ELFCLASSNONE 0 /* Invalid class */
+#define ELFCLASS32 1 /* 32-bit objects */
+#define ELFCLASS64 2 /* 64-bit objects */
+#define ELFCLASSNUM 3
+
+#define EI_MAG0 0
+#define EI_MAG1 1
+#define EI_MAG2 2
+#define EI_MAG3 3
+#define EI_CLASS 4
+#define EI_DATA 5
+#define EI_VERSION 6
+#define EI_PAD 7
-enum Elf_e_ident {
- Elf_ei_mag0 = 0,
- Elf_ei_mag1,
- Elf_ei_mag2,
- Elf_ei_mag3,
- Elf_ei_class,
- Elf_ei_data,
- Elf_ei_version,
- Elf_ei_pad,
- Elf_ei_size = 16
-};
+#define EV_NONE 0 /* Invalid version */
+#define EV_CURRENT 1 /* Current version */
+#define EV_NUM 2
-enum Elf_e_version {
- Elf_ev_none,
- Elf_ev_current
-};
+#define ELFDATANONE 0 /* Invalid data encoding */
+#define ELFDATA2LSB 1 /* 2's complement values, LSB first */
+#define ELFDATA2MSB 2 /* 2's complement values, MSG first */
-enum Elf_e_datafmt {
- Elf_ed_none,
- Elf_ed_2lsb,
- Elf_ed_2msb
-};
+#define PF_R 0x4
+#define PF_W 0x2
+#define PF_X 0x1
-enum Elf_p_pf {
- Elf_pf_r = 4,
- Elf_pf_w = 2,
- Elf_pf_x = 1
-};
+#define PF_MASKPROC 0xf0000000 /* Processor-specific values */
typedef struct {
- unsigned char e_ident[ELF_IDSIZE]; /* Id bytes */
+ unsigned char e_ident[ELF_NIDENT]; /* Id bytes */
Elf32_Half e_type; /* file type */
Elf32_Half e_machine; /* machine type */
Elf32_Word e_version; /* version number */
@@ -147,12 +164,8 @@
Elf32_Half e_shstrndx; /* String table index */
} Elf32_Ehdr;
-#define Elf32_e_ident "\177ELF\001"
-#define Elf32_e_siz (sizeof(Elf32_e_ident) - 1)
-#define ELF32_HDR_SIZE (sizeof(Elf32_Ehdr))
-
typedef struct {
- unsigned char e_ident[ELF_IDSIZE]; /* Id bytes */
+ unsigned char e_ident[ELF_NIDENT]; /* Id bytes */
Elf64_Quarter e_type; /* file type */
Elf64_Quarter e_machine; /* machine type */
Elf64_Half e_version; /* version number */
@@ -168,22 +181,26 @@
Elf64_Quarter e_shstrndx; /* String table index */
} Elf64_Ehdr;
-#define Elf64_e_ident "\177ELF\002"
-#define Elf64_e_siz (sizeof(Elf64_e_ident) - 1)
-#define ELF64_HDR_SIZE (sizeof(Elf64_Ehdr))
+#define ELFMAG0 0x7f
+#define ELFMAG1 'E'
+#define ELFMAG2 'L'
+#define ELFMAG3 'F'
+#define ELFMAG "\177ELF"
+#define SELFMAG 4
-enum Elf_p_pt {
- Elf_pt_null = 0, /* Program header table entry unused */
- Elf_pt_load = 1, /* Loadable program segment */
- Elf_pt_dynamic = 2, /* Dynamic linking information */
- Elf_pt_interp = 3, /* Program interpreter */
- Elf_pt_note = 4, /* Auxiliary information */
- Elf_pt_shlib = 5, /* Reserved, unspecified semantics */
- Elf_pt_phdr = 6, /* Entry for header table itself */
- Elf_pt_loproc = 0x70000000, /* Processor-specific */
- Elf_pt_hiproc = 0x7FFFFFFF /* Processor-specific */
-#define Elf_pt_mips_reginfo 0x70000000
-};
+#define PT_NULL 0 /* Program header table entry unused */
+#define PT_LOAD 1 /* Loadable program segment */
+#define PT_DYNAMIC 2 /* Dynamic linking information */
+#define PT_INTERP 3 /* Program interpreter */
+#define PT_NOTE 4 /* Auxiliary information */
+#define PT_SHLIB 5 /* Reserved, unspecified semantics */
+#define PT_PHDR 6 /* Entry for header table itself */
+#define PT_NUM 7
+
+#define PT_LOPROC 0x70000000 /* Processor-specific range */
+#define PT_HIPROC 0x7fffffff
+
+#define PT_MIPS_REGINFO 0x70000000
typedef struct {
Elf32_Word p_type; /* entry type */
@@ -210,22 +227,24 @@
/*
* Section Headers
*/
-enum Elf_s_sht {
- Elf_sht_null = 0,
- Elf_sht_progbits = 1,
- Elf_sht_symtab = 2,
- Elf_sht_strtab = 3,
- Elf_sht_rela = 4,
- Elf_sht_hash = 5,
- Elf_sht_dynamic = 6,
- Elf_sht_note = 7,
- Elf_sht_nobits = 8,
- Elf_sht_rel = 9,
- Elf_sht_shlib = 10,
- Elf_sht_dynsym = 11,
- Elf_sht_loproc = 0x70000000,
- Elf_sht_hiproc = 0x7FFFFFFF
-};
+#define SHT_NULL 0
+#define SHT_PROGBITS 1
+#define SHT_SYMTAB 2
+#define SHT_STRTAB 3
+#define SHT_RELA 4
+#define SHT_HASH 5
+#define SHT_DYNAMIC 6
+#define SHT_NOTE 7
+#define SHT_NOBITS 8
+#define SHT_REL 9
+#define SHT_SHLIB 10
+#define SHT_DYNSYM 11
+#define SHT_NUM 12
+
+#define SHT_LOUSER 0x80000000
+#define SHT_HIUSER 0xffffffff
+#define SHT_LOPROC 0x70000000 /* Processor-specific range */
+#define SHT_HIPROC 0x7fffffff
typedef struct {
Elf32_Word sh_name; /* section name */
@@ -256,10 +275,11 @@
Home |
Main Index |
Thread Index |
Old Index