blob: 3a6e408515baea98734f878181af8e9bde0e8be8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
// Licensed under the Apache License, Version 2.0 (see LICENSE file)
// Official repository: https://github.com/nekernel-org/nekernel
#include <ArchKit/ArchKit.h>
#include <CFKit/Property.h>
#include <FirmwareKit/Handover.h>
#include <HALKit/ARM64/ApplicationProcessor.h>
#include <HALKit/ARM64/Processor.h>
#include <KernelKit/CodeMgr.h>
#include <KernelKit/FileMgr.h>
#include <KernelKit/HardwareThreadScheduler.h>
#include <KernelKit/HeapMgr.h>
#include <KernelKit/PEFCodeMgr.h>
#include <KernelKit/ProcessScheduler.h>
#include <NeKit/Json.h>
#include <NetworkKit/IPC.h>
#include <modules/ACPI/ACPIFactoryInterface.h>
#include <modules/CoreGfx/CoreGfx.h>
#ifndef __NE_MODULAR_KERNEL_COMPONENTS__
EXTERN_C void hal_init_platform(Kernel::HEL::BootInfoHeader* handover_hdr) {
using namespace Kernel;
/************************************************** */
/* INITIALIZE AND VALIDATE HEADER. */
/************************************************** */
kHandoverHeader = handover_hdr;
if (kHandoverHeader->f_Magic != kHandoverMagic &&
kHandoverHeader->f_Version != kHandoverVersion) {
return;
}
#ifdef __NE_ARM64_EFI__
fw_init_efi((EfiSystemTable*) handover_hdr->f_FirmwareCustomTables[1]);
Boot::ExitBootServices(handover_hdr->f_HardwareTables.f_ImageKey,
handover_hdr->f_HardwareTables.f_ImageHandle);
#endif
FB::cg_clear_video();
/************************************** */
/* INITIALIZE BIT MAP. */
/************************************** */
kBitMapCursor = 0UL;
kKernelBitMpSize = kHandoverHeader->f_BitMapSize;
kKernelBitMpStart = reinterpret_cast<Kernel::VoidPtr>(
reinterpret_cast<Kernel::UIntPtr>(kHandoverHeader->f_BitMapStart));
/// @note do initialize the interrupts after it.
Kernel::mp_init_cores();
while (YES);
}
#endif
|