Get setcontext() and getcontext() working on Aarch64

This change also adds the missing code for getting and restoring the
thread's signal mask, since that's explicitly listed by the man page
This commit is contained in:
Justine Tunney 2023-07-01 22:42:58 -07:00
parent 8b62bff364
commit 7ec84655b4
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
7 changed files with 182 additions and 13 deletions

View file

@ -5,6 +5,14 @@
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#ifdef __x86_64__
#define SP rsp
#elif defined(__aarch64__)
#define SP sp
#else
#error "unsupported architecture"
#endif
void _ntcontext2linux(struct ucontext *, const struct NtContext *) _Hide;
void _ntlinux2context(struct NtContext *, const ucontext_t *) _Hide;