2 Copyright © 2013-2015, The AROS Development Team. All rights reserved.
8 #include <aros/kernel.h>
9 #include <aros/symbolsets.h>
10 #include <exec/memory.h>
11 #include <exec/tasks.h>
12 #include <exec/alerts.h>
13 #include <exec/execbase.h>
15 #include <proto/kernel.h>
16 #include <proto/exec.h>
21 #include "kernel_intern.h"
22 #include "kernel_arch.h"
23 #include "kernel_romtags.h"
25 THIS_PROGRAM_HANDLES_SYMBOLSET(ARMPLATFORMS
);
26 DECLARESET(ARMPLATFORMS
);
28 void platform_Init(struct ARM_Implementation
*krnARMImpl
, struct TagItem
*msg
)
30 IPTR (*platprobe
) (struct ARM_Implementation
*, struct TagItem
*);
33 for ( cur
= 1; (void *)(SETNAME(ARMPLATFORMS
))[cur
] != NULL
; cur
++)
35 platprobe
= (void *)(SETNAME(ARMPLATFORMS
))[cur
];
36 if (platprobe(krnARMImpl
, msg
))
38 if (krnARMImpl
->ARMI_LED_Toggle
)
39 krnARMImpl
->ARMI_LED_Toggle(ARM_LED_POWER
, ARM_LED_ON
);
48 void *(*__AllocMem
)();
50 #define ExecAllocMem(bytesize, requirements) \
51 AROS_CALL2(void *, __AllocMem, \
52 AROS_LCA(ULONG, byteSize, D0), \
53 AROS_LCA(ULONG, requirements, D1), \
54 struct ExecBase *, SysBase)
56 AROS_LH2(APTR
, AllocMem
,
57 AROS_LHA(ULONG
, byteSize
, D0
),
58 AROS_LHA(ULONG
, requirements
, D1
),
59 struct ExecBase
*, SysBase
, 33, Kernel
)
63 if (requirements
& MEMF_CHIP
)
65 DALLOCMEM(bug("[Kernel] AllocMem: Ignoring MEMF_CHIP flag\n"));
66 requirements
&= ~MEMF_CHIP
;
68 return ExecAllocMem(bytesize
, requirements
);
73 static int platform_PostInit(struct KernelBase
*KernelBase
)
75 D(bug("[Kernel] platform_PostInit()\n"));
77 D(bug("[Kernel] platform_PostInit: Patching in our AllocMem to ignore MEMF_CHIP..\n"));
79 __AllocMem
= SetFunction((struct Library
*)SysBase
, -33*LIB_VECTSIZE
, AROS_SLIB_ENTRY(AllocMem
, Kernel
, 33));
81 D(bug("[Kernel] platform_PostInit: Performing Post Init..\n"));
83 if (__arm_arosintern
.ARMI_Init
)
84 __arm_arosintern
.ARMI_Init(KernelBase
, SysBase
);
86 D(bug("[Kernel] platform_PostInit: Registering Heartbeat timer..\n"));
88 KrnAddSysTimerHandler(KernelBase
);
90 D(bug("[Kernel] platform_PostInit: Done..\n"));
95 ADD2INITLIB(platform_PostInit
, 10)
97 struct KernelBase
*getKernelBase()
99 return (struct KernelBase
*)KernelBase
;