| /* |
| * Copyright (c) 2018 MediaTek Inc. |
| * |
| * Permission is hereby granted, free of charge, to any person obtaining |
| * a copy of this software and associated documentation files |
| * (the "Software"), to deal in the Software without restriction, |
| * including without limitation the rights to use, copy, modify, merge, |
| * publish, distribute, sublicense, and/or sell copies of the Software, |
| * and to permit persons to whom the Software is furnished to do so, |
| * subject to the following conditions: |
| * |
| * The above copyright notice and this permission notice shall be |
| * included in all copies or substantial portions of the Software. |
| * |
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| */ |
| |
| #if !defined(__KDUMP_ELF_H__) |
| #define __KDUMP_ELF_H__ |
| |
| #include <stdint.h> |
| #include "mrdump_elf_common.h" |
| |
| #define ELF_ARM_NGREGS 18 |
| typedef uint32_t elf_arm_gregset_t[ELF_ARM_NGREGS]; |
| |
| typedef struct elf32_hdr { |
| unsigned char e_ident[EI_NIDENT]; |
| Elf32_Half e_type; |
| Elf32_Half e_machine; |
| Elf32_Word e_version; |
| Elf32_Addr e_entry; |
| Elf32_Off e_phoff; |
| Elf32_Off e_shoff; |
| Elf32_Word e_flags; |
| Elf32_Half e_ehsize; |
| Elf32_Half e_phentsize; |
| Elf32_Half e_phnum; |
| Elf32_Half e_shentsize; |
| Elf32_Half e_shnum; |
| Elf32_Half e_shstrndx; |
| } Elf64_Ehdr; |
| |
| typedef struct elf32_phdr { |
| Elf32_Word p_type; |
| Elf32_Off p_offset; |
| Elf32_Addr p_vaddr; |
| Elf32_Addr p_paddr; |
| Elf32_Word p_filesz; |
| Elf32_Word p_memsz; |
| Elf32_Word p_flags; |
| Elf32_Word p_align; |
| } Elf32_Phdr; |
| |
| typedef struct elf_note { |
| Elf32_Word n_namesz; /* Name size */ |
| Elf32_Word n_descsz; /* Content size */ |
| Elf32_Word n_type; /* Content type */ |
| } Elf_Nhdr; |
| |
| struct elf32_timeval { |
| int32_t tv_sec; |
| int32_t tv_usec; |
| }; |
| |
| struct elf_siginfo { |
| int32_t si_signo; |
| int32_t si_code; |
| int32_t si_errno; |
| }; |
| |
| struct elf32_arm_prstatus { |
| struct elf_siginfo pr_info; |
| short pr_cursig; |
| uint32_t pr_sigpend; |
| uint32_t pr_sighold; |
| |
| int32_t pr_pid; |
| int32_t pr_ppid; |
| int32_t pr_pgrp; |
| |
| int32_t pr_sid; |
| struct elf32_timeval pr_utime; |
| struct elf32_timeval pr_stime; |
| struct elf32_timeval pr_cutime; |
| struct elf32_timeval pr_cstime; |
| |
| elf_arm_gregset_t pr_reg; |
| |
| int32_t pr_fpvalid; |
| }; |
| |
| struct elf32_prpsinfo { |
| char pr_state; |
| char pr_sname; |
| char pr_zomb; |
| char pr_nice; |
| uint32_t pr_flag; |
| |
| uint16_t pr_uid; |
| uint16_t pr_gid; |
| |
| int32_t pr_pid; |
| int32_t pr_ppid; |
| int32_t pr_pgrp; |
| int32_t pr_sid; |
| |
| char pr_fname[16]; |
| char pr_psargs[ELF_PRARGSZ]; |
| }; |
| |
| #endif /* __KDUMP_ELF_H__ */ |