summaryrefslogtreecommitdiff
path: root/entry.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2013-06-19 15:42:06 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2013-06-19 15:42:06 +0900
commitd2819d14dbf70c09ef3b938849445105f11e189d (patch)
tree384abf4beea5be42764ee6c0de9c36847c81ff74 /entry.c
parent21d60dbec0c25bbac948779f3be9d5dc5708389f (diff)
add CHOPSTX_THREAD_SIZE
Diffstat (limited to 'entry.c')
-rw-r--r--entry.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/entry.c b/entry.c
index 56fee96..f5cd26f 100644
--- a/entry.c
+++ b/entry.c
@@ -28,6 +28,7 @@
#include <stdint.h>
#include <stdlib.h>
+#include <chopstx.h>
#ifdef HAVE_SYS_H
#define INLINE __attribute__ ((used))
@@ -246,6 +247,9 @@ static void none (void)
{
}
+#define C_S_SUB(arg0, arg1, arg2) arg0 #arg1 arg2
+#define COMPOSE_STATEMENT(arg0,arg1,arg2) C_S_SUB (arg0, arg1, arg2)
+
/*
* This routine only changes PSP and not MSP.
*/
@@ -276,7 +280,7 @@ void entry (void)
"3:\n\t"
/* Switch to PSP. */
"ldr r0, =__process0_stack_end__\n\t"
- "sub r0, #60\n\t" /* Size of struct chx_thread. */
+ COMPOSE_STATEMENT ("sub r0, #", CHOPSTX_THREAD_SIZE, "\n\t")
"msr PSP, r0\n\t" /* Process (main routine) stack. */
"mov r1, #2\n\t"
"msr CONTROL, r1\n\t"