summaryrefslogtreecommitdiff
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
parent21c3f461c56832329a4968103c060ffc22545e96 (diff)
Version 0.03release/0.03
-rw-r--r--ChangeLog7
-rw-r--r--NEWS10
-rw-r--r--README2
-rw-r--r--chopstx.c6
-rw-r--r--doc/chopstx.texi2
5 files changed, 23 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index c94700b..19fea66 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2013-11-08 Niibe Yutaka <gniibe@fsij.org>
+ * Version 0.03.
+ * doc/chopstx.texi (VERSION): 0.03.
+
+ * chopstx.c (preempt): Disable interrupt.
+
+2013-11-08 Niibe Yutaka <gniibe@fsij.org>
+
* Version 0.02.
* doc/chopstx.texi (VERSION): 0.02.
diff --git a/NEWS b/NEWS
index 108a745..3abce0c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,15 @@
NEWS - Noteworthy changes
+* Major changes in Chopstx 0.03
+
+ Released 2013-11-08, by NIIBE Yutaka
+
+** Bug fix of preemption
+In the implementation of preemption, there was a bug which might cause
+not to schedule proper thread. This is because the routine preepmt
+itself might be interrupted. This is now fixed in 0.03.
+
+
* Major changes in Chopstx 0.02
Released 2013-11-08, by NIIBE Yutaka
diff --git a/README b/README
index ea8aa5a..b97ef55 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
Chopstx - Threads and only Threads
- Version 0.02
+ Version 0.03
2013-11-08
Niibe Yutaka
Flying Stone Technology
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)
diff --git a/doc/chopstx.texi b/doc/chopstx.texi
index 0d8303e..e168c74 100644
--- a/doc/chopstx.texi
+++ b/doc/chopstx.texi
@@ -1,7 +1,7 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename chopstx.info
-@set VERSION 0.02
+@set VERSION 0.03
@settitle Chopstx Reference Manual
@c Unify some of the indices.
@syncodeindex tp fn