Version 0.03

This commit is contained in:
NIIBE Yutaka
2013-11-08 12:37:55 +09:00
parent 21c3f461c5
commit 7ace9bfd52
5 changed files with 23 additions and 4 deletions

View File

@@ -1,3 +1,10 @@
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> 2013-11-08 Niibe Yutaka <gniibe@fsij.org>
* Version 0.02. * Version 0.02.

10
NEWS
View File

@@ -1,5 +1,15 @@
NEWS - Noteworthy changes 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 * Major changes in Chopstx 0.02
Released 2013-11-08, by NIIBE Yutaka Released 2013-11-08, by NIIBE Yutaka

2
README
View File

@@ -1,5 +1,5 @@
Chopstx - Threads and only Threads Chopstx - Threads and only Threads
Version 0.02 Version 0.03
2013-11-08 2013-11-08
Niibe Yutaka Niibe Yutaka
Flying Stone Technology Flying Stone Technology

View File

@@ -431,7 +431,9 @@ preempt (void)
{ {
register struct chx_thread *tp asm ("r0"); 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" "ldr r0, [r1]\n\t"
"cbnz r0, 0f\n\t" "cbnz r0, 0f\n\t"
/* It's idle which was preempted. Discard saved registers on stack. */ /* 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. */ "mrs r6, PSP\n\t" /* r13(=SP) in user space. */
"stm r1, {r2, r3, r4, r5, r6}" "stm r1, {r2, r3, r4, r5, r6}"
: "=r" (tp) : "=r" (tp)
: /* no input */ : "r" (tp)
: "r1", "r2", "r3", "r4", "r5", "r6", "cc", "memory"); : "r1", "r2", "r3", "r4", "r5", "r6", "cc", "memory");
if (tp) if (tp)

View File

@@ -1,7 +1,7 @@
\input texinfo @c -*-texinfo-*- \input texinfo @c -*-texinfo-*-
@c %**start of header @c %**start of header
@setfilename chopstx.info @setfilename chopstx.info
@set VERSION 0.02 @set VERSION 0.03
@settitle Chopstx Reference Manual @settitle Chopstx Reference Manual
@c Unify some of the indices. @c Unify some of the indices.
@syncodeindex tp fn @syncodeindex tp fn