summaryrefslogtreecommitdiff
path: root/Kernel/Prekernel/Arch/aarch64/Aarch64_asm_utils.S
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Prekernel/Arch/aarch64/Aarch64_asm_utils.S')
-rw-r--r--Kernel/Prekernel/Arch/aarch64/Aarch64_asm_utils.S12
1 files changed, 12 insertions, 0 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