Skip to content

Commit 9b69407

Browse files
committed
Add __ulock_wait, __ulock_wait2, and __ulock_wake
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
1 parent 4e4113e commit 9b69407

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

src/arm64/libSystem.s

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ ___svfscanf:
8585
.global ___swbuf
8686
___swbuf:
8787

88+
.global ___ulock_wait
89+
___ulock_wait:
90+
91+
.global ___ulock_wait2
92+
___ulock_wait2:
93+
94+
.global ___ulock_wake
95+
___ulock_wake:
96+
8897
.global ___vsnprintf_chk
8998
___vsnprintf_chk:
9099

src/libSystem.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,8 @@
1919

2020
// These symbols must be declared manually.
2121
extern char **environ;
22+
23+
// These symbols are internal and must therefore be declared manually.
24+
int __ulock_wait(uint32_t operation, void *addr, uint64_t value, uint32_t timeout_us);
25+
int __ulock_wait2(uint32_t operation, void *addr, uint64_t value, uint64_t timeout_ns, uint64_t value2);
26+
int __ulock_wake(uint32_t operation, void *addr, uint64_t wake_value);

src/x86_64/libSystem.s

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ ___svfscanf:
8585
.global ___swbuf
8686
___swbuf:
8787

88+
.global ___ulock_wait
89+
___ulock_wait:
90+
91+
.global ___ulock_wait2
92+
___ulock_wait2:
93+
94+
.global ___ulock_wake
95+
___ulock_wake:
96+
8897
.global ___vsnprintf_chk
8998
___vsnprintf_chk:
9099

0 commit comments

Comments
 (0)