aarch64: fix struct size for arm64

pull/22/head
osy 2021-01-04 15:40:40 -08:00
parent 6aac5bddbf
commit a7d36d8db4
2 changed files with 14 additions and 9 deletions

View File

@ -1,20 +1,20 @@
#ifndef LIBUCONTEXT_BITS_H
#define LIBUCONTEXT_BITS_H
typedef unsigned long libucontext_greg_t;
typedef unsigned long libucontext_gregset_t[34];
typedef unsigned long long int libucontext_greg_t;
typedef unsigned long int libucontext_sigset_t;
typedef struct {
__uint128_t vregs[32];
unsigned int fpsr;
unsigned int fpcr;
libucontext_greg_t fpsr;
libucontext_greg_t fpcr;
} libucontext_fpregset_t;
typedef struct sigcontext {
unsigned long fault_address;
unsigned long regs[31];
unsigned long sp, pc, pstate;
long double __reserved[256];
typedef struct {
libucontext_greg_t fault_address;
libucontext_greg_t regs[31];
libucontext_greg_t sp, pc, pstate;
double __reserved[256];
} libucontext_mcontext_t;
typedef struct {
@ -27,6 +27,7 @@ typedef struct libucontext_ucontext {
unsigned long uc_flags;
struct libucontext_ucontext *uc_link;
libucontext_stack_t uc_stack;
libucontext_sigset_t uc_sigmask;
unsigned char __pad[128];
libucontext_mcontext_t uc_mcontext;
} libucontext_ucontext_t;

View File

@ -24,6 +24,10 @@
extern void libucontext_trampoline(void);
_Static_assert(offsetof(libucontext_ucontext_t, uc_mcontext.regs[0]) == R0_OFFSET, "R0_OFFSET is invalid");
_Static_assert(offsetof(libucontext_ucontext_t, uc_mcontext.sp) == SP_OFFSET, "SP_OFFSET is invalid");
_Static_assert(offsetof(libucontext_ucontext_t, uc_mcontext.pc) == PC_OFFSET, "PC_OFFSET is invalid");
_Static_assert(offsetof(libucontext_ucontext_t, uc_mcontext.pstate) == PSTATE_OFFSET, "PSTATE_OFFSET is invalid");
void
libucontext_makecontext(libucontext_ucontext_t *ucp, void (*func)(void), int argc, ...)