summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2013-05-28 11:00:52 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2013-05-28 11:00:52 +0900
commit6c1bfe000b0dff90d2e6e4e107093de1aebf85a8 (patch)
treea124fa5796ce02765fd5bf5711013cef97c1de50
parent699344840b7bebfeedccdda79a1144fc576b7ceb (diff)
idle implementation.
-rw-r--r--ChangeLog1
-rw-r--r--chopstx.c8
-rw-r--r--entry.c7
3 files changed, 9 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 199f0a1..bca0c87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
* chopstx.c (chopstx_intr_wait): Rename from chopstx_wait_intr.
(chopstx_usec_wait): Rename from chosptx_usleep.
(chopstx_cancel, chopstx_testcancel): New.
+ (idle): Moved from entry.c and use WFI.
2013-05-27 Niibe Yutaka <gniibe@fsij.org>
diff --git a/chopstx.c b/chopstx.c
index 2ee6f75..e2804cd 100644
--- a/chopstx.c
+++ b/chopstx.c
@@ -289,6 +289,14 @@ chx_ready_enqueue (struct chx_thread *tp)
chx_UNLOCK (&q_ready.lock);
}
+static void __attribute__((naked, used))
+idle (void)
+{
+ for (;;)
+ asm volatile ("wfi" : : : "memory");
+}
+
+
/* Registers on stack (PSP): r0, r1, r2, r3, r12, lr, pc, xpsr */
static void __attribute__ ((naked,used))
sched (void)
diff --git a/entry.c b/entry.c
index da1a993..727bffb 100644
--- a/entry.c
+++ b/entry.c
@@ -294,13 +294,6 @@ void entry (void)
: /* no output */ : /* no input */ : "memory");
}
-void __attribute__((naked, used))
-idle (void)
-{
- /* XXX: use WFI */
- for (;;);
-}
-
typedef void (*handler)(void);
extern uint8_t __main_stack_end__;