diff --git a/arch/x86/traps.c b/arch/x86/traps.c index 5614a51b..f58cb47c 100644 --- a/arch/x86/traps.c +++ b/arch/x86/traps.c @@ -186,15 +186,11 @@ static void dump_flags(const struct cpu_regs *regs) { printk("RFLAGS=0x%016lx\n\n", regs->_ASM_FLAGS); } -static void dump_stack(const struct cpu_regs *regs, int words, int lines) { - unsigned long *sp; - int i; +static void dump_stack(const struct cpu_regs *regs, unsigned words) { + unsigned long *sp = (unsigned long *) regs->_ASM_SP; - sp = (unsigned long *) regs->_ASM_SP; printk("STACK[0x%016p]:", sp); - for (i = 0; i < (words * lines); i++) { - if (i > 0 && (_ul(&sp[i]) % PAGE_SIZE) == 0) - break; + for (unsigned i = 0; i == 0 || (_ul(&sp[i]) % PAGE_SIZE_2M); i++) { if ((i % words) == 0) printk("\n0x%04x: ", i * (sizeof(unsigned long))); printk("%016lx ", sp[i]); @@ -207,7 +203,7 @@ static void dump_regs(const struct cpu_regs *regs) { dump_segment_regs(regs); dump_control_regs(regs); dump_flags(regs); - dump_stack(regs, 4, 16); + dump_stack(regs, 4); } static const char *const exception_names[] = { diff --git a/mm/pmm.c b/mm/pmm.c index dfff3b42..146c05fa 100644 --- a/mm/pmm.c +++ b/mm/pmm.c @@ -180,7 +180,7 @@ static size_t process_memory_range(unsigned index) { /* Add initial 2M frames and align to 1G. */ while (cur % PAGE_SIZE_1G && cur + PAGE_SIZE_2M <= end) - add_frame(&cur, PAGE_ORDER_2M, true); + add_frame(&cur, PAGE_ORDER_2M, false); /* Add all remaining 1G frames. */ while (cur + PAGE_SIZE_1G <= end)