summaryrefslogtreecommitdiff
path: root/libcpu
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2021-08-25 19:10:01 -0400
committerMeco Man <[email protected]>2021-08-25 19:48:15 -0400
commit29828dc94fb55b1224dd0b7a31b388a11fe51870 (patch)
treebd95143a5cca32f3448c7375d1103b549dd7e131 /libcpu
parentbd44c1e5900cae054aebdec1439a11c9258ebaa6 (diff)
[finsh] finsh组件可以选择是否包含内置命令
Diffstat (limited to 'libcpu')
-rw-r--r--libcpu/aarch64/cortex-a53/trap.c4
-rw-r--r--libcpu/aarch64/cortex-a72/trap.c4
-rw-r--r--libcpu/arm/am335x/trap.c8
-rw-r--r--libcpu/arm/arm926/trap.c8
-rw-r--r--libcpu/arm/cortex-a/trap.c12
-rw-r--r--libcpu/arm/cortex-m0/cpuport.c4
-rw-r--r--libcpu/arm/cortex-m23/cpuport.c4
-rw-r--r--libcpu/arm/cortex-m3/cpuport.c6
-rw-r--r--libcpu/arm/cortex-m33/cpuport.c4
-rw-r--r--libcpu/arm/cortex-m4/cpuport.c4
-rw-r--r--libcpu/arm/cortex-m7/cpuport.c4
-rw-r--r--libcpu/arm/cortex-r4/trap.c8
-rw-r--r--libcpu/arm/realview-a8-vmm/trap.c12
-rw-r--r--libcpu/arm/s3c24x0/trap.c8
-rw-r--r--libcpu/arm/zynqmp-r5/trap.c12
-rw-r--r--libcpu/risc-v/k210/interrupt.c4
-rw-r--r--libcpu/risc-v/virt64/interrupt.c5
-rw-r--r--libcpu/rx/cpuport.c4
18 files changed, 65 insertions, 50 deletions
diff --git a/libcpu/aarch64/cortex-a53/trap.c b/libcpu/aarch64/cortex-a53/trap.c
index ca5b6ecd44..4837d445d4 100644
--- a/libcpu/aarch64/cortex-a53/trap.c
+++ b/libcpu/aarch64/cortex-a53/trap.c
@@ -19,7 +19,7 @@
#endif
extern struct rt_thread *rt_current_thread;
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
extern long list_thread(void);
#endif
@@ -55,7 +55,7 @@ void rt_hw_trap_error(struct rt_hw_exp_stack *regs)
{
rt_kprintf("error exception:\n");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
diff --git a/libcpu/aarch64/cortex-a72/trap.c b/libcpu/aarch64/cortex-a72/trap.c
index bd76f7717b..b89a2cca70 100644
--- a/libcpu/aarch64/cortex-a72/trap.c
+++ b/libcpu/aarch64/cortex-a72/trap.c
@@ -14,7 +14,7 @@
#include "armv8.h"
extern struct rt_thread *rt_current_thread;
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
extern long list_thread(void);
#endif
@@ -50,7 +50,7 @@ void rt_hw_trap_error(struct rt_hw_exp_stack *regs)
{
rt_kprintf("error exception:\n");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
diff --git a/libcpu/arm/am335x/trap.c b/libcpu/arm/am335x/trap.c
index 7c73ce93d3..94da0063d0 100644
--- a/libcpu/arm/am335x/trap.c
+++ b/libcpu/arm/am335x/trap.c
@@ -24,7 +24,7 @@
/*@{*/
extern struct rt_thread *rt_current_thread;
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
extern long list_thread(void);
#endif
@@ -67,7 +67,7 @@ void rt_hw_trap_udef(struct rt_hw_register *regs)
rt_kprintf("undefined instruction\n");
rt_kprintf("thread %.*s stack:\n", RT_NAME_MAX, rt_current_thread->name);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -105,7 +105,7 @@ void rt_hw_trap_pabt(struct rt_hw_register *regs)
rt_kprintf("prefetch abort\n");
rt_kprintf("thread %.*s stack:\n", RT_NAME_MAX, rt_current_thread->name);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -133,7 +133,7 @@ void rt_hw_trap_dabt(struct rt_hw_register *regs)
rt_kprintf("data abort\n");
rt_kprintf("thread %.*s stack:\n", RT_NAME_MAX, rt_current_thread->name);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
diff --git a/libcpu/arm/arm926/trap.c b/libcpu/arm/arm926/trap.c
index c364b2addd..5751636259 100644
--- a/libcpu/arm/arm926/trap.c
+++ b/libcpu/arm/arm926/trap.c
@@ -16,7 +16,7 @@
#define INT_FIQ 0x01
extern struct rt_thread *rt_current_thread;
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
extern long list_thread(void);
#endif
@@ -90,7 +90,7 @@ void rt_hw_trap_udef(struct rt_hw_register *regs)
rt_kprintf("undefined instruction\n");
rt_kprintf("thread - %s stack:\n", rt_current_thread->name);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -142,7 +142,7 @@ void rt_hw_trap_pabt(struct rt_hw_register *regs)
rt_kprintf("prefetch abort\n");
rt_kprintf("thread - %s stack:\n", RT_NAME_MAX, rt_current_thread->name);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -170,7 +170,7 @@ void rt_hw_trap_dabt(struct rt_hw_register *regs)
rt_kprintf("data abort\n");
rt_kprintf("thread - %s stack:\n", RT_NAME_MAX, rt_current_thread->name);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
diff --git a/libcpu/arm/cortex-a/trap.c b/libcpu/arm/cortex-a/trap.c
index b3efe31a64..a215374348 100644
--- a/libcpu/arm/cortex-a/trap.c
+++ b/libcpu/arm/cortex-a/trap.c
@@ -15,7 +15,7 @@
#include "armv7.h"
#include "interrupt.h"
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
extern long list_thread(void);
#endif
@@ -89,7 +89,7 @@ void rt_hw_trap_undef(struct rt_hw_exp_stack *regs)
{
rt_kprintf("undefined instruction:\n");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -115,7 +115,7 @@ void rt_hw_trap_swi(struct rt_hw_exp_stack *regs)
{
rt_kprintf("software interrupt:\n");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -140,7 +140,7 @@ void rt_hw_trap_pabt(struct rt_hw_exp_stack *regs)
{
rt_kprintf("prefetch abort:\n");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -165,7 +165,7 @@ void rt_hw_trap_dabt(struct rt_hw_exp_stack *regs)
{
rt_kprintf("data abort:");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -189,7 +189,7 @@ void rt_hw_trap_resv(struct rt_hw_exp_stack *regs)
{
rt_kprintf("reserved trap:\n");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
diff --git a/libcpu/arm/cortex-m0/cpuport.c b/libcpu/arm/cortex-m0/cpuport.c
index 49e15bf339..d6c9be11cf 100644
--- a/libcpu/arm/cortex-m0/cpuport.c
+++ b/libcpu/arm/cortex-m0/cpuport.c
@@ -90,7 +90,9 @@ rt_uint8_t *rt_hw_stack_init(void *tentry,
return stk;
}
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
extern long list_thread(void);
+#endif
extern rt_thread_t rt_current_thread;
/**
* fault exception handling
@@ -108,7 +110,7 @@ void rt_hw_hard_fault_exception(struct exception_stack_frame *contex)
rt_kprintf("hard fault on thread: %s\n", rt_current_thread->name);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
diff --git a/libcpu/arm/cortex-m23/cpuport.c b/libcpu/arm/cortex-m23/cpuport.c
index d8f9b12c2c..4619534c05 100644
--- a/libcpu/arm/cortex-m23/cpuport.c
+++ b/libcpu/arm/cortex-m23/cpuport.c
@@ -91,7 +91,9 @@ rt_uint8_t *rt_hw_stack_init(void *tentry,
return stk;
}
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
extern long list_thread(void);
+#endif
extern rt_thread_t rt_current_thread;
/**
* fault exception handling
@@ -109,7 +111,7 @@ void rt_hw_hard_fault_exception(struct exception_stack_frame *contex)
rt_kprintf("hard fault on thread: %s\n", rt_current_thread->name);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
diff --git a/libcpu/arm/cortex-m3/cpuport.c b/libcpu/arm/cortex-m3/cpuport.c
index 19c33bd7c9..02f84564d5 100644
--- a/libcpu/arm/cortex-m3/cpuport.c
+++ b/libcpu/arm/cortex-m3/cpuport.c
@@ -291,7 +291,9 @@ struct exception_info
*/
void rt_hw_hard_fault_exception(struct exception_info * exception_info)
{
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
extern long list_thread(void);
+#endif
struct stack_frame* context = &exception_info->stack_frame;
if (rt_exception_hook != RT_NULL)
@@ -325,9 +327,9 @@ void rt_hw_hard_fault_exception(struct exception_info * exception_info)
{
rt_kprintf("hard fault on thread: %s\r\n\r\n", rt_thread_self()->name);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
-#endif /* RT_USING_FINSH */
+#endif
}
else
{
diff --git a/libcpu/arm/cortex-m33/cpuport.c b/libcpu/arm/cortex-m33/cpuport.c
index 928689d9c8..8f73985f87 100644
--- a/libcpu/arm/cortex-m33/cpuport.c
+++ b/libcpu/arm/cortex-m33/cpuport.c
@@ -373,7 +373,9 @@ struct exception_info
void rt_hw_hard_fault_exception(struct exception_info *exception_info)
{
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
extern long list_thread(void);
+#endif
struct exception_stack_frame *exception_stack = &exception_info->stack_frame.exception_stack_frame;
struct stack_frame *context = &exception_info->stack_frame;
@@ -407,7 +409,7 @@ void rt_hw_hard_fault_exception(struct exception_info *exception_info)
{
rt_kprintf("hard fault on thread: %s\r\n\r\n", rt_thread_self()->name);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
}
diff --git a/libcpu/arm/cortex-m4/cpuport.c b/libcpu/arm/cortex-m4/cpuport.c
index dbc42d21cf..8dfcbe9cc4 100644
--- a/libcpu/arm/cortex-m4/cpuport.c
+++ b/libcpu/arm/cortex-m4/cpuport.c
@@ -370,7 +370,9 @@ struct exception_info
void rt_hw_hard_fault_exception(struct exception_info *exception_info)
{
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
extern long list_thread(void);
+#endif
struct exception_stack_frame *exception_stack = &exception_info->stack_frame.exception_stack_frame;
struct stack_frame *context = &exception_info->stack_frame;
@@ -404,7 +406,7 @@ void rt_hw_hard_fault_exception(struct exception_info *exception_info)
{
rt_kprintf("hard fault on thread: %s\r\n\r\n", rt_thread_self()->name);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
}
diff --git a/libcpu/arm/cortex-m7/cpuport.c b/libcpu/arm/cortex-m7/cpuport.c
index dbc42d21cf..8dfcbe9cc4 100644
--- a/libcpu/arm/cortex-m7/cpuport.c
+++ b/libcpu/arm/cortex-m7/cpuport.c
@@ -370,7 +370,9 @@ struct exception_info
void rt_hw_hard_fault_exception(struct exception_info *exception_info)
{
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
extern long list_thread(void);
+#endif
struct exception_stack_frame *exception_stack = &exception_info->stack_frame.exception_stack_frame;
struct stack_frame *context = &exception_info->stack_frame;
@@ -404,7 +406,7 @@ void rt_hw_hard_fault_exception(struct exception_info *exception_info)
{
rt_kprintf("hard fault on thread: %s\r\n\r\n", rt_thread_self()->name);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
}
diff --git a/libcpu/arm/cortex-r4/trap.c b/libcpu/arm/cortex-r4/trap.c
index e6c62390c1..9cb24026f0 100644
--- a/libcpu/arm/cortex-r4/trap.c
+++ b/libcpu/arm/cortex-r4/trap.c
@@ -67,7 +67,7 @@ void rt_hw_trap_svc(struct rt_hw_exp_stack *regs)
{
rt_kprintf("software interrupt\n");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -85,7 +85,7 @@ void rt_hw_trap_pabt(struct rt_hw_exp_stack *regs)
{
rt_kprintf("prefetch abort\n");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -103,7 +103,7 @@ void rt_hw_trap_dabt(struct rt_hw_exp_stack *regs)
{
rt_kprintf("Data Abort ");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -120,7 +120,7 @@ void rt_hw_trap_resv(struct rt_hw_exp_stack *regs)
{
rt_kprintf("Reserved trap\n");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
diff --git a/libcpu/arm/realview-a8-vmm/trap.c b/libcpu/arm/realview-a8-vmm/trap.c
index c6ca45aee7..319dba851c 100644
--- a/libcpu/arm/realview-a8-vmm/trap.c
+++ b/libcpu/arm/realview-a8-vmm/trap.c
@@ -21,7 +21,7 @@
#include "gic.h"
extern struct rt_thread *rt_current_thread;
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
extern long list_thread(void);
#endif
@@ -53,7 +53,7 @@ void rt_hw_trap_undef(struct rt_hw_exp_stack *regs)
{
rt_kprintf("undefined instruction:\n");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -72,7 +72,7 @@ void rt_hw_trap_swi(struct rt_hw_exp_stack *regs)
{
rt_kprintf("software interrupt:\n");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -90,7 +90,7 @@ void rt_hw_trap_pabt(struct rt_hw_exp_stack *regs)
{
rt_kprintf("prefetch abort:\n");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -108,7 +108,7 @@ void rt_hw_trap_dabt(struct rt_hw_exp_stack *regs)
{
rt_kprintf("data abort:");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -125,7 +125,7 @@ void rt_hw_trap_resv(struct rt_hw_exp_stack *regs)
{
rt_kprintf("reserved trap:\n");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
diff --git a/libcpu/arm/s3c24x0/trap.c b/libcpu/arm/s3c24x0/trap.c
index f0e8a7097a..29190dce4e 100644
--- a/libcpu/arm/s3c24x0/trap.c
+++ b/libcpu/arm/s3c24x0/trap.c
@@ -22,7 +22,7 @@
/*@{*/
extern struct rt_thread *rt_current_thread;
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
extern long list_thread(void);
#endif
@@ -58,7 +58,7 @@ void rt_hw_trap_udef(struct rt_hw_register *regs)
rt_kprintf("undefined instruction\n");
rt_kprintf("thread - %s stack:\n", rt_current_thread->name);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -96,7 +96,7 @@ void rt_hw_trap_pabt(struct rt_hw_register *regs)
rt_kprintf("prefetch abort\n");
rt_kprintf("thread - %s stack:\n", rt_current_thread->name);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -117,7 +117,7 @@ void rt_hw_trap_dabt(struct rt_hw_register *regs)
rt_kprintf("data abort\n");
rt_kprintf("thread - %s stack:\n", rt_current_thread->name);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
diff --git a/libcpu/arm/zynqmp-r5/trap.c b/libcpu/arm/zynqmp-r5/trap.c
index 64d4cbf5e8..9ec5d1a568 100644
--- a/libcpu/arm/zynqmp-r5/trap.c
+++ b/libcpu/arm/zynqmp-r5/trap.c
@@ -16,7 +16,7 @@
#include "armv7.h"
#include "interrupt.h"
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
extern long list_thread(void);
#endif
@@ -48,7 +48,7 @@ void rt_hw_trap_undef(struct rt_hw_exp_stack *regs)
{
rt_kprintf("undefined instruction:\n");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -67,7 +67,7 @@ void rt_hw_trap_swi(struct rt_hw_exp_stack *regs)
{
rt_kprintf("software interrupt:\n");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -85,7 +85,7 @@ void rt_hw_trap_pabt(struct rt_hw_exp_stack *regs)
{
rt_kprintf("prefetch abort:\n");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -103,7 +103,7 @@ void rt_hw_trap_dabt(struct rt_hw_exp_stack *regs)
{
rt_kprintf("data abort:");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
@@ -120,7 +120,7 @@ void rt_hw_trap_resv(struct rt_hw_exp_stack *regs)
{
rt_kprintf("reserved trap:\n");
rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
rt_hw_cpu_shutdown();
diff --git a/libcpu/risc-v/k210/interrupt.c b/libcpu/risc-v/k210/interrupt.c
index 934acbdbf8..98cbef5401 100644
--- a/libcpu/risc-v/k210/interrupt.c
+++ b/libcpu/risc-v/k210/interrupt.c
@@ -335,7 +335,9 @@ uintptr_t handle_trap(uintptr_t mcause, uintptr_t epc, uintptr_t * sp)
else
{
rt_thread_t tid;
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
extern long list_thread();
+#endif
rt_hw_interrupt_disable();
@@ -387,7 +389,7 @@ uintptr_t handle_trap(uintptr_t mcause, uintptr_t epc, uintptr_t * sp)
print_stack_frame(sp);
rt_kprintf("exception pc => 0x%08x\n", epc);
rt_kprintf("current thread: %.*s\n", RT_NAME_MAX, tid->name);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
while(1);
diff --git a/libcpu/risc-v/virt64/interrupt.c b/libcpu/risc-v/virt64/interrupt.c
index 7916be8f6f..4b109d71ad 100644
--- a/libcpu/risc-v/virt64/interrupt.c
+++ b/libcpu/risc-v/virt64/interrupt.c
@@ -212,8 +212,9 @@ void handle_trap(rt_size_t xcause,rt_size_t xtval,rt_size_t xepc,struct rt_hw_st
else
{
rt_thread_t tid;
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
extern long list_thread();
-
+#endif
rt_hw_interrupt_disable();
rt_kprintf("xcause = %08x,xtval = %08x,xepc = %08x\n", xcause, xtval, xepc);
@@ -265,7 +266,7 @@ void handle_trap(rt_size_t xcause,rt_size_t xtval,rt_size_t xepc,struct rt_hw_st
dump_regs(sp);
rt_kprintf("exception pc => 0x%08x\n", xepc);
rt_kprintf("current thread: %.*s\n", RT_NAME_MAX, tid->name);
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
while(1);
diff --git a/libcpu/rx/cpuport.c b/libcpu/rx/cpuport.c
index 00f9e26ba9..9f737a50e7 100644
--- a/libcpu/rx/cpuport.c
+++ b/libcpu/rx/cpuport.c
@@ -94,7 +94,7 @@ rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter,
return(rt_uint8_t *)stack_frame;
}
-#ifdef RT_USING_FINSH
+#if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
extern void list_thread(void);
#endif
extern rt_thread_t rt_current_thread;
@@ -130,7 +130,7 @@ void rt_hw_hard_fault_exception(struct stack_frame* exception_contex)
rt_kprintf("acclo: 0x%08x\n", exception_contex->ACCLO);
}
rt_kprintf("hard fault on thread: %s\n", rt_current_thread->name);
- #ifdef RT_USING_FINSH
+ #if defined(RT_USING_FINSH) && defined(FINSH_USING_BUILT_IN_COMMANDS)
list_thread();
#endif
while (1);