Skip to content

Commit

Permalink
misc: replace asm! with naked_asm! in naked functions
Browse files Browse the repository at this point in the history
Fixes: error[E0787]: the `asm!` macro is not allowed in naked functions

Signed-off-by: Esteban Blanc <estblcsk@gmail.com>
  • Loading branch information
Skallwar committed Oct 10, 2024
1 parent d46f599 commit 120894e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions hal_aarch64/src/irq.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use core::arch::naked_asm;
use core::ptr;
use core::sync::atomic::{AtomicPtr, Ordering};

Expand Down Expand Up @@ -57,7 +58,7 @@ macro_rules! gen_isr_stub {
#[no_mangle]
#[repr(align(0x800))]
unsafe extern "C" fn el1_vector_table() {
core::arch::asm!(
naked_asm!(
gen_isr_stub!(),
gen_isr_stub!(),
gen_isr_stub!(),
Expand All @@ -70,7 +71,6 @@ unsafe extern "C" fn el1_vector_table() {
gen_isr_stub!(),
gen_isr_stub!(),
gen_isr_stub!(),
options(noreturn)
);
}

Expand Down
7 changes: 3 additions & 4 deletions hal_aarch64/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use cortex_a::registers::*;
use tock_registers::interfaces::Readable;

use core::arch::asm;
use core::arch::naked_asm;

pub mod cpu;
pub mod irq;
Expand All @@ -32,14 +32,13 @@ pub fn panic_info() -> PanicInfo {
#[naked]
#[no_mangle]
unsafe extern "C" fn _start() -> ! {
asm!(
naked_asm!(
"
adrp x9, STACK_START
msr spsel, xzr
mov sp, x9
b k_main
",
options(noreturn)
"
);
}

Expand Down

0 comments on commit 120894e

Please sign in to comment.