mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:57: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:
parent
f1d1418256
commit
62bc238ac3
3 changed files with 24 additions and 1 deletions
|
@ -9,7 +9,18 @@
|
||||||
.global start
|
.global start
|
||||||
.type start, @function
|
.type start, @function
|
||||||
start:
|
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:
|
Lhalt:
|
||||||
wfi
|
wfi
|
||||||
|
|
11
Kernel/Prekernel/Arch/aarch64/init.cpp
Normal file
11
Kernel/Prekernel/Arch/aarch64/init.cpp
Normal 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 (;;) { }
|
||||||
|
}
|
|
@ -3,6 +3,7 @@ set(SOURCES
|
||||||
if ("${SERENITY_ARCH}" STREQUAL "aarch64")
|
if ("${SERENITY_ARCH}" STREQUAL "aarch64")
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
${SOURCES}
|
${SOURCES}
|
||||||
|
Arch/aarch64/init.cpp
|
||||||
Arch/aarch64/boot.S
|
Arch/aarch64/boot.S
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue