Unifying the Lunaix's Physical Memory Model (#28)
[lunaix-os.git] / lunaix-os / kernel / debug / trace.c
index 2e30b094894d1298706f4d3f829eb7a49f0e0f7e..173b1cd09d0d14b57d60d748f4297b011ff87d12 100644 (file)
@@ -1,4 +1,4 @@
-#include <lunaix/mm/vmm.h>
+#include <lunaix/mm/page.h>
 #include <lunaix/process.h>
 #include <lunaix/spike.h>
 #include <lunaix/syslog.h>
@@ -6,6 +6,7 @@
 
 #include <sys/abi.h>
 #include <sys/mm/mm_defs.h>
+#include <sys/trace.h>
 
 #include <klibc/string.h>
 
@@ -79,7 +80,9 @@ ksym_getstr(struct ksym_entry* sym)
 
 static inline bool valid_fp(ptr_t ptr) {
     ptr_t start = ROUNDUP(current_thread->kstack - KSTACK_SIZE, MEM_PAGE);
-    return start < ptr && ptr < current_thread->kstack;
+
+    return (start < ptr && ptr < current_thread->kstack) 
+           || arch_valid_fp(ptr);
 }
 
 int
@@ -205,4 +208,6 @@ trace_printstack_isr(const isr_param* isrm)
 
         p = p->execp->saved_prev_ctx;
     }
+
+    DEBUG("----- [trace end] -----\n");
 }
\ No newline at end of file