mirror of
https://github.com/RGBCube/serenity
synced 2025-06-28 18:52:12 +00:00
Kernel: Move wait_cycles() function to Aarch_asm_utils.S
Just a bit of housekeeping.
This commit is contained in:
parent
18eb4a59d6
commit
d6021300d5
3 changed files with 13 additions and 10 deletions
|
@ -1,12 +1,24 @@
|
||||||
/*
|
/*
|
||||||
|
* Copyright (c) 2021, Nico Weber <thakis@chromium.org>
|
||||||
* Copyright (c) 2021, Marcin Undak <mcinek@gmail.com>
|
* Copyright (c) 2021, Marcin Undak <mcinek@gmail.com>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.global get_current_exception_level
|
.global get_current_exception_level
|
||||||
|
.type get_current_exception_level, @function
|
||||||
get_current_exception_level:
|
get_current_exception_level:
|
||||||
mrs x0, CurrentEL
|
mrs x0, CurrentEL
|
||||||
lsr x0, x0, #2
|
lsr x0, x0, #2
|
||||||
and x0, x0, #0x3
|
and x0, x0, #0x3
|
||||||
ret
|
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
|
||||||
|
|
|
@ -7,3 +7,4 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
extern "C" uint8_t get_current_exception_level();
|
extern "C" uint8_t get_current_exception_level();
|
||||||
|
extern "C" void wait_cycles(int n);
|
||||||
|
|
|
@ -30,13 +30,3 @@ Lbss_clear_loop:
|
||||||
bne Lbss_clear_loop
|
bne Lbss_clear_loop
|
||||||
|
|
||||||
b init
|
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
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue