forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-16 50a212ec906f7524620675f0c57357691c26c81f
kernel/arch/h8300/kernel/traps.c
....@@ -17,6 +17,7 @@
1717 #include <linux/types.h>
1818 #include <linux/sched.h>
1919 #include <linux/sched/debug.h>
20
+#include <linux/sched/task.h>
2021 #include <linux/mm_types.h>
2122 #include <linux/kernel.h>
2223 #include <linux/errno.h>
....@@ -110,12 +111,12 @@
110111 dump(fp);
111112
112113 spin_unlock_irq(&die_lock);
113
- do_exit(SIGSEGV);
114
+ make_task_dead(SIGSEGV);
114115 }
115116
116117 static int kstack_depth_to_print = 24;
117118
118
-void show_stack(struct task_struct *task, unsigned long *esp)
119
+void show_stack(struct task_struct *task, unsigned long *esp, const char *loglvl)
119120 {
120121 unsigned long *stack, addr;
121122 int i;
....@@ -125,17 +126,17 @@
125126
126127 stack = esp;
127128
128
- pr_info("Stack from %08lx:", (unsigned long)stack);
129
+ printk("%sStack from %08lx:", loglvl, (unsigned long)stack);
129130 for (i = 0; i < kstack_depth_to_print; i++) {
130131 if (((unsigned long)stack & (THREAD_SIZE - 1)) >=
131132 THREAD_SIZE-4)
132133 break;
133134 if (i % 8 == 0)
134
- pr_info(" ");
135
+ printk("%s ", loglvl);
135136 pr_cont(" %08lx", *stack++);
136137 }
137138
138
- pr_info("\nCall Trace:\n");
139
+ printk("%s\nCall Trace:\n", loglvl);
139140 i = 0;
140141 stack = esp;
141142 while (((unsigned long)stack & (THREAD_SIZE - 1)) < THREAD_SIZE-4) {
....@@ -150,10 +151,10 @@
150151 */
151152 if (check_kernel_text(addr)) {
152153 if (i % 4 == 0)
153
- pr_info(" ");
154
+ printk("%s ", loglvl);
154155 pr_cont(" [<%08lx>]", addr);
155156 i++;
156157 }
157158 }
158
- pr_info("\n");
159
+ printk("%s\n", loglvl);
159160 }