summaryrefslogtreecommitdiff
path: root/kern/thread.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-09-07 20:59:07 +0200
committerRichard Braun <rbraun@sceen.net>2017-09-07 20:59:07 +0200
commit888853dc07f1cdb9701f3612dea7828cc96b84cc (patch)
treeb255b28e240c2ccc9c43c10b8429766d8548fa53 /kern/thread.c
parent4febbe1c657c026a33bdb16b51a0f317217b8d5a (diff)
Use accessors when referring to global kernel objects
The kernel_map/kernel_pmap/kernel_task/etc... names were reused as they were in the Mach source code. They've been a (mostly harmless) long-standing violation of the coding rules.
Diffstat (limited to 'kern/thread.c')
-rw-r--r--kern/thread.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/kern/thread.c b/kern/thread.c
index 64df1941..f9c22742 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -116,6 +116,7 @@
#include <machine/page.h>
#include <machine/pmap.h>
#include <machine/tcb.h>
+#include <vm/vm_kmem.h>
#include <vm/vm_map.h>
/*
@@ -1693,7 +1694,7 @@ thread_init_booter(unsigned int cpu)
thread_set_user_priority(booter, 0);
thread_reset_real_priority(booter);
memset(booter->tsd, 0, sizeof(booter->tsd));
- booter->task = kernel_task;
+ booter->task = task_get_kernel_task();
snprintf(booter->name, sizeof(booter->name),
THREAD_KERNEL_PREFIX "thread_boot/%u", cpu);
}
@@ -1887,11 +1888,14 @@ thread_alloc_stack(void)
{
__unused struct vm_page *first_page, *last_page;
phys_addr_t first_pa, last_pa;
+ struct pmap *kernel_pmap;
size_t stack_size;
uintptr_t va;
void *mem;
__unused int error;
+ kernel_pmap = pmap_get_kernel_pmap();
+
stack_size = vm_page_round(TCB_STACK_SIZE);
mem = vm_kmem_alloc((PAGE_SIZE * 2) + stack_size);