mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-01 16:58:30 +00:00
Make considerably more progress on AARCH64
- Utilities like pledge.com now build - kprintf() will no longer balk at 48-bit addresses - There's a new aarch64-dbg build mode that should work - gc() and defer() are mostly pacified; avoid using them on aarch64 - THIRD_PART_STB now has Arm Neon intrinsics for fast image handling
This commit is contained in:
parent
1bfb3aab1b
commit
fd34ef732d
91 changed files with 1288 additions and 1192 deletions
|
@ -48,6 +48,7 @@
|
|||
#include "libc/runtime/internal.h"
|
||||
#include "libc/runtime/memtrack.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/runtime/stack.h"
|
||||
#include "libc/runtime/symbols.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/str/tab.internal.h"
|
||||
|
@ -173,12 +174,16 @@ privileged bool kisdangerous(const void *p) {
|
|||
int frame;
|
||||
if (kisimagepointer(p)) return false;
|
||||
if (kiskernelpointer(p)) return false;
|
||||
if (IsOldStack(p)) return false;
|
||||
if (IsLegalPointer(p)) {
|
||||
frame = (intptr_t)p >> 16;
|
||||
frame = (uintptr_t)p >> 16;
|
||||
if (IsStackFrame(frame)) return false;
|
||||
if (IsOldStackFrame(frame)) return false;
|
||||
if (kismapped(frame)) return false;
|
||||
}
|
||||
if (GetStackAddr() + GUARDSIZE <= (uintptr_t)p &&
|
||||
(uintptr_t)p < GetStackAddr() + GetStackSize()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -219,12 +224,12 @@ privileged static void klog(const char *b, size_t n) {
|
|||
register long r0 asm("x0") = (long)2;
|
||||
register long r1 asm("x1") = (long)b;
|
||||
register long r2 asm("x2") = (long)n;
|
||||
register long r8 asm("x8") = (long)__NR_write;
|
||||
register long res_x0 asm("x0");
|
||||
asm volatile("mov\tx8,%1\n\t"
|
||||
"svc\t0"
|
||||
asm volatile("svc\t0"
|
||||
: "=r"(res_x0)
|
||||
: "i"(64), "r"(r0), "r"(r1), "r"(r2)
|
||||
: "x8", "memory");
|
||||
: "r"(r0), "r"(r1), "r"(r2), "r"(r8)
|
||||
: "memory");
|
||||
#else
|
||||
#error "unsupported architecture"
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue