1// SPDX-License-Identifier: GPL-3.0-or-later
2
3#pragma once
4
5#include <mos/platform/platform.h>
6
7void kthread_init(void);
8
9/**
10 * @brief Create a kernel-mode thread.
11 *
12 * @param entry The entry point of the thread
13 * @param arg The argument to pass to the thread
14 * @param name The name of the thread
15 * @return thread_t* The created thread
16 */
17thread_t *kthread_create(thread_entry_t entry, void *arg, const char *name);
18
19/**
20 * @brief Create a kernel thread, but do not add it to the scheduler.
21 *
22 * @param entry The entry point of the thread
23 * @param arg The argument to pass to the thread
24 * @param name The name of the thread
25 * @return thread_t* The created thread
26 */
27__nodiscard thread_t *kthread_create_no_sched(thread_entry_t entry, void *arg, const char *name);
28