summaryrefslogtreecommitdiff
path: root/Kernel/Prekernel
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Prekernel')
-rw-r--r--Kernel/Prekernel/Arch/aarch64/Aarch64_asm_utils.S12
-rw-r--r--Kernel/Prekernel/Arch/aarch64/Aarch64_asm_utils.h1
-rw-r--r--Kernel/Prekernel/Arch/aarch64/boot.S10
3 files changed, 13 insertions, 10 deletions
diff --git a/Kernel/Prekernel/Arch/aarch64/Aarch64_asm_utils.S b/Kernel/Prekernel/Arch/aarch64/Aarch64_asm_utils.S
index 334848f9e7..b5eba4784d 100644
--- a/Kernel/Prekernel/Arch/aarch64/Aarch64_asm_utils.S
+++ b/Kernel/Prekernel/Arch/aarch64/Aarch64_asm_utils.S
@@ -1,12 +1,24 @@
/*
+ * Copyright (c) 2021, Nico Weber <thakis@chromium.org>
* Copyright (c) 2021, Marcin Undak <mcinek@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
.global get_current_exception_level
+.type get_current_exception_level, @function
get_current_exception_level:
mrs x0, CurrentEL
lsr x0, x0, #2
and x0, x0, #0x3
ret
+
+.global wait_cycles
+.type wait_cycles, @function
+wait_cycles:
+Lstart:
+ // This is probably too fast when caching and branch prediction is turned on.
+ // FIXME: Make timer-based.
+ subs x0, x0, #1
+ bne Lstart
+ ret
diff --git a/Kernel/Prekernel/Arch/aarch64/Aarch64_asm_utils.h b/Kernel/Prekernel/Arch/aarch64/Aarch64_asm_utils.h
index e3d4b54ce6..55d115e2ac 100644
--- a/Kernel/Prekernel/Arch/aarch64/Aarch64_asm_utils.h
+++ b/Kernel/Prekernel/Arch/aarch64/Aarch64_asm_utils.h
@@ -7,3 +7,4 @@
#pragma once
extern "C" uint8_t get_current_exception_level();
+extern "C" void wait_cycles(int n);
diff --git a/Kernel/Prekernel/Arch/aarch64/boot.S b/Kernel/Prekernel/Arch/aarch64/boot.S
index 7eaa7fa557..2b4b1cc2c9 100644
--- a/Kernel/Prekernel/Arch/aarch64/boot.S
+++ b/Kernel/Prekernel/Arch/aarch64/boot.S
@@ -30,13 +30,3 @@ Lbss_clear_loop:
bne Lbss_clear_loop
b init
-
-.globl wait_cycles
-.type wait_cycles, @function
-wait_cycles:
-Lstart:
- // This is probably too fast when caching and branch prediction is turned on.
- // FIXME: Make timer-based.
- subs x0, x0, #1
- bne Lstart
- ret