Skip to content

Commit

Permalink
Add __ulock_wait, __ulock_wait2, and __ulock_wake
Browse files Browse the repository at this point in the history
This is an internal API, but it's also used in LLVM libc++ so I would
assume the interface should be pretty stable. See:
https://github.com/llvm/llvm-project/blob/release/18.x/libcxx/src/atomic.cpp#L68-L70
  • Loading branch information
aykevl committed Nov 7, 2024
1 parent 4e4113e commit 9b69407
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/arm64/libSystem.s
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ ___svfscanf:
.global ___swbuf
___swbuf:

.global ___ulock_wait
___ulock_wait:

.global ___ulock_wait2
___ulock_wait2:

.global ___ulock_wake
___ulock_wake:

.global ___vsnprintf_chk
___vsnprintf_chk:

Expand Down
5 changes: 5 additions & 0 deletions src/libSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@

// These symbols must be declared manually.
extern char **environ;

// These symbols are internal and must therefore be declared manually.
int __ulock_wait(uint32_t operation, void *addr, uint64_t value, uint32_t timeout_us);
int __ulock_wait2(uint32_t operation, void *addr, uint64_t value, uint64_t timeout_ns, uint64_t value2);
int __ulock_wake(uint32_t operation, void *addr, uint64_t wake_value);
9 changes: 9 additions & 0 deletions src/x86_64/libSystem.s
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ ___svfscanf:
.global ___swbuf
___swbuf:

.global ___ulock_wait
___ulock_wait:

.global ___ulock_wait2
___ulock_wait2:

.global ___ulock_wake
___ulock_wake:

.global ___vsnprintf_chk
___vsnprintf_chk:

Expand Down

0 comments on commit 9b69407

Please sign in to comment.