diff options
| author | Wayne Lin <[email protected]> | 2022-01-25 18:53:52 +0800 |
|---|---|---|
| committer | Wayne Lin <[email protected]> | 2022-01-25 18:53:52 +0800 |
| commit | c95c296e9915a38a666ae1a2575c2a4d0ba1d376 (patch) | |
| tree | c6e5a1ffe4ceb997e853ba0c3daffc9dc60c8b79 /libcpu/mips | |
| parent | f7ba146a01fcf23a2b06a141d1b1a56cb27b878c (diff) | |
| parent | 32a5668593c578b85560338c29d76f3a252c8dbc (diff) | |
Merge branch 'master' of https://github.com/RT-Thread/rt-thread into nuvoton
# Conflicts:
# bsp/gd32/gd32107c-eval/rtconfig.h
Diffstat (limited to 'libcpu/mips')
| -rw-r--r-- | libcpu/mips/common/context_gcc.S | 4 | ||||
| -rw-r--r-- | libcpu/mips/common/entry_gcc.S | 32 | ||||
| -rw-r--r-- | libcpu/mips/common/exception_gcc.S | 34 | ||||
| -rw-r--r-- | libcpu/mips/gs232/cache_gcc.S | 172 | ||||
| -rw-r--r-- | libcpu/mips/gs232/cpuinit_gcc.S | 6 | ||||
| -rw-r--r-- | libcpu/mips/pic32/context_gcc.S | 22 |
6 files changed, 135 insertions, 135 deletions
diff --git a/libcpu/mips/common/context_gcc.S b/libcpu/mips/common/context_gcc.S index 3fdbe374c9..af0339276e 100644 --- a/libcpu/mips/common/context_gcc.S +++ b/libcpu/mips/common/context_gcc.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2022, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -84,7 +84,7 @@ mips_irq_handle: jal rt_interrupt_enter nop /* Get Old SP from k0 as paremeter in a0 */ - move a0, k0 + move a0, k0 jal rt_general_exc_dispatch nop jal rt_interrupt_leave diff --git a/libcpu/mips/common/entry_gcc.S b/libcpu/mips/common/entry_gcc.S index d1a0704809..287e895868 100644 --- a/libcpu/mips/common/entry_gcc.S +++ b/libcpu/mips/common/entry_gcc.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2022, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -28,37 +28,37 @@ _rtthread_entry: .globl _start _start: #endif - PTR_LA ra, _rtthread_entry + PTR_LA ra, _rtthread_entry /* disable interrupt */ - MTC0 zero, CP0_CAUSE - MTC0 zero, CP0_STATUS # Set CPU to disable interrupt. + MTC0 zero, CP0_CAUSE + MTC0 zero, CP0_STATUS # Set CPU to disable interrupt. ehb #ifdef ARCH_MIPS64 - dli t0, ST0_KX - MTC0 t0, CP0_STATUS + dli t0, ST0_KX + MTC0 t0, CP0_STATUS #endif /* setup stack pointer */ - PTR_LA sp, _system_stack - PTR_LA gp, _gp + PTR_LA sp, _system_stack + PTR_LA gp, _gp - bal rt_cpu_early_init + bal rt_cpu_early_init nop /* clear bss */ - PTR_LA t0, __bss_start - PTR_LA t1, __bss_end + PTR_LA t0, __bss_start + PTR_LA t1, __bss_end _clr_bss_loop: - sw zero, 0(t0) - bne t1, t0, _clr_bss_loop - addu t0, 4 + sw zero, 0(t0) + bne t1, t0, _clr_bss_loop + addu t0, 4 /* jump to RT-Thread RTOS */ - jal rtthread_startup + jal rtthread_startup nop /* restart, never die */ - j _start + j _start nop diff --git a/libcpu/mips/common/exception_gcc.S b/libcpu/mips/common/exception_gcc.S index c685928a84..8766529b5b 100644 --- a/libcpu/mips/common/exception_gcc.S +++ b/libcpu/mips/common/exception_gcc.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2022, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -21,50 +21,50 @@ /* 0x0 - TLB refill handler */ .global tlb_refill_exception - .type tlb_refill_exception,@function + .type tlb_refill_exception,@function ebase_start: tlb_refill_exception: - b _general_exception_handler + b _general_exception_handler nop /* 0x080 - XTLB refill handler */ .org ebase_start + 0x080 - b _general_exception_handler + b _general_exception_handler nop /* 0x100 - Cache error handler */ .org ebase_start + 0x100 - j cache_error_handler + j cache_error_handler nop /* 0x180 - Exception/Interrupt handler */ .global general_exception - .type general_exception,@function + .type general_exception,@function .org ebase_start + 0x180 general_exception: - b _general_exception_handler + b _general_exception_handler nop /* 0x200 - Special Exception Interrupt handler (when IV is set in CP0_CAUSE) */ .global irq_exception - .type irq_exception,@function + .type irq_exception,@function .org ebase_start + 0x200 irq_exception: - b _general_exception_handler + b _general_exception_handler nop /* general exception handler */ _general_exception_handler: - .set noreorder - PTR_LA k0, mips_irq_handle - jr k0 + .set noreorder + PTR_LA k0, mips_irq_handle + jr k0 nop - .set reorder + .set reorder /* interrupt handler */ _irq_handler: - .set noreorder - PTR_LA k0, mips_irq_handle - jr k0 + .set noreorder + PTR_LA k0, mips_irq_handle + jr k0 nop - .set reorder + .set reorder diff --git a/libcpu/mips/gs232/cache_gcc.S b/libcpu/mips/gs232/cache_gcc.S index 10a41652a3..c0aa67392c 100644 --- a/libcpu/mips/gs232/cache_gcc.S +++ b/libcpu/mips/gs232/cache_gcc.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2022, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -19,7 +19,7 @@ #include <mips.h> #include "cache.h" - .ent cache_init + .ent cache_init .global cache_init .set noreorder cache_init: @@ -68,67 +68,67 @@ cache_i4way: sllv t6, t4, t6 sllv t5, t4, t5 #if 0 - la t0, memvar - sw t7, 0x0(t0) #ways - sw t5, 0x4(t0) #icache size - sw t6, 0x8(t0) #dcache size + la t0, memvar + sw t7, 0x0(t0) #ways + sw t5, 0x4(t0) #icache size + sw t6, 0x8(t0) #dcache size #endif ####part 3#### - .set mips3 - lui a0, 0x8000 - addu a1, $0, t5 - addu a2, $0, t6 + .set mips3 + lui a0, 0x8000 + addu a1, $0, t5 + addu a2, $0, t6 cache_init_d2way: #a0=0x80000000, a1=icache_size, a2=dcache_size #a3, v0 and v1 used as local registers - mtc0 $0, CP0_TAGHI - addu v0, $0, a0 - addu v1, a0, a2 -1: slt a3, v0, v1 - beq a3, $0, 1f + mtc0 $0, CP0_TAGHI + addu v0, $0, a0 + addu v1, a0, a2 +1: slt a3, v0, v1 + beq a3, $0, 1f nop - mtc0 $0, CP0_TAGLO - beq t7, 1, 4f - cache Index_Store_Tag_D, 0x0(v0) # 1 way - beq t7, 2 ,4f - cache Index_Store_Tag_D, 0x1(v0) # 2 way - cache Index_Store_Tag_D, 0x2(v0) # 4 way - cache Index_Store_Tag_D, 0x3(v0) -4: beq $0, $0, 1b - addiu v0, v0, 0x20 + mtc0 $0, CP0_TAGLO + beq t7, 1, 4f + cache Index_Store_Tag_D, 0x0(v0) # 1 way + beq t7, 2 ,4f + cache Index_Store_Tag_D, 0x1(v0) # 2 way + cache Index_Store_Tag_D, 0x2(v0) # 4 way + cache Index_Store_Tag_D, 0x3(v0) +4: beq $0, $0, 1b + addiu v0, v0, 0x20 1: cache_flush_i2way: - addu v0, $0, a0 - addu v1, a0, a1 -1: slt a3, v0, v1 - beq a3, $0, 1f + addu v0, $0, a0 + addu v1, a0, a1 +1: slt a3, v0, v1 + beq a3, $0, 1f nop - beq t3, 1, 4f - cache Index_Invalidate_I, 0x0(v0) # 1 way - beq t3, 2, 4f - cache Index_Invalidate_I, 0x1(v0) # 2 way - cache Index_Invalidate_I, 0x2(v0) - cache Index_Invalidate_I, 0x3(v0) # 4 way -4: beq $0, $0, 1b - addiu v0, v0, 0x20 + beq t3, 1, 4f + cache Index_Invalidate_I, 0x0(v0) # 1 way + beq t3, 2, 4f + cache Index_Invalidate_I, 0x1(v0) # 2 way + cache Index_Invalidate_I, 0x2(v0) + cache Index_Invalidate_I, 0x3(v0) # 4 way +4: beq $0, $0, 1b + addiu v0, v0, 0x20 1: cache_flush_d2way: - addu v0, $0, a0 - addu v1, a0, a2 -1: slt a3, v0, v1 - beq a3, $0, 1f + addu v0, $0, a0 + addu v1, a0, a2 +1: slt a3, v0, v1 + beq a3, $0, 1f nop - beq t7, 1, 4f - cache Index_Writeback_Inv_D, 0x0(v0) #1 way - beq t7, 2, 4f - cache Index_Writeback_Inv_D, 0x1(v0) # 2 way - cache Index_Writeback_Inv_D, 0x2(v0) - cache Index_Writeback_Inv_D, 0x3(v0) # 4 way -4: beq $0, $0, 1b - addiu v0, v0, 0x20 + beq t7, 1, 4f + cache Index_Writeback_Inv_D, 0x0(v0) #1 way + beq t7, 2, 4f + cache Index_Writeback_Inv_D, 0x1(v0) # 2 way + cache Index_Writeback_Inv_D, 0x2(v0) + cache Index_Writeback_Inv_D, 0x3(v0) # 4 way +4: beq $0, $0, 1b + addiu v0, v0, 0x20 1: cache_init_finish: - jr t1 + jr t1 nop .set reorder .end cache_init @@ -139,80 +139,80 @@ cache_init_finish: LEAF(enable_cpu_cache) .set noreorder - mfc0 t0, CP0_CONFIG + mfc0 t0, CP0_CONFIG nop - and t0, ~0x03 - or t0, 0x03 - mtc0 t0, CP0_CONFIG + and t0, ~0x03 + or t0, 0x03 + mtc0 t0, CP0_CONFIG nop .set reorder - j ra + j ra END (enable_cpu_cache) - + ########################### # disable CPU cache # ########################### LEAF(disable_cpu_cache) .set noreorder - mfc0 t0, CP0_CONFIG + mfc0 t0, CP0_CONFIG nop - and t0, ~0x03 - or t0, 0x2 - mtc0 t0, CP0_CONFIG + and t0, ~0x03 + or t0, 0x2 + mtc0 t0, CP0_CONFIG nop .set reorder - j ra + j ra END (disable_cpu_cache) /**********************************/ -/* Invalidate Instruction Cache */ +/* Invalidate Instruction Cache */ /**********************************/ LEAF(Clear_TagLo) - .set noreorder - mtc0 zero, CP0_TAGLO + .set noreorder + mtc0 zero, CP0_TAGLO nop - .set reorder - j ra + .set reorder + j ra END(Clear_TagLo) .set mips3 /**********************************/ -/* Invalidate Instruction Cache */ +/* Invalidate Instruction Cache */ /**********************************/ LEAF(Invalidate_Icache_Ls1c) - .set noreorder - cache Index_Invalidate_I,0(a0) - cache Index_Invalidate_I,1(a0) - cache Index_Invalidate_I,2(a0) - cache Index_Invalidate_I,3(a0) - .set reorder - j ra + .set noreorder + cache Index_Invalidate_I,0(a0) + cache Index_Invalidate_I,1(a0) + cache Index_Invalidate_I,2(a0) + cache Index_Invalidate_I,3(a0) + .set reorder + j ra END(Invalidate_Icache_Ls1c) /**********************************/ -/* Invalidate Data Cache */ +/* Invalidate Data Cache */ /**********************************/ LEAF(Invalidate_Dcache_ClearTag_Ls1c) - .set noreorder - cache Index_Store_Tag_D, 0(a0) # BDSLOT: clear tag - cache Index_Store_Tag_D, 1(a0) # BDSLOT: clear tag - .set reorder - j ra + .set noreorder + cache Index_Store_Tag_D, 0(a0) # BDSLOT: clear tag + cache Index_Store_Tag_D, 1(a0) # BDSLOT: clear tag + .set reorder + j ra END(Invalidate_Dcache_ClearTag_Ls1c) LEAF(Invalidate_Dcache_Fill_Ls1c) - .set noreorder - cache Index_Writeback_Inv_D, 0(a0) # BDSLOT: clear tag - cache Index_Writeback_Inv_D, 1(a0) # BDSLOT: clear tag - .set reorder - j ra + .set noreorder + cache Index_Writeback_Inv_D, 0(a0) # BDSLOT: clear tag + cache Index_Writeback_Inv_D, 1(a0) # BDSLOT: clear tag + .set reorder + j ra END(Invalidate_Dcache_Fill_Ls1c) LEAF(Writeback_Invalidate_Dcache) .set noreorder - cache Hit_Writeback_Inv_D, (a0) + cache Hit_Writeback_Inv_D, (a0) .set reorder - j ra + j ra END(Writeback_Invalidate_Dcache) .set mips0 diff --git a/libcpu/mips/gs232/cpuinit_gcc.S b/libcpu/mips/gs232/cpuinit_gcc.S index 3379d7dae4..ba665fe0b5 100644 --- a/libcpu/mips/gs232/cpuinit_gcc.S +++ b/libcpu/mips/gs232/cpuinit_gcc.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2022, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -19,5 +19,5 @@ .globl rt_cpu_early_init rt_cpu_early_init: - jr ra - nop
\ No newline at end of file + jr ra + nop diff --git a/libcpu/mips/pic32/context_gcc.S b/libcpu/mips/pic32/context_gcc.S index bd46dffdc7..5c6f20af6e 100644 --- a/libcpu/mips/pic32/context_gcc.S +++ b/libcpu/mips/pic32/context_gcc.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2022, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -18,7 +18,7 @@ #include "../common/stackframe.h" .section ".text", "ax" - .set noat + .set noat .set noreorder /* @@ -92,7 +92,7 @@ _reswitch: mfc0 t0, CP0_CAUSE /* t0 = Cause */ ori t0, t0, (1<<8) /* t0 |= (1<<8) */ mtc0 t0, CP0_CAUSE /* cause = t0 */ - addiu t1, zero, -257 /* t1 = ~(1<<8) */ + addiu t1, zero, -257 /* t1 = ~(1<<8) */ and t0, t0, t1 /* t0 &= t1 */ mtc0 t0, CP0_CAUSE /* cause = t0 */ jr ra @@ -103,17 +103,17 @@ _reswitch: */ .section ".text", "ax" .set noreorder - .set noat - .ent CoreSW0Handler + .set noat + .ent CoreSW0Handler - .globl CoreSW0Handler + .globl CoreSW0Handler CoreSW0Handler: SAVE_ALL - /* mCS0ClearIntFlag(); */ - la t0, IFS0CLR /* t0 = IFS0CLR */ - addiu t1,zero,0x02 /* t1 = (1<<2) */ - sw t1, 0(t0) /* IFS0CLR = t1 */ + /* mCS0ClearIntFlag(); */ + la t0, IFS0CLR /* t0 = IFS0CLR */ + addiu t1,zero,0x02 /* t1 = (1<<2) */ + sw t1, 0(t0) /* IFS0CLR = t1 */ la k0, rt_thread_switch_interrupt_flag sw zero, 0(k0) /* clear flag */ @@ -133,4 +133,4 @@ CoreSW0Handler: RESTORE_ALL_AND_RET - .end CoreSW0Handler + .end CoreSW0Handler |
