[Linux kernel] __switch_to (RISC-V)
The following routine performs the context switching: ENTRY(__switch_to) /* Save context into prev->thread */ li a4, TASK_THREAD_RA add a3, a0, a4 add a4, a1, a4 REG_S ra, TASK_THREAD_RA_RA(a3) REG_S sp, TASK_THREAD_SP_RA(a3) REG_S s0, TASK_THREAD_S0_RA(a3) // x8 REG_S s1, TASK_THREAD_S1_RA(a3) // x9 REG_S s2, TASK_THREAD_S2_RA(a3) // x18 REG_S s3, TASK_THREAD_S3_RA(a3) // x19..