summaryrefslogtreecommitdiff
path: root/Kernel/Arch/aarch64/boot.S
diff options
context:
space:
mode:
authorTimon Kruiper <timonkruiper@gmail.com>2023-01-06 14:50:05 +0100
committerLinus Groh <mail@linusgroh.de>2023-01-24 14:54:44 +0000
commit91d04519991083c2d6bdf85f535a2e64278e86ca (patch)
tree07501786b1fa09ad0327a165687159781cfbee22 /Kernel/Arch/aarch64/boot.S
parenta581cae4d411401aba5857add7e308a6cc7b55cf (diff)
downloadserenity-91d04519991083c2d6bdf85f535a2e64278e86ca.zip
Kernel/aarch64: Use relative addressing in boot.S
As the kernel is now linked at high address in virtual memory, we cannot use absolute addresses as they refer to high addresses in virtual memory. At this point in the boot process we are still running with the MMU off, so we have to make sure the accesses are using physical memory addresses.
Diffstat (limited to 'Kernel/Arch/aarch64/boot.S')
-rw-r--r--Kernel/Arch/aarch64/boot.S6
1 files changed, 4 insertions, 2 deletions
diff --git a/Kernel/Arch/aarch64/boot.S b/Kernel/Arch/aarch64/boot.S
index 2a582e4300..ac4796f616 100644
--- a/Kernel/Arch/aarch64/boot.S
+++ b/Kernel/Arch/aarch64/boot.S
@@ -19,11 +19,13 @@ start:
// 512 kiB (0x80000) of stack are probably not sufficient, especially once we give the other cores some stack too,
// but for now it's ok.
msr SPSel, #0 //Use the same SP as we descend into EL1
- ldr x14, =start
+ adrp x14, start
+ add x14, x14, :lo12:start
mov sp, x14
// Clear BSS.
- ldr x14, =start_of_bss
+ adrp x14, start_of_bss
+ add x14, x14, :lo12:start_of_bss
ldr x15, =size_of_bss_divided_by_8
Lbss_clear_loop:
str xzr, [x14], #8