blob: 4ab22a672328b2200a9fc650c30be61569338078 [file] [log] [blame]
/*
* 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(__MRDUMP_ELF64_H__)
#define __MRDUMP_ELF64_H__
#include <stdint.h>
#include "mrdump_elf_common.h"
#define ELF_ARM64_NGREGS 34
typedef uint64_t elf_arm64_gregset_t[ELF_ARM64_NGREGS];
typedef struct elf64_hdr {
unsigned char e_ident[EI_NIDENT];
Elf64_Half e_type;
Elf64_Half e_machine;
Elf64_Word e_version;
Elf64_Addr e_entry;
Elf64_Off e_phoff;
Elf64_Off e_shoff;
Elf64_Word e_flags;
Elf64_Half e_ehsize;
Elf64_Half e_phentsize;
Elf64_Half e_phnum;
Elf64_Half e_shentsize;
Elf64_Half e_shnum;
Elf64_Half e_shstrndx;
} Elf64_ehdr;
typedef struct elf64_phdr {
Elf64_Word p_type;
Elf64_Word p_flags;
Elf64_Off p_offset;
Elf64_Addr p_vaddr;
Elf64_Addr p_paddr;
Elf64_Xword p_filesz;
Elf64_Xword p_memsz;
Elf64_Xword p_align;
} Elf64_phdr;
typedef struct elf64_note {
Elf64_Word n_namesz; /* Name size */
Elf64_Word n_descsz; /* Content size */
Elf64_Word n_type; /* Content type */
} Elf64_nhdr;
struct elf_timeval64 {
int64_t tv_sec;
int64_t tv_usec;
};
struct elf_siginfo {
int64_t si_signo;
int64_t si_code;
int64_t si_errno;
};
struct elf_arm64_prstatus64 {
struct elf_siginfo pr_info;
short pr_cursig;
uint64_t pr_sigpend;
uint64_t pr_sighold;
int32_t pr_pid;
int32_t pr_ppid;
int32_t pr_pgrp;
int32_t pr_sid;
struct elf_timeval64 pr_utime;
struct elf_timeval64 pr_stime;
struct elf_timeval64 pr_cutime;
struct elf_timeval64 pr_cstime;
elf_arm64_gregset_t pr_reg;
int64_t pr_fpvalid;
};
struct elf_prpsinfo64 {
char pr_state;
char pr_sname;
char pr_zomb;
char pr_nice;
uint64_t pr_flag;
uint32_t pr_uid;
uint32_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 /* __MRDUMP_ELF64_H__ */