[go: nahoru, domu]

Skip to content

Commit

Permalink
turn default stack size into a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
PauloMigAlmeida committed Dec 18, 2021
1 parent 1670c3b commit 6ff0623
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/kernel/mm/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define ELF_TEXT_OFFSET 0x1000
#define PAGE_SIZE 0x1000
#define PAGEFRAME_SIZE 0x1000
#define STACK_SIZE PAGE_SIZE * 2

/* Virtual Memory Mapping -> More at: /include/boot/global/mem.asm */
#define K_VIRT_START_ADDR 0xffff800000000000
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static void print_mem_alloc(char *desc, mem_map_region_t *region) {
static void reserve_kernel_sections(void) {
/* reserve memory area to hold kernel stack which is going to be 2x 4Kb PAGES (same as Linux) */
mem_map_region_t kern_stack = mem_alloc_region(
pa((uint64_t) &kernel_virt_start_addr) - ELF_TEXT_OFFSET - PAGE_SIZE * 2,
pa((uint64_t) &kernel_virt_start_addr) - ELF_TEXT_OFFSET - STACK_SIZE,
round_up_po2(pa((uint64_t) &kernel_virt_start_addr) - ELF_TEXT_OFFSET, PAGE_SIZE));
print_mem_alloc("K_STACK", &kern_stack);

Expand Down

0 comments on commit 6ff0623

Please sign in to comment.