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 <[email protected]>
---
 kern/arch/x86/init.c  | 2 +-
 kern/arch/x86/trap.c  | 6 +++---
 kern/arch/x86/trap.h  | 1 -
 kern/include/kdebug.h | 3 ---
 4 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/kern/arch/x86/init.c b/kern/arch/x86/init.c
index b724360f7333..fe35276262d1 100644
--- a/kern/arch/x86/init.c
+++ b/kern/arch/x86/init.c
@@ -42,7 +42,7 @@ static void irq_console(struct hw_trapframe *hw_tf, void 
*data)
                                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
diff --git a/kern/arch/x86/trap.c b/kern/arch/x86/trap.c
index 90e2f425515f..2cb9e7c576fc 100644
--- a/kern/arch/x86/trap.c
+++ b/kern/arch/x86/trap.c
@@ -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);
-               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
@@ -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);
-               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,
@@ -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);
-                               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),
diff --git a/kern/arch/x86/trap.h b/kern/arch/x86/trap.h
index 2411ff04f696..c7107be044a7 100644
--- a/kern/arch/x86/trap.h
+++ b/kern/arch/x86/trap.h
@@ -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);
-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;
diff --git a/kern/include/kdebug.h b/kern/include/kdebug.h
index 28a852bc6e7e..0a11754a8325 100644
--- a/kern/include/kdebug.h
+++ b/kern/include/kdebug.h
@@ -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);
 
-/* Temporary func */
-#define backtrace_kframe backtrace_hwtf
-
 /* Arch dependent, listed here for ease-of-use */
 static inline uintptr_t get_caller_pc(void);
 
-- 
2.6.0.rc2.230.g3dd15c0

-- 
You received this message because you are subscribed to the Google Groups 
"Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to