idle implementation.

This commit is contained in:
NIIBE Yutaka
2013-05-28 11:00:52 +09:00
parent 699344840b
commit 6c1bfe000b
3 changed files with 9 additions and 7 deletions

View File

@@ -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>

View File

@@ -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)

View File

@@ -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__;