added STACK_INITIAL_SIZE to control the number of initial stack pages; added BUILD_BUG_ON() macro to catch compile-time errors
git-svn-id: svn://anubis/hos/trunk@88 5b3e749e-e535-0410-8002-a9bb6afbdfca
This commit is contained in:
1 parent
53407d7b59
commit
0c78e21e14
3 files changed
+26
-16
No files matched your search
+7
-2
@@ -9,6 +9,11 @@ void stack_bootstrap()
|
||||
* running from our temporary stack while segmentation is enabled,
|
||||
* set up the "permanent" stack for use while paging
|
||||
*/
|
||||
u32_t first_stack_page_base = mm_early_page_alloc();
|
||||
mm_early_map(KERNEL_STACK_TOP - PAGE_SIZE, first_stack_page_base, 0, 1);
|
||||
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_early_page_alloc();
|
||||
mm_early_map(stack_page_virt, stack_page_phys, 0, 1);
|
||||
stack_page_virt -= PAGE_SIZE;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,8 @@
|
||||
#ifndef STACK_H
|
||||
#define STACK_H
|
||||
|
||||
#define STACK_INITIAL_SIZE 2 /* number of initial stack pages */
|
||||
|
||||
void stack_bootstrap();
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user