summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2013-05-28 15:25:09 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2013-05-28 15:25:09 +0900
commit62d20a323fb38d7788a8093a5a0fba910557647d (patch)
treeccdcb6bc51d08d1686679c3cf70f1ce1c239aea8
parent6c1bfe000b0dff90d2e6e4e107093de1aebf85a8 (diff)
conditionalize wfi use
-rw-r--r--ChangeLog2
-rw-r--r--chopstx.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index bca0c87..77cea14 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,7 +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.
+ (idle): Moved from entry.c and use WFI if USE_WFI_FOR_IDLE.
2013-05-27 Niibe Yutaka <gniibe@fsij.org>
diff --git a/chopstx.c b/chopstx.c
index e2804cd..a624012 100644
--- a/chopstx.c
+++ b/chopstx.c
@@ -292,8 +292,12 @@ chx_ready_enqueue (struct chx_thread *tp)
static void __attribute__((naked, used))
idle (void)
{
+#if defined(USE_WFI_FOR_IDLE)
for (;;)
asm volatile ("wfi" : : : "memory");
+#else
+ for (;;);
+#endif
}