Rename backtrace_kframe -> backtrace_hwtf [2/2]
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 10 Dec 2015 16:01:13 +0000 (11:01 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 10 Dec 2015 16:26:40 +0000 (11:26 -0500)
Everywhere that we were backtracing a kernel HW TF, we can now just
backtrace_hwtf, which can tell the difference between the user and kernel
TFs.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/arch/x86/init.c
kern/arch/x86/trap.c
kern/arch/x86/trap.h
kern/include/kdebug.h

index b724360..fe35276 100644 (file)
@@ -42,7 +42,7 @@ static void irq_console(struct hw_trapframe *hw_tf, void *data)
                                return;
                        }
                        print_trapframe(hw_tf);
                                return;
                        }
                        print_trapframe(hw_tf);
-                       backtrace_kframe(hw_tf);
+                       backtrace_hwtf(hw_tf);
                        return;
        }
        /* Do our work in an RKM, instead of interrupt context.  Note the RKM will
                        return;
        }
        /* Do our work in an RKM, instead of interrupt context.  Note the RKM will
index 90e2f42..2cb9e7c 100644 (file)
@@ -263,7 +263,7 @@ static bool __handler_kernel_page_fault(struct hw_trapframe *hw_tf,
                if (try_handle_exception_fixup(hw_tf))
                        return TRUE;
                print_trapframe(hw_tf);
                if (try_handle_exception_fixup(hw_tf))
                        return TRUE;
                print_trapframe(hw_tf);
-               backtrace_kframe(hw_tf);
+               backtrace_hwtf(hw_tf);
                panic("Proc-less Page Fault in the Kernel at %p!", fault_va);
        }
        /* TODO - handle kernel page faults.  This is dangerous, since we might be
                panic("Proc-less Page Fault in the Kernel at %p!", fault_va);
        }
        /* TODO - handle kernel page faults.  This is dangerous, since we might be
@@ -289,7 +289,7 @@ static bool __handler_kernel_page_fault(struct hw_trapframe *hw_tf,
                if (try_handle_exception_fixup(hw_tf))
                        return TRUE;
                print_trapframe(hw_tf);
                if (try_handle_exception_fixup(hw_tf))
                        return TRUE;
                print_trapframe(hw_tf);
-               backtrace_kframe(hw_tf);
+               backtrace_hwtf(hw_tf);
                /* Turn this on to help debug bad function pointers */
                printd("rsp %p\n\t 0(rsp): %p\n\t 8(rsp): %p\n\t 16(rsp): %p\n"
                       "\t24(rsp): %p\n", hw_tf->tf_rsp,
                /* Turn this on to help debug bad function pointers */
                printd("rsp %p\n\t 0(rsp): %p\n\t 8(rsp): %p\n\t 16(rsp): %p\n"
                       "\t24(rsp): %p\n", hw_tf->tf_rsp,
@@ -338,7 +338,7 @@ static void trap_dispatch(struct hw_trapframe *hw_tf)
                        extern bool mon_verbose_trace;
                        if (mon_verbose_trace) {
                                print_trapframe(hw_tf);
                        extern bool mon_verbose_trace;
                        if (mon_verbose_trace) {
                                print_trapframe(hw_tf);
-                               backtrace_kframe(hw_tf);
+                               backtrace_hwtf(hw_tf);
                        }
                        char *fn_name = get_fn_name(x86_get_ip_hw(hw_tf));
                        printk("Core %d is at %p (%s)\n", core_id(), x86_get_ip_hw(hw_tf),
                        }
                        char *fn_name = get_fn_name(x86_get_ip_hw(hw_tf));
                        printk("Core %d is at %p (%s)\n", core_id(), x86_get_ip_hw(hw_tf),
index 2411ff0..c7107be 100644 (file)
@@ -153,7 +153,6 @@ extern taskstate_t ts;
 int bus_irq_setup(struct irq_handler *irq_h);  /* ioapic.c */
 extern const char *x86_trapname(int trapno);
 extern void sysenter_handler(void);
 int bus_irq_setup(struct irq_handler *irq_h);  /* ioapic.c */
 extern const char *x86_trapname(int trapno);
 extern void sysenter_handler(void);
-void backtrace_kframe(struct hw_trapframe *hw_tf);
 
 /* Defined and set up in in arch/init.c, used for XMM initialization */
 extern struct ancillary_state x86_default_fpu;
 
 /* Defined and set up in in arch/init.c, used for XMM initialization */
 extern struct ancillary_state x86_default_fpu;
index 28a852b..0a11754 100644 (file)
@@ -45,9 +45,6 @@ void print_backtrace_list(uintptr_t *pcs, size_t nr_pcs,
 /* Backtraces the calling kernel context, using pfunc for printing */
 void gen_backtrace(void (*pfunc)(void *, const char *), void *opaque);
 
 /* Backtraces the calling kernel context, using pfunc for printing */
 void gen_backtrace(void (*pfunc)(void *, const char *), void *opaque);
 
-/* Temporary func */
-#define backtrace_kframe backtrace_hwtf
-
 /* Arch dependent, listed here for ease-of-use */
 static inline uintptr_t get_caller_pc(void);
 
 /* Arch dependent, listed here for ease-of-use */
 static inline uintptr_t get_caller_pc(void);