Port a lot more code to AARCH64

- Introduce epoll_pwait()
- Rewrite -ftrapv and ffs() libraries in C code
- Use more FreeBSD code in math function library
- Get significantly more tests passing on qemu-aarch64
- Fix many Musl long double functions that were broken on AARCH64
This commit is contained in:
Justine Tunney 2023-05-14 09:32:15 -07:00
parent 91791e9f38
commit 550b52abf6
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
158 changed files with 6018 additions and 3499 deletions

View file

@ -27,17 +27,21 @@
#include "libc/testlib/testlib.h"
#include "third_party/xed/x86.h"
#ifdef __x86_64__
static volatile _Thread_local int gotsignal;
static void ContinueOnError(int sig, siginfo_t *si, void *vctx) {
struct XedDecodedInst xedd;
struct ucontext *ctx = vctx;
gotsignal = sig;
#ifdef __aarch64__
ctx->uc_mcontext.pc += 4;
#elif defined(__x86_64__)
struct XedDecodedInst xedd;
xed_decoded_inst_zero_set_mode(&xedd, XED_MACHINE_MODE_LONG_64);
xed_instruction_length_decode(&xedd, (void *)ctx->uc_mcontext.rip, 15);
ctx->uc_mcontext.rip += xedd.length;
gotsignal = sig;
#else
#error "unsupported architecture"
#endif /* __x86_64__ */
}
/**
@ -63,5 +67,3 @@ noasan bool testlib_memoryexists(const void *p) {
_npassert(!sigaction(SIGSEGV, old + 0, 0));
return !gotsignal;
}
#endif /* __x86_64__ */