sched: add struct and object types for task and thread objects

This commit is contained in:
2023-03-06 11:08:26 +00:00
parent 1a413189ab
commit 902df83654
4 changed files with 77 additions and 1 deletions

31
sched/sched.c Normal file
View File

@@ -0,0 +1,31 @@
#include <socks/object.h>
#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),
};
kern_status_t sched_init(void)
{
kern_status_t status = KERN_OK;
status = object_type_register(&task_type);
if (status != KERN_OK) {
return status;
}
status = object_type_register(&thread_type);
if (status != KERN_OK) {
return status;
}
printk("sched: initialised");
return status;
}