gcore: Add aarch64 32-bit core support
Summary: Add trivial 32-bit arm cores on aarch64 support for gcore. This doesn't handle fpregs. Reviewed by: #arm, andrew Sponsored by: Juniper Networks, Inc Differential Revision: https://reviews.freebsd.org/D21947
This commit is contained in:
parent
14601230a1
commit
26517dcf60
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=353436
@ -64,7 +64,11 @@ typedef struct { /* Auxiliary vector entry on initial stack */
|
|||||||
|
|
||||||
__ElfType(Auxinfo);
|
__ElfType(Auxinfo);
|
||||||
|
|
||||||
|
#ifdef _MACHINE_ELF_WANT_32BIT
|
||||||
|
#define ELF_ARCH EM_ARM
|
||||||
|
#else
|
||||||
#define ELF_ARCH EM_AARCH64
|
#define ELF_ARCH EM_AARCH64
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ELF_MACHINE_OK(x) ((x) == (ELF_ARCH))
|
#define ELF_MACHINE_OK(x) ((x) == (ELF_ARCH))
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ PROG= gcore
|
|||||||
SRCS= elfcore.c gcore.c
|
SRCS= elfcore.c gcore.c
|
||||||
LIBADD= sbuf util
|
LIBADD= sbuf util
|
||||||
|
|
||||||
.if ${MACHINE_ARCH} == "amd64"
|
.if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64"
|
||||||
SRCS+= elf32core.c
|
SRCS+= elf32core.c
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
@ -32,7 +32,15 @@ elf_convert_gregset(elfcore_gregset_t *rd, struct reg *rs)
|
|||||||
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
|
||||||
}
|
}
|
||||||
@ -43,6 +51,8 @@ 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
|
||||||
|
Loading…
Reference in New Issue
Block a user