Changeset View
Changeset View
Standalone View
Standalone View
head/usr.bin/gcore/elf32core.c
Show All 26 Lines | #ifdef __amd64__ | ||||
rd->r_edx = rs->r_rdx; | rd->r_edx = rs->r_rdx; | ||||
rd->r_ecx = rs->r_rcx; | rd->r_ecx = rs->r_rcx; | ||||
rd->r_eax = rs->r_rax; | rd->r_eax = rs->r_rax; | ||||
rd->r_eip = rs->r_rip; | rd->r_eip = rs->r_rip; | ||||
rd->r_cs = rs->r_cs; | rd->r_cs = rs->r_cs; | ||||
rd->r_eflags = rs->r_rflags; | rd->r_eflags = rs->r_rflags; | ||||
rd->r_esp = rs->r_rsp; | rd->r_esp = rs->r_rsp; | ||||
rd->r_ss = rs->r_ss; | rd->r_ss = rs->r_ss; | ||||
#else | #elif defined(__aarch64__) | ||||
int i; | |||||
for (i = 0; i < 13; i++) | |||||
rd->r[i] = rs->x[i]; | |||||
rd->r_sp = rs->x[13]; | |||||
rd->r_lr = rs->x[14]; | |||||
rd->r_pc = rs->elr; | |||||
rd->r_cpsr = rs->spsr; | |||||
#error Unsupported architecture | #error Unsupported architecture | ||||
#endif | #endif | ||||
} | } | ||||
static void | static void | ||||
elf_convert_fpregset(elfcore_fpregset_t *rd, struct fpreg *rs) | elf_convert_fpregset(elfcore_fpregset_t *rd, struct fpreg *rs) | ||||
{ | { | ||||
#ifdef __amd64__ | #ifdef __amd64__ | ||||
/* XXX this is wrong... */ | /* XXX this is wrong... */ | ||||
memcpy(rd, rs, sizeof(*rd)); | memcpy(rd, rs, sizeof(*rd)); | ||||
#elif defined(__aarch64__) | |||||
/* ARM64TODO */ | |||||
#else | #else | ||||
#error Unsupported architecture | #error Unsupported architecture | ||||
#endif | #endif | ||||
} | } | ||||
static void | static void | ||||
elf_convert_siginfo(struct siginfo32 *sid, siginfo_t *sis) | elf_convert_siginfo(struct siginfo32 *sid, siginfo_t *sis) | ||||
{ | { | ||||
Show All 35 Lines |