wip.
[AROS.git] / arch / arm-native / exec / platform_init.c
blobe7d30198656ef84a244622bdca01bca617ae8536
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 TASKTAG_AFFINITY , ~0,
41 TASKTAG_PRI , -127,
42 TASKTAG_PC , IdleTask,
43 TASKTAG_ARG1 , SysBase,
44 TAG_DONE);
46 sysIdleTask->tc_State = TS_WAIT;
48 D(bug("[Exec] PlatformInit: Idle Task @ 0x%p\n", sysIdleTask));
50 return TRUE;
53 ADD2INITLIB(PlatformInit, 0)