obj: add header-offset field to object_type
this allows the object header to be placed anywhere within the larger object structure. the object system now also ensures that the object is zero-initialised during allocation.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
static struct object_type task_type = {
|
||||
.ob_name = "task",
|
||||
.ob_size = sizeof(struct task),
|
||||
.ob_header_offset = offsetof(struct task, t_base),
|
||||
};
|
||||
|
||||
static struct task *__kernel_task;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
static struct object_type thread_type = {
|
||||
.ob_name = "thread",
|
||||
.ob_size = sizeof(struct thread),
|
||||
.ob_header_offset = offsetof(struct thread, thr_base),
|
||||
};
|
||||
|
||||
kern_status_t thread_object_type_init(void)
|
||||
|
||||
Reference in New Issue
Block a user