2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #define __KERNEL_NOLIBBASE__
8 #include <aros/multiboot.h>
9 #include <aros/symbolsets.h>
12 #include <exec/lists.h>
13 #include <proto/exec.h>
17 #include "kernel_base.h"
18 #include "kernel_debug.h"
19 #include "kernel_intern.h"
29 static int Platform_Init(struct KernelBase
*LIBBASE
)
31 struct PlatformData
*pdata
;
34 D(bug("[Kernel] Kernel_Init: Post-exec init. KernelBase @ %p\n", LIBBASE
));
36 for (i
= 0; i
< IRQ_COUNT
; i
++)
41 LIBBASE
->kb_Interrupts
[i
].lh_Type
= KBL_XTPIC
;
44 LIBBASE
->kb_Interrupts
[i
].lh_Type
= KBL_APIC
;
47 LIBBASE
->kb_Interrupts
[i
].lh_Type
= KBL_INTERNAL
;
52 D(bug("[Kernel] Kernel_Init: Interupt List initialised\n"));
54 pdata
= AllocMem(sizeof(struct PlatformData
), MEMF_PUBLIC
|MEMF_CLEAR
);
58 LIBBASE
->kb_PlatformData
= pdata
;
63 ADD2INITLIB(Platform_Init
, 10)
65 void PlatformPostInit(void)
67 struct PlatformData
*pdata
= KernelBase
->kb_PlatformData
;
70 ACPICABase
= OpenLibrary("acpica.library", 0);
73 pdata
->kb_APIC
= acpi_APIC_Init();
81 /* No APIC was discovered by ACPI/whatever else. Do the probe. */
82 pdata
->kb_APIC
= core_APIC_Probe();
85 if ((!pdata
->kb_APIC
) || (pdata
->kb_APIC
->flags
& APF_8259
))
87 /* Initialize our XT-PIC */
88 XTPIC_Init(&pdata
->xtpic_mask
);
91 // Now initialize our interrupt controller (XT-PIC or APIC)
96 if (pdata
->kb_APIC
&& (pdata
->kb_APIC
->count
> 1))
104 D(bug("[Kernel] Failed to prepare the environment!\n"));
106 pdata
->kb_APIC
->count
= 1; /* We have only one workinng CPU */
110 // The last thing to do is to start up secondary CPU cores (if any)