Replaced old VM *_region() calls with current calls.
KSTACK_SIZE has been renamed to KERNEL_STACK_SIZE. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11073 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2003-2004, Axel Dörfler, [email protected].
|
* Copyright 2003-2005, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Copyright 2001, Travis Geiselbrecht. All rights reserved.
|
* Copyright 2001, Travis Geiselbrecht. All rights reserved.
|
||||||
@@ -163,15 +163,15 @@ arch_int_init(kernel_args *args)
|
|||||||
status_t
|
status_t
|
||||||
arch_int_init_post_vm(kernel_args *args)
|
arch_int_init_post_vm(kernel_args *args)
|
||||||
{
|
{
|
||||||
region_id exception_region;
|
area_id exceptionArea;
|
||||||
void *handlers;
|
void *handlers;
|
||||||
|
|
||||||
// create a region to map the irq vector code into (physical address 0x0)
|
// create a region to map the irq vector code into (physical address 0x0)
|
||||||
handlers = (void *)args->arch_args.exception_handlers.start;
|
handlers = (void *)args->arch_args.exception_handlers.start;
|
||||||
exception_region = vm_create_anonymous_region(vm_get_kernel_aspace_id(), "exception_handlers",
|
exceptionArea = create_area("exception_handlers",
|
||||||
&handlers, B_EXACT_ADDRESS, args->arch_args.exception_handlers.size,
|
&handlers, B_EXACT_ADDRESS, args->arch_args.exception_handlers.size,
|
||||||
B_ALREADY_WIRED, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);
|
B_ALREADY_WIRED, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);
|
||||||
if (exception_region < 0)
|
if (exceptionArea < B_OK)
|
||||||
panic("arch_int_init2: could not create exception handler region\n");
|
panic("arch_int_init2: could not create exception handler region\n");
|
||||||
|
|
||||||
dprintf("exception handlers at %p\n", handlers);
|
dprintf("exception handlers at %p\n", handlers);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2003-2004, Axel Dörfler, [email protected].
|
* Copyright 2003-2005, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Copyright 2001, Travis Geiselbrecht. All rights reserved.
|
* Copyright 2001, Travis Geiselbrecht. All rights reserved.
|
||||||
@@ -10,6 +10,8 @@
|
|||||||
#include <kernel.h>
|
#include <kernel.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <boot/stage2.h>
|
#include <boot/stage2.h>
|
||||||
|
#include <vm_types.h>
|
||||||
|
//#include <arch/vm_translation_map.h>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@@ -42,7 +44,7 @@ status_t
|
|||||||
arch_thread_init_kthread_stack(struct thread *t, int (*start_func)(void), void (*entry_func)(void), void (*exit_func)(void))
|
arch_thread_init_kthread_stack(struct thread *t, int (*start_func)(void), void (*entry_func)(void), void (*exit_func)(void))
|
||||||
{
|
{
|
||||||
addr_t *kstack = (addr_t *)t->kernel_stack_base;
|
addr_t *kstack = (addr_t *)t->kernel_stack_base;
|
||||||
size_t kstack_size = KSTACK_SIZE;
|
size_t kstack_size = KERNEL_STACK_SIZE;
|
||||||
addr_t *kstack_top = kstack + kstack_size / sizeof(addr_t) - 2 * 4;
|
addr_t *kstack_top = kstack + kstack_size / sizeof(addr_t) - 2 * 4;
|
||||||
|
|
||||||
// r13-r31, cr, r2
|
// r13-r31, cr, r2
|
||||||
@@ -88,7 +90,7 @@ arch_thread_context_switch(struct thread *t_from, struct thread *t_to)
|
|||||||
// set the new kernel stack in the EAR register.
|
// set the new kernel stack in the EAR register.
|
||||||
// this is used in the exception handler code to decide what kernel stack to
|
// this is used in the exception handler code to decide what kernel stack to
|
||||||
// switch to if the exception had happened when the processor was in user mode
|
// switch to if the exception had happened when the processor was in user mode
|
||||||
asm("mtear %0" :: "g"(t_to->kernel_stack_base + KSTACK_SIZE - 8));
|
asm("mtear %0" :: "g"(t_to->kernel_stack_base + KERNEL_STACK_SIZE - 8));
|
||||||
|
|
||||||
// switch the asids if we need to
|
// switch the asids if we need to
|
||||||
if (t_to->team->aspace != NULL) {
|
if (t_to->team->aspace != NULL) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2003-2004, Axel Dörfler, [email protected].
|
* Copyright 2003-2005, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Copyright 2001, Travis Geiselbrecht. All rights reserved.
|
* Copyright 2001, Travis Geiselbrecht. All rights reserved.
|
||||||
@@ -448,8 +448,7 @@ status_t
|
|||||||
arch_vm_translation_map_init_post_area(kernel_args *args)
|
arch_vm_translation_map_init_post_area(kernel_args *args)
|
||||||
{
|
{
|
||||||
// create a region to cover the page table
|
// create a region to cover the page table
|
||||||
sPageTableRegion = vm_create_anonymous_region(vm_get_kernel_aspace_id(),
|
sPageTableRegion = create_area("page_table", (void **)&sPageTable, B_EXACT_ADDRESS,
|
||||||
"page_table", (void **)&sPageTable, B_EXACT_ADDRESS,
|
|
||||||
sPageTableSize, B_ALREADY_WIRED, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);
|
sPageTableSize, B_ALREADY_WIRED, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);
|
||||||
|
|
||||||
// ToDo: for now just map 0 - 512MB of physical memory to the iospace region
|
// ToDo: for now just map 0 - 512MB of physical memory to the iospace region
|
||||||
@@ -492,7 +491,7 @@ arch_vm_translation_map_init_post_area(kernel_args *args)
|
|||||||
|
|
||||||
// create a region to cover the iospace
|
// create a region to cover the iospace
|
||||||
void *temp = (void *)IOSPACE_BASE;
|
void *temp = (void *)IOSPACE_BASE;
|
||||||
vm_create_null_region(vm_get_kernel_aspace_id(), "iospace", &temp,
|
vm_create_null_area(vm_get_kernel_aspace_id(), "iospace", &temp,
|
||||||
B_EXACT_ADDRESS, IOSPACE_SIZE);
|
B_EXACT_ADDRESS, IOSPACE_SIZE);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user