Refactor some code

- Write tests for cthreads
- Fix bugs in pe2.com tool
- Fix ASAN issue with GetDosEnviron()
- Consolidate the cthread header files
- Some code size optimizations for MODE=
- Attempted to squash a tls linker warning
- Attempted to get futexes working on FreeBSD
This commit is contained in:
Justine Tunney 2022-05-28 05:50:01 -07:00
parent 909e54510d
commit 425ff5dff0
61 changed files with 529 additions and 382 deletions

View file

@ -27,8 +27,7 @@
#include "libc/str/str.h"
#include "libc/sysv/consts/map.h"
#include "libc/sysv/consts/prot.h"
#include "libc/thread/descriptor.h"
#include "libc/thread/self.h"
#include "libc/thread/thread.h"
static textstartup void _main_thread_init(void) {
_Static_assert(offsetof(struct cthread_descriptor_t, self) == 0x00, "");
@ -67,6 +66,7 @@ static textstartup void _main_thread_init(void) {
// Set FS
__install_tls((char *)td);
assert(cthread_self()->tid == gettid());
__threaded = true;
}
const void *const _main_thread_ctor[] initarray = {