*WARNING*
[AROS.git] / arch / arm-native / exec / platform_init.c
blob3c7ab299100d3d518c4ce3226e53bc94508aed02
1 /*
2 Copyright © 2013, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define DEBUG 0
8 #include <aros/debug.h>
9 #include <aros/cpu.h>
10 #include <aros/kernel.h>
11 #include <aros/symbolsets.h>
12 #include <exec/memory.h>
13 #include <exec/tasks.h>
14 #include <exec/alerts.h>
15 #include <exec/execbase.h>
16 #include <asm/io.h>
17 #include <proto/exec.h>
18 #include <strings.h>
20 /* Linked from kernel.resource,
21 * need to retrieve in a cleaner fashion .. */
22 extern IPTR stack[];
24 extern void IdleTask(struct ExecBase *);
26 struct Task *sysIdleTask = NULL;
28 static int PlatformInit(struct ExecBase *SysBase)
30 D(bug("[Exec] PlatformInit()\n"));
32 struct Task *BootTask = SysBase->ThisTask;
33 D(bug("[Exec] PlatformInit: Boot Task @ 0x%p\n", BootTask));
35 /* for our sanity we will tell exec about the correct stack for the boot task */
36 BootTask->tc_SPLower = stack;
37 BootTask->tc_SPUpper = stack + AROS_STACKSIZE;
39 sysIdleTask = NewCreateTask(TASKTAG_NAME , "System Idle",
40 #if defined(__AROSEXEC_SMP__)
41 TASKTAG_AFFINITY , ~0,
42 #endif
43 TASKTAG_PRI , -127,
44 TASKTAG_PC , IdleTask,
45 TASKTAG_ARG1 , SysBase,
46 TAG_DONE);
48 sysIdleTask->tc_State = TS_WAIT;
50 D(bug("[Exec] PlatformInit: Idle Task @ 0x%p\n", sysIdleTask));
52 return TRUE;
55 ADD2INITLIB(PlatformInit, 0)