···1717 return -ENOSYS;
1818}
19192020+VISIBLE
2021int __linux_syscall(int nr, long a1, long a2, long a3, long a4, long a5, long a6)
2122{
2223 return linux_syscall(a1, a2, a3, a4, a5, a6, nr);
+17
src/kernel/libsyscall/os/tsd.h
···5252#include <arm/arch.h>
5353#endif
54545555+#ifdef DARLING
5656+#include <darling/emulation/linux-syscalls.h>
5757+#endif
5858+5559extern void _thread_set_tsd_base(void *tsd_base);
56605761__attribute__((always_inline))
5862static __inline__ unsigned int
5963_os_cpu_number(void)
6064{
6565+#ifdef DARLING
6666+ extern int __linux_syscall(int nr, ...);
6767+6868+ unsigned int cpu_num = 0;
6969+ int status = __linux_syscall(__NR_getcpu, &cpu_num, 0, 0, 0, 0, 0);
7070+ // should we even check? i don't think it's possible for it to fail with these arguments
7171+ if (status < 0) {
7272+ return 0; // i guess?
7373+ }
7474+7575+ return cpu_num;
7676+#else // !DARLING
6177#if defined(__arm__)
6278 uintptr_t p;
6379 __asm__("mrc p15, 0, %[p], c13, c0, 3" : [p] "=&r" (p));
···7389#else
7490#error _os_cpu_number not implemented on this architecture
7591#endif
9292+#endif // !DARLING
7693}
77947895#if defined(__i386__) || defined(__x86_64__)