summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Undak <mcinek@gmail.com>2021-10-08 10:01:57 -0400
committerLinus Groh <mail@linusgroh.de>2021-10-15 17:47:39 +0100
commitd6021300d5886cb3598cc51a2c76714e88e30a33 (patch)
treee63fd0c37d3737eccb2668bdbddd099ea70eec47
parent18eb4a59d6d41af599f0d2fba2d6a81ad5cccbe4 (diff)
downloadserenity-d6021300d5886cb3598cc51a2c76714e88e30a33.zip
Kernel: Move wait_cycles() function to Aarch_asm_utils.S
Just a bit of housekeeping.
-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