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

@ -28,6 +28,7 @@
#include "libc/testlib/testlib.h"
#include "libc/thread/thread.h"
#include "libc/thread/thread2.h"
#ifdef __x86_64__
int pfds[2];
pthread_cond_t cv;
@ -206,6 +207,7 @@ void KeyDestructor(void *arg) {
key_destructor_was_run = true;
}
#ifdef __x86_64__
void TortureStack(void) {
asm("sub\t$4,%rsp\n\t"
"pause\n\t"
@ -213,6 +215,7 @@ void TortureStack(void) {
"pause\n\t"
"add\t$6,%rsp");
}
#endif
void *CpuBoundWorker(void *arg) {
char *volatile wontleak1;
@ -224,12 +227,15 @@ void *CpuBoundWorker(void *arg) {
wontleak2 = _gc(malloc(123));
ASSERT_EQ(0, pthread_setspecific(key, (void *)31337));
ASSERT_EQ(0, pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0));
#ifdef __x86_64__
for (;;) {
TortureStack();
is_in_infinite_loop = true;
}
#endif
pthread_cleanup_pop(1);
free(wouldleak);
return 0;
}
TEST(pthread_cancel, async) {
@ -275,3 +281,5 @@ TEST(pthread_cancel, self_asynchronous_takesImmediateEffect) {
ASSERT_SYS(0, 0, close(pfds[1]));
ASSERT_SYS(0, 0, close(pfds[0]));
}
#endif /* __x86_64__ */