20 lines
519 B
C++
20 lines
519 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;
|
|
}
|
|
}
|