Add comments to show access to RUNNING.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka
2021-02-09 13:33:51 +09:00
parent d2df891ba5
commit af3ef1f93d
2 changed files with 6 additions and 6 deletions

View File

@@ -298,7 +298,7 @@ involuntary_context_switch (struct chx_thread *tp_next)
/* Now, r0 points to the thread to be switched. */
/* Put it to *running. */
"ldr r1, =running\n\t"
/* Update running. */
/* Update running: chx_set_running */
"str r0, [r1]\n\t"
/**/
"add r0, #20\n\t"
@@ -568,7 +568,7 @@ svc (void)
/* Now, r0 points to the thread to be switched. */
/* Put it to *running. */
"ldr r1, =running\n\t"
/* Update running. */
/* Update running: chx_set_running */
"str r0, [r1]\n\t"
"cbz r0, 1f\n\t"
/**/

View File

@@ -2,7 +2,7 @@
* chopstx-riscv32.c - Threads and only threads: Arch specific code
* for RISC-V 32 IMAC (Bumblebee core)
*
* Copyright (C) 2019
* Copyright (C) 2019, 2021
* Flying Stone Technology
* Author: NIIBE Yutaka <gniibe@fsij.org>
*
@@ -514,7 +514,7 @@ voluntary_context_switch (struct chx_thread *tp_next)
*/
"# Call the IDLE function, interrupt masked.\n\t"
"mv tp,zero\n\t"
"csrw mscratch,tp\n\t"
"csrw mscratch,tp\n\t" /* chx_set_running */
"la sp,__main_stack_end__\n\t"
"call chx_idle\n"
".L_V_CONTEXT_SWITCH_BEGIN:\n"
@@ -523,7 +523,7 @@ voluntary_context_switch (struct chx_thread *tp_next)
"mv sp,%0\n\t"
RESTORE_CALLEE_SAVE_REGISTERS
/**/
"csrw mscratch,sp\n\t"
"csrw mscratch,sp\n\t" /* chx_set_running */
"lw a0,0(sp)\n\t"
"beqz a0,1f\n"
".L_RETURN_TO_PREEMPTED_THREAD:\n\t"
@@ -667,7 +667,7 @@ chx_handle_intr (void)
"mv sp,%0\n\t"
RESTORE_CALLEE_SAVE_REGISTERS
/**/
"csrw mscratch,sp\n\t"
"csrw mscratch,sp\n\t" /* chx_set_running */
"lw a0,0(sp)\n\t"
"bnez a0,.L_RETURN_TO_PREEMPTED_THREAD\n\t"
/**/