summaryrefslogtreecommitdiff
path: root/chopstx.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2013-11-08 12:37:55 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2013-11-08 12:37:55 +0900
commit51a862e200766d563583b5e5085815fae4db770f (patch)
tree092beb2d47536768ff9582bd679c53a4a3602f89 /chopstx.c
parent21c3f461c56832329a4968103c060ffc22545e96 (diff)
Version 0.03release/0.03
Diffstat (limited to 'chopstx.c')
-rw-r--r--chopstx.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/chopstx.c b/chopstx.c
index 231644c..a255097 100644
--- a/chopstx.c
+++ b/chopstx.c
@@ -431,7 +431,9 @@ preempt (void)
{
register struct chx_thread *tp asm ("r0");
- asm ("ldr r1, =running\n\t"
+ tp = (struct chx_thread *)CPU_EXCEPTION_PRIORITY_INHIBIT_SCHED;
+ asm ("msr BASEPRI, r0\n\t"
+ "ldr r1, =running\n\t"
"ldr r0, [r1]\n\t"
"cbnz r0, 0f\n\t"
/* It's idle which was preempted. Discard saved registers on stack. */
@@ -449,7 +451,7 @@ preempt (void)
"mrs r6, PSP\n\t" /* r13(=SP) in user space. */
"stm r1, {r2, r3, r4, r5, r6}"
: "=r" (tp)
- : /* no input */
+ : "r" (tp)
: "r1", "r2", "r3", "r4", "r5", "r6", "cc", "memory");
if (tp)