Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor fixes to the stack dump #69

Merged
merged 3 commits into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions arch/x86/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand All @@ -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[] = {
Expand Down
2 changes: 1 addition & 1 deletion mm/pmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,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)
Expand Down