]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/GenFw/elf32.h
BaseTools: Clean up source files
[mirror_edk2.git] / BaseTools / Source / C / GenFw / elf32.h
index dd4e1325986be88520c6def8834d4d6fd3dd06cf..4371776edf6fe2f1dec2100134860fe38008d5c2 100644 (file)
@@ -48,38 +48,38 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
  * ELF definitions common to all 32-bit architectures.\r
  */\r
 \r
-typedef UINT32 Elf32_Addr;\r
-typedef UINT16 Elf32_Half;\r
-typedef UINT32 Elf32_Off;\r
-typedef INT32          Elf32_Sword;\r
-typedef UINT32 Elf32_Word;\r
-typedef UINT64 Elf32_Lword;\r
+typedef UINT32  Elf32_Addr;\r
+typedef UINT16  Elf32_Half;\r
+typedef UINT32  Elf32_Off;\r
+typedef INT32    Elf32_Sword;\r
+typedef UINT32  Elf32_Word;\r
+typedef UINT64  Elf32_Lword;\r
 \r
-typedef Elf32_Word     Elf32_Hashelt;\r
+typedef Elf32_Word  Elf32_Hashelt;\r
 \r
 /* Non-standard class-dependent datatype used for abstraction. */\r
-typedef Elf32_Word     Elf32_Size;\r
-typedef Elf32_Sword    Elf32_Ssize;\r
+typedef Elf32_Word  Elf32_Size;\r
+typedef Elf32_Sword  Elf32_Ssize;\r
 \r
 /*\r
  * ELF header.\r
  */\r
 \r
 typedef struct {\r
-       unsigned char   e_ident[EI_NIDENT];     /* File identification. */\r
-       Elf32_Half      e_type;         /* File type. */\r
-       Elf32_Half      e_machine;      /* Machine architecture. */\r
-       Elf32_Word      e_version;      /* ELF format version. */\r
-       Elf32_Addr      e_entry;        /* Entry point. */\r
-       Elf32_Off       e_phoff;        /* Program header file offset. */\r
-       Elf32_Off       e_shoff;        /* Section header file offset. */\r
-       Elf32_Word      e_flags;        /* Architecture-specific flags. */\r
-       Elf32_Half      e_ehsize;       /* Size of ELF header in bytes. */\r
-       Elf32_Half      e_phentsize;    /* Size of program header entry. */\r
-       Elf32_Half      e_phnum;        /* Number of program header entries. */\r
-       Elf32_Half      e_shentsize;    /* Size of section header entry. */\r
-       Elf32_Half      e_shnum;        /* Number of section header entries. */\r
-       Elf32_Half      e_shstrndx;     /* Section name strings section. */\r
+  unsigned char  e_ident[EI_NIDENT];  /* File identification. */\r
+  Elf32_Half  e_type;    /* File type. */\r
+  Elf32_Half  e_machine;  /* Machine architecture. */\r
+  Elf32_Word  e_version;  /* ELF format version. */\r
+  Elf32_Addr  e_entry;  /* Entry point. */\r
+  Elf32_Off  e_phoff;  /* Program header file offset. */\r
+  Elf32_Off  e_shoff;  /* Section header file offset. */\r
+  Elf32_Word  e_flags;  /* Architecture-specific flags. */\r
+  Elf32_Half  e_ehsize;  /* Size of ELF header in bytes. */\r
+  Elf32_Half  e_phentsize;  /* Size of program header entry. */\r
+  Elf32_Half  e_phnum;  /* Number of program header entries. */\r
+  Elf32_Half  e_shentsize;  /* Size of section header entry. */\r
+  Elf32_Half  e_shnum;  /* Number of section header entries. */\r
+  Elf32_Half  e_shstrndx;  /* Section name strings section. */\r
 } Elf32_Ehdr;\r
 \r
 /*\r
@@ -87,17 +87,17 @@ typedef struct {
  */\r
 \r
 typedef struct {\r
-       Elf32_Word      sh_name;        /* Section name (index into the\r
-                                          section header string table). */\r
-       Elf32_Word      sh_type;        /* Section type. */\r
-       Elf32_Word      sh_flags;       /* Section flags. */\r
-       Elf32_Addr      sh_addr;        /* Address in memory image. */\r
-       Elf32_Off       sh_offset;      /* Offset in file. */\r
-       Elf32_Word      sh_size;        /* Size in bytes. */\r
-       Elf32_Word      sh_link;        /* Index of a related section. */\r
-       Elf32_Word      sh_info;        /* Depends on section type. */\r
-       Elf32_Word      sh_addralign;   /* Alignment in bytes. */\r
-       Elf32_Word      sh_entsize;     /* Size of each entry in section. */\r
+  Elf32_Word  sh_name;  /* Section name (index into the\r
+             section header string table). */\r
+  Elf32_Word  sh_type;  /* Section type. */\r
+  Elf32_Word  sh_flags;  /* Section flags. */\r
+  Elf32_Addr  sh_addr;  /* Address in memory image. */\r
+  Elf32_Off  sh_offset;  /* Offset in file. */\r
+  Elf32_Word  sh_size;  /* Size in bytes. */\r
+  Elf32_Word  sh_link;  /* Index of a related section. */\r
+  Elf32_Word  sh_info;  /* Depends on section type. */\r
+  Elf32_Word  sh_addralign;  /* Alignment in bytes. */\r
+  Elf32_Word  sh_entsize;  /* Size of each entry in section. */\r
 } Elf32_Shdr;\r
 \r
 /*\r
@@ -105,14 +105,14 @@ typedef struct {
  */\r
 \r
 typedef struct {\r
-       Elf32_Word      p_type;         /* Entry type. */\r
-       Elf32_Off       p_offset;       /* File offset of contents. */\r
-       Elf32_Addr      p_vaddr;        /* Virtual address in memory image. */\r
-       Elf32_Addr      p_paddr;        /* Physical address (not used). */\r
-       Elf32_Word      p_filesz;       /* Size of contents in file. */\r
-       Elf32_Word      p_memsz;        /* Size of contents in memory. */\r
-       Elf32_Word      p_flags;        /* Access permission flags. */\r
-       Elf32_Word      p_align;        /* Alignment in memory and file. */\r
+  Elf32_Word  p_type;    /* Entry type. */\r
+  Elf32_Off  p_offset;  /* File offset of contents. */\r
+  Elf32_Addr  p_vaddr;  /* Virtual address in memory image. */\r
+  Elf32_Addr  p_paddr;  /* Physical address (not used). */\r
+  Elf32_Word  p_filesz;  /* Size of contents in file. */\r
+  Elf32_Word  p_memsz;  /* Size of contents in memory. */\r
+  Elf32_Word  p_flags;  /* Access permission flags. */\r
+  Elf32_Word  p_align;  /* Alignment in memory and file. */\r
 } Elf32_Phdr;\r
 \r
 /*\r
@@ -120,11 +120,11 @@ typedef struct {
  */\r
 \r
 typedef struct {\r
-       Elf32_Sword     d_tag;          /* Entry type. */\r
-       union {\r
-               Elf32_Word      d_val;  /* Integer value. */\r
-               Elf32_Addr      d_ptr;  /* Address value. */\r
-       } d_un;\r
+  Elf32_Sword  d_tag;    /* Entry type. */\r
+  union {\r
+    Elf32_Word  d_val;  /* Integer value. */\r
+    Elf32_Addr  d_ptr;  /* Address value. */\r
+  } d_un;\r
 } Elf32_Dyn;\r
 \r
 /*\r
@@ -133,60 +133,60 @@ typedef struct {
 \r
 /* Relocations that don't need an addend field. */\r
 typedef struct {\r
-       Elf32_Addr      r_offset;       /* Location to be relocated. */\r
-       Elf32_Word      r_info;         /* Relocation type and symbol index. */\r
+  Elf32_Addr  r_offset;  /* Location to be relocated. */\r
+  Elf32_Word  r_info;    /* Relocation type and symbol index. */\r
 } Elf32_Rel;\r
 \r
 /* Relocations that need an addend field. */\r
 typedef struct {\r
-       Elf32_Addr      r_offset;       /* Location to be relocated. */\r
-       Elf32_Word      r_info;         /* Relocation type and symbol index. */\r
-       Elf32_Sword     r_addend;       /* Addend. */\r
+  Elf32_Addr  r_offset;  /* Location to be relocated. */\r
+  Elf32_Word  r_info;    /* Relocation type and symbol index. */\r
+  Elf32_Sword  r_addend;  /* Addend. */\r
 } Elf32_Rela;\r
 \r
 /* Macros for accessing the fields of r_info. */\r
-#define ELF32_R_SYM(info)      ((info) >> 8)\r
-#define ELF32_R_TYPE(info)     ((unsigned char)(info))\r
+#define ELF32_R_SYM(info)  ((info) >> 8)\r
+#define ELF32_R_TYPE(info)  ((unsigned char)(info))\r
 \r
 /* Macro for constructing r_info from field values. */\r
-#define ELF32_R_INFO(sym, type)        (((sym) << 8) + (unsigned char)(type))\r
+#define ELF32_R_INFO(sym, type)  (((sym) << 8) + (unsigned char)(type))\r
 \r
 /*\r
- *     Note entry header\r
+ *  Note entry header\r
  */\r
 typedef Elf_Note Elf32_Nhdr;\r
 \r
 /*\r
- *     Move entry\r
+ *  Move entry\r
  */\r
 typedef struct {\r
-       Elf32_Lword     m_value;        /* symbol value */\r
-       Elf32_Word      m_info;         /* size + index */\r
-       Elf32_Word      m_poffset;      /* symbol offset */\r
-       Elf32_Half      m_repeat;       /* repeat count */\r
-       Elf32_Half      m_stride;       /* stride info */\r
+  Elf32_Lword  m_value;  /* symbol value */\r
+  Elf32_Word   m_info;    /* size + index */\r
+  Elf32_Word  m_poffset;  /* symbol offset */\r
+  Elf32_Half  m_repeat;  /* repeat count */\r
+  Elf32_Half  m_stride;  /* stride info */\r
 } Elf32_Move;\r
 \r
 /*\r
- *     The macros compose and decompose values for Move.r_info\r
+ *  The macros compose and decompose values for Move.r_info\r
  *\r
- *     sym = ELF32_M_SYM(M.m_info)\r
- *     size = ELF32_M_SIZE(M.m_info)\r
- *     M.m_info = ELF32_M_INFO(sym, size)\r
+ *  sym = ELF32_M_SYM(M.m_info)\r
+ *  size = ELF32_M_SIZE(M.m_info)\r
+ *  M.m_info = ELF32_M_INFO(sym, size)\r
  */\r
-#define        ELF32_M_SYM(info)       ((info)>>8)\r
-#define        ELF32_M_SIZE(info)      ((unsigned char)(info))\r
-#define        ELF32_M_INFO(sym, size) (((sym)<<8)+(unsigned char)(size))\r
+#define  ELF32_M_SYM(info)  ((info)>>8)\r
+#define  ELF32_M_SIZE(info)  ((unsigned char)(info))\r
+#define  ELF32_M_INFO(sym, size)  (((sym)<<8)+(unsigned char)(size))\r
 \r
 /*\r
- *     Hardware/Software capabilities entry\r
+ *  Hardware/Software capabilities entry\r
  */\r
 typedef struct {\r
-       Elf32_Word      c_tag;          /* how to interpret value */\r
-       union {\r
-               Elf32_Word      c_val;\r
-               Elf32_Addr      c_ptr;\r
-       } c_un;\r
+  Elf32_Word  c_tag;    /* how to interpret value */\r
+  union {\r
+    Elf32_Word  c_val;\r
+    Elf32_Addr  c_ptr;\r
+  } c_un;\r
 } Elf32_Cap;\r
 \r
 /*\r
@@ -194,65 +194,65 @@ typedef struct {
  */\r
 \r
 typedef struct {\r
-       Elf32_Word      st_name;        /* String table index of name. */\r
-       Elf32_Addr      st_value;       /* Symbol value. */\r
-       Elf32_Word      st_size;        /* Size of associated object. */\r
-       unsigned char   st_info;        /* Type and binding information. */\r
-       unsigned char   st_other;       /* Reserved (not used). */\r
-       Elf32_Half      st_shndx;       /* Section index of symbol. */\r
+  Elf32_Word  st_name;  /* String table index of name. */\r
+  Elf32_Addr  st_value;  /* Symbol value. */\r
+  Elf32_Word  st_size;  /* Size of associated object. */\r
+  unsigned char  st_info;  /* Type and binding information. */\r
+  unsigned char  st_other;  /* Reserved (not used). */\r
+  Elf32_Half  st_shndx;  /* Section index of symbol. */\r
 } Elf32_Sym;\r
 \r
 /* Macros for accessing the fields of st_info. */\r
-#define ELF32_ST_BIND(info)            ((info) >> 4)\r
-#define ELF32_ST_TYPE(info)            ((info) & 0xf)\r
+#define ELF32_ST_BIND(info)    ((info) >> 4)\r
+#define ELF32_ST_TYPE(info)    ((info) & 0xf)\r
 \r
 /* Macro for constructing st_info from field values. */\r
-#define ELF32_ST_INFO(bind, type)      (((bind) << 4) + ((type) & 0xf))\r
+#define ELF32_ST_INFO(bind, type)  (((bind) << 4) + ((type) & 0xf))\r
 \r
 /* Macro for accessing the fields of st_other. */\r
-#define ELF32_ST_VISIBILITY(oth)       ((oth) & 0x3)\r
+#define ELF32_ST_VISIBILITY(oth)  ((oth) & 0x3)\r
 \r
 /* Structures used by Sun & GNU symbol versioning. */\r
 typedef struct\r
 {\r
-       Elf32_Half      vd_version;\r
-       Elf32_Half      vd_flags;\r
-       Elf32_Half      vd_ndx;\r
-       Elf32_Half      vd_cnt;\r
-       Elf32_Word      vd_hash;\r
-       Elf32_Word      vd_aux;\r
-       Elf32_Word      vd_next;\r
+  Elf32_Half  vd_version;\r
+  Elf32_Half  vd_flags;\r
+  Elf32_Half  vd_ndx;\r
+  Elf32_Half  vd_cnt;\r
+  Elf32_Word  vd_hash;\r
+  Elf32_Word  vd_aux;\r
+  Elf32_Word  vd_next;\r
 } Elf32_Verdef;\r
 \r
 typedef struct\r
 {\r
-       Elf32_Word      vda_name;\r
-       Elf32_Word      vda_next;\r
+  Elf32_Word  vda_name;\r
+  Elf32_Word  vda_next;\r
 } Elf32_Verdaux;\r
 \r
 typedef struct\r
 {\r
-       Elf32_Half      vn_version;\r
-       Elf32_Half      vn_cnt;\r
-       Elf32_Word      vn_file;\r
-       Elf32_Word      vn_aux;\r
-       Elf32_Word      vn_next;\r
+  Elf32_Half  vn_version;\r
+  Elf32_Half  vn_cnt;\r
+  Elf32_Word  vn_file;\r
+  Elf32_Word  vn_aux;\r
+  Elf32_Word  vn_next;\r
 } Elf32_Verneed;\r
 \r
 typedef struct\r
 {\r
-       Elf32_Word      vna_hash;\r
-       Elf32_Half      vna_flags;\r
-       Elf32_Half      vna_other;\r
-       Elf32_Word      vna_name;\r
-       Elf32_Word      vna_next;\r
+  Elf32_Word  vna_hash;\r
+  Elf32_Half  vna_flags;\r
+  Elf32_Half  vna_other;\r
+  Elf32_Word  vna_name;\r
+  Elf32_Word  vna_next;\r
 } Elf32_Vernaux;\r
 \r
 typedef Elf32_Half Elf32_Versym;\r
 \r
 typedef struct {\r
-       Elf32_Half      si_boundto;     /* direct bindings - symbol bound to */\r
-       Elf32_Half      si_flags;       /* per symbol flags */\r
+  Elf32_Half  si_boundto;  /* direct bindings - symbol bound to */\r
+  Elf32_Half  si_flags;  /* per symbol flags */\r
 } Elf32_Syminfo;\r
 \r
 #endif /* !_SYS_ELF32_H_ */\r