revert between 56095 -> 55830 in arch
[AROS.git] / arch / arm-native / exec / exec_idle.c
blob13fd26fc2775169731f72b54c857cce76195e13f
1 /*
2 Copyright � 1995-2015, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define DEBUG 0
8 #include <proto/exec.h>
9 #include "exec_intern.h"
10 #include "kernel_intern.h"
11 #include "kernel_cpu.h"
12 #include "kernel_syscall.h"
14 #include "etask.h"
16 void IdleTask(struct ExecBase *SysBase)
18 #if defined(DEBUG)
19 struct Task *thisTask = FindTask(NULL);
20 int cpunum;
21 register int tmp asm("r0");
22 asm volatile ("swi %[swi_no]" : "=r"(tmp) : [swi_no] "I" (SC_GETCPUNUMBER) : "lr");
23 cpunum = tmp;
24 (void)cpunum;
25 (void)thisTask;
26 #endif
28 D(bug("[IDLE:%02d] %s started up\n", cpunum, thisTask->tc_Node.ln_Name));
30 asm volatile ("swi %[swi_no]" : : [swi_no] "I" (SC_SUPERSTATE) : "lr");
31 asm volatile ("swi %[swi_no]" : : [swi_no] "I" (SC_STI) : "lr");
35 /* forever */
36 D(bug("[IDLE:%02d] CPU has idled for %d seconds..\n", cpunum, GetIntETask(thisTask)->iet_CpuTime.tv_sec));
37 asm volatile("wfi");
38 } while(1);