2 Copyright © 2015-2018, The AROS Development Team. All rights reserved.
8 #include <proto/exec.h>
10 #define __AROS_KERNEL__
12 #include "exec_intern.h"
16 void IdleTask(struct ExecBase
*SysBase
)
19 struct Task
*thisTask
= FindTask(NULL
);
20 struct IntETask
*taskIntEtask
;
21 int cpunum
= KrnGetCPUNumber();
22 ULONG lastcount
= 0, current
;
24 bug("[IDLE:%03d] %s task started\n", cpunum
, thisTask
->tc_Node
.ln_Name
);
31 // Call sleep function (which enables interrupts, sleeps CPU until interrupt comes and then returns)
32 krnSysCallChangePMState(0x90);
34 // After SLEEP_FUNCTION returned nothing was rescheduled. Reschedule now...
38 if ((taskIntEtask
= GetIntETask(thisTask
)) != NULL
)
40 current
= taskIntEtask
->iet_CpuTime
.tv_sec
;
41 if (current
!= lastcount
)
44 bug("[IDLE:%03d] CPU has idled for %d seconds\n", cpunum
, lastcount
);
49 bug("[IDLE:%03d] Failed to get IntETask\n", cpunum
);