Introduce FreeBSD ARM64 support

It's 100% passing test fleet. Solid as a rock.
This commit is contained in:
Justine Tunney 2023-12-29 20:11:23 -08:00
parent 43fe5956ad
commit 83107f78ed
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
455 changed files with 778 additions and 551 deletions

View file

@ -2,6 +2,22 @@
#define COSMOPOLITAN_LIBC_CALLS_STRUCT_UCONTEXT_FREEBSD_INTERNAL_H_
COSMOPOLITAN_C_START_
struct gpregs_freebsd_aarch64 {
int64_t gp_x[30];
int64_t gp_lr;
int64_t gp_sp;
int64_t gp_elr; /* pc */
uint64_t gp_spsr; /* pstate or cpsr */
};
struct fpregs_freebsd_aarch64 {
uint128_t fp_q[32];
uint32_t fp_sr;
uint32_t fp_cr;
int fp_flags;
int fp_pad;
};
struct stack_freebsd {
void *ss_sp;
uint64_t ss_size;
@ -9,6 +25,7 @@ struct stack_freebsd {
};
struct mcontext_freebsd {
#ifdef __x86_64__
int64_t mc_onstack;
int64_t mc_rdi;
int64_t mc_rsi;
@ -47,6 +64,14 @@ struct mcontext_freebsd {
int64_t mc_xfpustate;
int64_t mc_xfpustate_len;
int64_t mc_spare[4];
#elif defined(__aarch64__)
struct gpregs_freebsd_aarch64 mc_gpregs;
struct fpregs_freebsd_aarch64 mc_fpregs;
int mc_flags;
#define _MC_FP_VALID 0x1 /* Set when mc_fpregs has valid data */
int mc_pad; /* Padding */
uint64_t mc_spare[8]; /* Space for expansion, set to zero */
#endif
};
struct ucontext_freebsd {