File tree Expand file tree Collapse file tree
OS/ThreadX/ports_smp/nuclei Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,9 +90,11 @@ void PortThreadSwitch(void)
9090 if (coreid == 0 ) {
9191 /* increase the timer interrupt to higher priority to enable interrupt nesting */
9292 ECLIC_SetLevelIRQ (SysTimer_IRQn , KERNEL_INTERRUPT_PRIORITY + 1 );
93+ __RWMB ();
9394 /* swap task stack to interrupt stack to avoid interrupt nesting on task stack */
9495 }
9596 __ASM volatile ("csrrw sp, " STRINGIFY (CSR_MSCRATCHCSWL ) ", sp ");
97+ __RWMB ();
9698 /* mcause must be saved and restore if interrupt nested */
9799 rv_csr_t mcause = __RV_CSR_READ (CSR_MCAUSE );
98100 rv_csr_t msubm = __RV_CSR_READ (CSR_MSUBM );
@@ -111,9 +113,11 @@ void PortThreadSwitch(void)
111113 __RV_CSR_WRITE (CSR_MCAUSE , mcause );
112114 /* swap interrupt stack back to task stack */
113115 __ASM volatile ("csrrw sp, " STRINGIFY (CSR_MSCRATCHCSWL ) ", sp ");
116+ __RWMB ();
114117 /* restore timer interrupt to origin kernel interrupt priority */
115118 if (coreid == 0 ) {
116119 ECLIC_SetLevelIRQ (SysTimer_IRQn , KERNEL_INTERRUPT_PRIORITY );
120+ __RWMB ();
117121 }
118122 }
119123
You can’t perform that action at this time.
0 commit comments