Get POSIX threads working on Apple Silicon

It's now possible to run a working

    ape-m1 o/aarch64/third_party/ggml/llama.com

on Apple M1 hardware running XNU!
This commit is contained in:
Justine Tunney 2023-06-03 18:32:33 -07:00
parent 8fdb31681a
commit b5eab2b0b7
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
3 changed files with 78 additions and 16 deletions

View file

@ -89,7 +89,13 @@ sched_yield:
ret
#elif defined(__aarch64__)
mov x8,#0x7c
mov x0,#0
mov x1,#0
mov x2,#0
mov x3,#0
mov x8,#0x7c // sched_yield() for linux
mov x16,#0x85d // select(0,0,0,0) for xnu
svc 0
ret