sched: add task and thread alloc functions

This commit is contained in:
2023-03-09 19:55:52 +00:00
parent f2b929e52e
commit 3e954b1e13
4 changed files with 161 additions and 19 deletions

View File

@@ -2,26 +2,25 @@
#include <socks/sched.h>
#include <socks/printk.h>
static object_type_t task_type = {
.ob_name = "task",
.ob_size = sizeof(task_t),
};
static object_type_t thread_type = {
.ob_name = "thread",
.ob_size = sizeof(task_thread_t),
};
extern kern_status_t setup_kernel_task(void);
extern kern_status_t task_object_type_init(void);
extern kern_status_t thread_object_type_init(void);
kern_status_t sched_init(void)
{
kern_status_t status = KERN_OK;
status = object_type_register(&task_type);
status = task_object_type_init();
if (status != KERN_OK) {
return status;
}
status = object_type_register(&thread_type);
status = thread_object_type_init();
if (status != KERN_OK) {
return status;
}
status = setup_kernel_task();
if (status != KERN_OK) {
return status;
}