diff options
| author | Huang bo <[email protected]> | 2021-12-15 09:17:25 +0800 |
|---|---|---|
| committer | Huang bo <[email protected]> | 2021-12-15 09:17:25 +0800 |
| commit | c37fcb6049de1ba0c39265a261cc07fad78e6cf6 (patch) | |
| tree | c339c17f6006ed9542a18de8f8ca82bd6094ba23 /libcpu | |
| parent | 4a779f5131dea2ebcf95cc275df3ab23850ac6c0 (diff) | |
修改bsp tms320c6678工程,并测试
Diffstat (limited to 'libcpu')
| -rw-r--r-- | libcpu/ti-dsp/c6x/context.asm | 9 | ||||
| -rw-r--r-- | libcpu/ti-dsp/c6x/contextinc.asm | 5 | ||||
| -rw-r--r-- | libcpu/ti-dsp/c6x/interrupt.c | 2 | ||||
| -rw-r--r-- | libcpu/ti-dsp/c6x/intexc.asm | 8 | ||||
| -rw-r--r-- | libcpu/ti-dsp/c6x/stack.c | 4 | ||||
| -rw-r--r-- | libcpu/ti-dsp/c6x/trap.h | 6 |
6 files changed, 13 insertions, 21 deletions
diff --git a/libcpu/ti-dsp/c6x/context.asm b/libcpu/ti-dsp/c6x/context.asm index 2a57e9414d..aa7a138887 100644 --- a/libcpu/ti-dsp/c6x/context.asm +++ b/libcpu/ti-dsp/c6x/context.asm @@ -18,11 +18,6 @@ ;----------------------------------------------------------- DP .set B14 SP .set B15 - -;----------------------------------------------------------- -; extern variable -;----------------------------------------------------------- - .ref rt_system_stack_top ; ;----------------------------------------------------------- ; @@ -165,8 +160,7 @@ rt_hw_context_switch_to: LDDW .D2T2 *++SP[1],B13:B12 ; get PC (B13) and CSR (B12) NOP 2 MV B8,B0 - [B0] B _rt_thread_interrupt_stack - NOP 5 + [B0] BNOP _rt_thread_interrupt_stack, 5 ; ; this maybe do better ; @@ -275,7 +269,6 @@ rt_interrupt_context_restore: NOP 4 CMPEQ 1,A1,A2 [A2] BNOP rt_preempt_context_restore,5 - NOP 5 LDDW .D2T2 *++SP[1],B9:B8 ; get TSR (B9) LDDW .D2T2 *++SP[1],B11:B10 ; get RILC (B11) and ILC (B10) LDDW .D2T2 *++SP[1],B13:B12 ; get PC (B13) and CSR (B12) diff --git a/libcpu/ti-dsp/c6x/contextinc.asm b/libcpu/ti-dsp/c6x/contextinc.asm index d51211ae9e..3bc6afafc6 100644 --- a/libcpu/ti-dsp/c6x/contextinc.asm +++ b/libcpu/ti-dsp/c6x/contextinc.asm @@ -9,6 +9,11 @@ ; ;----------------------------------------------------------- +; extern variable +;----------------------------------------------------------- + .ref rt_system_stack_top + +;----------------------------------------------------------- ; macro definition ;----------------------------------------------------------- SAVE_ALL .macro __rp, __tsr diff --git a/libcpu/ti-dsp/c6x/interrupt.c b/libcpu/ti-dsp/c6x/interrupt.c index 2be2f88313..1f532f6c32 100644 --- a/libcpu/ti-dsp/c6x/interrupt.c +++ b/libcpu/ti-dsp/c6x/interrupt.c @@ -26,7 +26,7 @@ rt_uint32_t rt_thread_switch_interrupt_flag; void rt_hw_interrupt_init(void) { // initial system trap - rt_trap_init(); + //rt_trap_init(); /* init exceptions table */ rt_memset(isr_table, 0x00, sizeof(isr_table)); diff --git a/libcpu/ti-dsp/c6x/intexc.asm b/libcpu/ti-dsp/c6x/intexc.asm index 2490977331..81a77426ec 100644 --- a/libcpu/ti-dsp/c6x/intexc.asm +++ b/libcpu/ti-dsp/c6x/intexc.asm @@ -66,14 +66,6 @@ SP .set B15 ; ;----------------------------------------------------------- -; extern variable -;----------------------------------------------------------- - .ref rt_system_stack_top -; -;----------------------------------------------------------- -; - -;----------------------------------------------------------- ; interrupt macro definition ;----------------------------------------------------------- RT_INTERRUPT_ENTRY .macro diff --git a/libcpu/ti-dsp/c6x/stack.c b/libcpu/ti-dsp/c6x/stack.c index 3fe3377a1c..05e9534538 100644 --- a/libcpu/ti-dsp/c6x/stack.c +++ b/libcpu/ti-dsp/c6x/stack.c @@ -31,8 +31,8 @@ extern rt_uint32_t rt_hw_get_current_dp(void); rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter, rt_uint8_t *stack_addr, void *texit) { - rt_hw_thread_stack_register *thread_context; - rt_uint32_t stk; + rt_hw_thread_stack_register *thread_context = RT_NULL; + rt_uint32_t stk = 0; stack_addr += sizeof(rt_uint32_t); stack_addr = (rt_uint8_t *)RT_ALIGN_DOWN((rt_uint32_t)stack_addr, 8); diff --git a/libcpu/ti-dsp/c6x/trap.h b/libcpu/ti-dsp/c6x/trap.h index 12734df4a7..d895344728 100644 --- a/libcpu/ti-dsp/c6x/trap.h +++ b/libcpu/ti-dsp/c6x/trap.h @@ -90,8 +90,9 @@ extern int __ffs(int val); static inline int fls(int x) { if (!x) + { return 0; - + } return 32 - __fls(x); } @@ -107,8 +108,9 @@ static inline int fls(int x) static inline int ffs(int x) { if (!x) + { return 0; - + } return __ffs(x) + 1; } |
