29 lines
651 B
C
29 lines
651 B
C
// SPDX-License-Identifier: MIT
|
|
|
|
#include <zinnia/thread.h>
|
|
#include <kernel/vdso.h>
|
|
|
|
zn_status_t zn_thread_create(
|
|
zn_handle_t ns,
|
|
const char* name,
|
|
size_t name_len,
|
|
enum zn_thread_flags flags,
|
|
zn_handle_t* out
|
|
) {
|
|
return zn_syscall5(ns, name, name_len, flags, out, ZN_SYSCALL_THREAD_CREATE);
|
|
}
|
|
|
|
VDSO_SYMBOL(zn_thread_create);
|
|
|
|
zn_status_t zn_thread_start(zn_handle_t thread, uintptr_t ip, uintptr_t sp, uintptr_t arg) {
|
|
return zn_syscall4(thread, ip, sp, arg, ZN_SYSCALL_THREAD_START);
|
|
}
|
|
|
|
VDSO_SYMBOL(zn_thread_start);
|
|
|
|
void zn_thread_exit(void) {
|
|
zn_syscall0(ZN_SYSCALL_THREAD_EXIT);
|
|
}
|
|
|
|
VDSO_SYMBOL(zn_thread_exit);
|