riscv : add riscv qemu virt support and fix fs bit error in mstatus
This commit is contained in:
@@ -69,6 +69,7 @@ __tx_free_memory_start:
|
||||
/* VOID _tx_initialize_low_level(VOID)
|
||||
{ */
|
||||
.global _tx_initialize_low_level
|
||||
.weak _tx_initialize_low_level
|
||||
_tx_initialize_low_level:
|
||||
sd sp, _tx_thread_system_stack_ptr, t0 // Save system stack pointer
|
||||
|
||||
|
||||
@@ -149,6 +149,10 @@ _tx_thread_context_restore:
|
||||
LOAD t0, 30*REGBYTES(sp) // Recover mepc
|
||||
csrw mepc, t0 // Setup mepc
|
||||
li t0, 0x1880 // Prepare MPIP
|
||||
#if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double)
|
||||
li t1, 1<<13
|
||||
or t0, t1, t0
|
||||
#endif
|
||||
csrw mstatus, t0 // Enable MPIP
|
||||
|
||||
LOAD x1, 28*REGBYTES(sp) // Recover RA
|
||||
@@ -259,6 +263,10 @@ _tx_thread_no_preempt_restore:
|
||||
LOAD t0, 240(sp) // Recover mepc
|
||||
csrw mepc, t0 // Setup mepc
|
||||
li t0, 0x1880 // Prepare MPIP
|
||||
#if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double)
|
||||
li t1, 1<<13
|
||||
or t0, t1, t0
|
||||
#endif
|
||||
csrw mstatus, t0 // Enable MPIP
|
||||
|
||||
LOAD x1, 28*REGBYTES(sp) // Recover RA
|
||||
|
||||
@@ -201,6 +201,10 @@ _tx_thread_schedule_loop:
|
||||
LOAD t0, 30*REGBYTES(sp) // Recover mepc
|
||||
csrw mepc, t0 // Store mepc
|
||||
li t0, 0x1880 // Prepare MPIP
|
||||
#if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double)
|
||||
li t1, 1<<13
|
||||
or t0, t1, t0
|
||||
#endif
|
||||
csrw mstatus, t0 // Enable MPIP
|
||||
|
||||
LOAD x1, 28*REGBYTES(sp) // Recover RA
|
||||
|
||||
Reference in New Issue
Block a user