Move aarch64 interrupt init func

This commit is contained in:
Wildan Mubarok
2025-06-25 14:37:50 +00:00
committed by Jeremy Soller
parent f32d018d85
commit fa907f02ae
3 changed files with 17 additions and 9 deletions
+12
View File
@@ -48,3 +48,15 @@ pub unsafe fn halt() {
pub fn pause() {
unsafe { asm!("nop") };
}
#[inline(always)]
pub unsafe fn init() {
// Setup interrupt handlers
asm!(
"
ldr {tmp}, =exception_vector_base
msr vbar_el1, {tmp}
",
tmp = out(reg) _,
);
}
+4 -9
View File
@@ -12,7 +12,9 @@ use fdt::Fdt;
use log::info;
use crate::{
allocator, device, dtb,
allocator,
arch::interrupt,
device, dtb,
dtb::register_dev_memory_ranges,
paging,
startup::memory::{register_bootloader_areas, register_memory_region, BootloaderMemoryKind},
@@ -149,14 +151,7 @@ pub unsafe extern "C" fn kstart(args_ptr: *const KernelArgs) -> ! {
args.bootstrap_base + args.bootstrap_size
);
// Setup interrupt handlers
core::arch::asm!(
"
ldr {tmp}, =exception_vector_base
msr vbar_el1, {tmp}
",
tmp = out(reg) _,
);
interrupt::init();
// Initialize RMM
register_bootloader_areas(args.areas_base, args.areas_size);
+1
View File
@@ -53,6 +53,7 @@ pub fn pause() {
}
}
#[inline(always)]
pub unsafe fn init() {
// Setup interrupt handlers
asm!(