1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:37:35 +00:00

Kernel: Let aarch64 port call into C++

Put all but the first core into a loop, make room for some stack,
and call init().
This commit is contained in:
Nico Weber 2021-09-06 13:11:16 -04:00 committed by Linus Groh
parent f1d1418256
commit 62bc238ac3
3 changed files with 24 additions and 1 deletions

View file

@ -9,7 +9,18 @@
.global start
.type start, @function
start:
b Lhalt
// Let only core 0 continue, put other cores to sleep.
mrs x13, MPIDR_EL1
and x13, x13, 0xff
cbnz x13, Lhalt
// Let stack start before .text for now.
// 512 kiB (0x8000) of stack are probably not sufficient, especially once we give the other cores some stack too,
// but for now it's ok.
ldr x14, =start
mov sp, x14
b init
Lhalt:
wfi

View file

@ -0,0 +1,11 @@
/*
* Copyright (c) 2021, Nico Weber <thakis@chromium.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
extern "C" [[noreturn]] void init();
extern "C" [[noreturn]] void init()
{
for (;;) { }
}

View file

@ -3,6 +3,7 @@ set(SOURCES
if ("${SERENITY_ARCH}" STREQUAL "aarch64")
set(SOURCES
${SOURCES}
Arch/aarch64/init.cpp
Arch/aarch64/boot.S
)
else()