invoke arch specific distfiles targets
[AROS.git] / arch / x86_64-pc / kernel / platform_init.c
blob815afc580244409d23d25eece7f6cf3205564520
1 #define __KERNEL_NOLIBBASE__
3 #include <aros/multiboot.h>
4 #include <aros/symbolsets.h>
5 #include <asm/cpu.h>
6 #include <asm/io.h>
7 #include <exec/lists.h>
8 #include <proto/exec.h>
10 #include <inttypes.h>
12 #include "kernel_base.h"
13 #include "kernel_debug.h"
14 #include "kernel_intern.h"
15 #include "apic.h"
16 #include "xtpic.h"
18 #define D(x) x
19 #define DAPIC(x)
21 /* Post exec init */
23 static int Platform_Init(struct KernelBase *LIBBASE)
25 struct PlatformData *pd;
26 int i;
28 D(bug("[Kernel] Kernel_Init: Post-exec init. KernelBase @ %p\n", LIBBASE));
30 for (i = 0; i < IRQ_COUNT; i++)
32 switch(i)
34 case 0x00 ... 0x0f:
35 LIBBASE->kb_Interrupts[i].lh_Type = KBL_XTPIC;
36 break;
37 case 0xde:
38 LIBBASE->kb_Interrupts[i].lh_Type = KBL_APIC;
39 break;
40 default:
41 LIBBASE->kb_Interrupts[i].lh_Type = KBL_INTERNAL;
42 break;
46 D(bug("[Kernel] Kernel_Init: Interupt List initialised\n"));
48 pd = AllocMem(sizeof(struct PlatformData), MEMF_PUBLIC|MEMF_CLEAR);
49 if (!pd)
50 return FALSE;
52 LIBBASE->kb_PlatformData = pd;
54 return TRUE;
57 ADD2INITLIB(Platform_Init, 10)