hos/kernel/mm/stack.cc
josh 24485b8143 fixed line endings on text files
git-svn-id: svn://anubis/hos/trunk@93 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-25 16:04:08 +00:00

20 lines
500 B
C++

#include "stack.h"
#include "mm.h"
#include "hos_defines.h"
void stack_bootstrap()
{
/*
* running from our temporary stack while segmentation is enabled,
* set up the "permanent" stack for use while paging
*/
u32_t stack_page_virt = KERNEL_STACK_TOP - PAGE_SIZE;
for (int i = 0; i < STACK_INITIAL_SIZE; i++)
{
u32_t stack_page_phys = mm_page_alloc();
mm_early_map(stack_page_virt, stack_page_phys, 0, 1);
stack_page_virt -= PAGE_SIZE;
}
}