sched: add struct and object types for task and thread objects
This commit is contained in:
31
sched/sched.c
Normal file
31
sched/sched.c
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user