summaryrefslogtreecommitdiff
path: root/firmware/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/thread.c')
-rw-r--r--firmware/thread.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/firmware/thread.c b/firmware/thread.c
index fdef2cdf2b..41160a080a 100644
--- a/firmware/thread.c
+++ b/firmware/thread.c
@@ -750,6 +750,18 @@ static inline void core_sleep(void)
750{ 750{
751 #warning TODO: Implement core_sleep 751 #warning TODO: Implement core_sleep
752} 752}
753#elif CONFIG_CPU == IMX31L
754static inline void core_sleep(void)
755{
756 asm volatile (
757 "mov r0, #0 \n"
758 "mcr p15, 0, r0, c7, c0, 4 \n" /* Wait for interrupt */
759 "mrs r0, cpsr \n" /* Unmask IRQ/FIQ at core level */
760 "bic r0, r0, #0xc0 \n"
761 "msr cpsr_c, r0 \n"
762 : : : "r0"
763 );
764}
753#else 765#else
754static inline void core_sleep(void) 766static inline void core_sleep(void)
755{ 767{
@@ -2542,6 +2554,9 @@ void init_threads(void)
2542 struct thread_entry *thread; 2554 struct thread_entry *thread;
2543 int slot; 2555 int slot;
2544 2556
2557 memset(threads, 0, sizeof(threads));
2558 memset(cores, 0, sizeof(cores));
2559
2545 /* CPU will initialize first and then sleep */ 2560 /* CPU will initialize first and then sleep */
2546 slot = find_empty_thread_slot(); 2561 slot = find_empty_thread_slot();
2547 2562