Perform some code cleanup

This commit is contained in:
Justine Tunney 2021-02-27 10:33:32 -08:00
parent 3e17c7b20f
commit 19d0c15e03
41 changed files with 321 additions and 459 deletions

View file

@ -23,6 +23,8 @@
#include "libc/nt/thunk/msabi.h"
#include "libc/sysv/consts/nr.h"
extern void(__msabi* __imp_ExitProcess)(uint32_t);
/**
* Terminates process, ignoring destructors and atexit() handlers.
*
@ -41,10 +43,10 @@ privileged wontreturn void _Exit(int exitcode) {
: "a"(__NR_exit_group), "D"(exitcode)
: "memory");
} else if (IsWindows()) {
extern void(__msabi * __imp_ExitProcess)(uint32_t);
__imp_ExitProcess(exitcode & 0xff);
}
asm("push\t$0\n\t"
"push\t$0\n\t"
"cli\n\t"
"lidt\t(%rsp)");
for (;;) asm("ud2");