diff options
| author | xqyjlj <[email protected]> | 2023-10-25 20:31:25 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-10-25 20:31:25 +0800 |
| commit | 3283f54c7a0444b2e51ec79a4da57e7871528f05 (patch) | |
| tree | e4bcd748ad2362f16d0dea5c5da62922de466999 /libcpu/aarch64/common/interrupt.c | |
| parent | 91fc52df3635d5dda8285616420f08efa79cea04 (diff) | |
🎈 perf: perf rt_hw_interrupt_disable/enable (#8042)
Signed-off-by: Shell <[email protected]>
Co-authored-by: Shell <[email protected]>
Diffstat (limited to 'libcpu/aarch64/common/interrupt.c')
| -rw-r--r-- | libcpu/aarch64/common/interrupt.c | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/libcpu/aarch64/common/interrupt.c b/libcpu/aarch64/common/interrupt.c index 7a93bfb250..8a5ed7bdd9 100644 --- a/libcpu/aarch64/common/interrupt.c +++ b/libcpu/aarch64/common/interrupt.c @@ -38,7 +38,7 @@ extern void *system_vectors; #ifdef RT_USING_SMP #define rt_interrupt_nest rt_cpu_self()->irq_nest #else -extern volatile rt_uint8_t rt_interrupt_nest; +extern volatile rt_atomic_t rt_interrupt_nest; #endif #ifdef SOC_BCM283x @@ -85,7 +85,7 @@ void rt_hw_interrupt_init(void) } /* init interrupt nest, and context in thread sp */ - rt_interrupt_nest = 0; + rt_atomic_store(&rt_interrupt_nest, 0); rt_interrupt_from_thread = 0; rt_interrupt_to_thread = 0; rt_thread_switch_interrupt_flag = 0; @@ -415,3 +415,48 @@ void rt_hw_ipi_handler_install(int ipi_vector, rt_isr_handler_t ipi_isr_handler) rt_hw_interrupt_install(ipi_vector, ipi_isr_handler, 0, "IPI_HANDLER"); } #endif + +#if defined(FINSH_USING_MSH) && defined(RT_USING_INTERRUPT_INFO) +int list_isr() +{ + int idx; + + rt_kprintf("%-*.*s nr handler param counter ", RT_NAME_MAX, RT_NAME_MAX, "irq"); +#ifdef RT_USING_SMP + for (int i = 0; i < RT_CPUS_NR; i++) + { + rt_kprintf(" cpu%2d ", i); + } +#endif + rt_kprintf("\n"); + for (int i = 0; i < RT_NAME_MAX; i++) + { + rt_kprintf("-"); + } + rt_kprintf(" ---- ------------------ ------------------ ----------------"); +#ifdef RT_USING_SMP + for (int i = 0; i < RT_CPUS_NR; i++) + { + rt_kprintf(" -------"); + } +#endif + rt_kprintf("\n"); + for (idx = 0; idx < MAX_HANDLERS; idx++) + { + if (isr_table[idx].handler != RT_NULL) + { + rt_kprintf("%*.s %4d %p %p %16d", RT_NAME_MAX, isr_table[idx].name, idx, isr_table[idx].handler, + isr_table[idx].param, isr_table[idx].counter); +#ifdef RT_USING_SMP + for (int i = 0; i < RT_CPUS_NR; i++) + rt_kprintf(" %7d", isr_table[idx].cpu_counter[i]); +#endif + rt_kprintf("\n"); + } + } + return 0; +} + +#include "finsh.h" +MSH_CMD_EXPORT(list_isr, list isr) +#endif |
