sched: add root vm-region and handle table to struct task
This commit is contained in:
@@ -81,6 +81,8 @@ struct task {
|
||||
char t_name[TASK_NAME_MAX];
|
||||
|
||||
pmap_t t_pmap;
|
||||
struct vm_region *t_address_space;
|
||||
struct handle_table *t_handles;
|
||||
|
||||
struct btree_node t_tasklist;
|
||||
struct queue_entry t_child_entry;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <mango/object.h>
|
||||
#include <mango/printk.h>
|
||||
#include <mango/sched.h>
|
||||
#include <mango/vm-region.h>
|
||||
|
||||
extern kern_status_t setup_kernel_task(void);
|
||||
extern kern_status_t setup_idle_task(void);
|
||||
|
||||
10
sched/task.c
10
sched/task.c
@@ -1,10 +1,12 @@
|
||||
#include <mango/clock.h>
|
||||
#include <mango/cpu.h>
|
||||
#include <mango/handle.h>
|
||||
#include <mango/libc/stdio.h>
|
||||
#include <mango/locks.h>
|
||||
#include <mango/object.h>
|
||||
#include <mango/printk.h>
|
||||
#include <mango/sched.h>
|
||||
#include <mango/vm-region.h>
|
||||
|
||||
#define TASK_CAST(p) OBJECT_C_CAST(struct task, t_base, &task_type, p)
|
||||
|
||||
@@ -84,6 +86,14 @@ kern_status_t setup_kernel_task(void)
|
||||
__kernel_task->t_state = TASK_RUNNING;
|
||||
__kernel_task->t_pmap = get_kernel_pmap();
|
||||
|
||||
vm_region_create(
|
||||
NULL,
|
||||
"root",
|
||||
VM_KERNEL_BASE,
|
||||
VM_KERNEL_LIMIT - VM_KERNEL_BASE,
|
||||
VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXEC | VM_PROT_SVR,
|
||||
&__kernel_task->t_address_space);
|
||||
|
||||
snprintf(
|
||||
__kernel_task->t_name,
|
||||
sizeof __kernel_task->t_name,
|
||||
|
||||
Reference in New Issue
Block a user