Fix compilation on other archs

This commit is contained in:
Jeremy Soller
2025-10-04 11:58:04 -06:00
parent 18bf5d904b
commit db8fb14614
10 changed files with 15 additions and 15 deletions
+2 -2
View File
@@ -366,7 +366,7 @@ macro_rules! pop_special {
#[macro_export]
macro_rules! exception_stack {
($name:ident, |$stack:ident| $code:block) => {
#[naked]
#[unsafe(naked)]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn $name(stack: &mut $crate::arch::aarch64::interrupt::InterruptStack) { unsafe {
unsafe extern "C" fn inner($stack: &mut $crate::arch::aarch64::interrupt::InterruptStack) { unsafe {
@@ -393,7 +393,7 @@ macro_rules! exception_stack {
}}
};
}
#[naked]
#[unsafe(naked)]
pub unsafe extern "C" fn enter_usermode() -> ! {
unsafe {
core::arch::naked_asm!(concat!(
+1 -1
View File
@@ -36,7 +36,7 @@ pub use ::rmm::AArch64Arch as CurrentRmmArch;
pub use arch_copy_to_user as arch_copy_from_user;
#[naked]
#[unsafe(naked)]
#[unsafe(link_section = ".usercopy-fns")]
pub unsafe extern "C" fn arch_copy_to_user(dst: usize, src: usize, len: usize) -> u8 {
unsafe {
+1 -1
View File
@@ -20,7 +20,7 @@ const STORE_PAGE_FAULT: usize = 15;
use super::InterruptStack;
#[naked]
#[unsafe(naked)]
// FIXME use extern "custom"
// FIXME use align(4)
pub unsafe extern "C" fn exception_handler() {
+1 -1
View File
@@ -300,7 +300,7 @@ macro_rules! pop_registers {
};
}
#[naked]
#[unsafe(naked)]
pub unsafe extern "C" fn enter_usermode() -> ! {
unsafe {
core::arch::naked_asm!(concat!(
+1 -1
View File
@@ -16,7 +16,7 @@ use core::arch::naked_asm;
pub use arch_copy_to_user as arch_copy_from_user;
#[unsafe(link_section = ".usercopy-fns")]
#[naked]
#[unsafe(naked)]
pub unsafe extern "C" fn arch_copy_to_user(dst: usize, src: usize, len: usize) -> u8 {
unsafe {
naked_asm!(
+5 -5
View File
@@ -266,7 +266,7 @@ macro_rules! interrupt_stack {
// XXX: Apparently we cannot use $expr and check for bool exhaustiveness, so we will have to
// use idents directly instead.
($name:ident, |$stack:ident| $code:block) => {
#[naked]
#[unsafe(naked)]
pub unsafe extern "C" fn $name() { unsafe {
unsafe extern "fastcall" fn inner($stack: &mut $crate::arch::x86::interrupt::InterruptStack) {
// TODO: Force the declarations to specify unsafe?
@@ -317,7 +317,7 @@ macro_rules! interrupt_stack {
#[macro_export]
macro_rules! interrupt {
($name:ident, || $code:block) => {
#[naked]
#[unsafe(naked)]
pub unsafe extern "C" fn $name() { unsafe {
unsafe extern "C" fn inner() {
$code
@@ -357,7 +357,7 @@ macro_rules! interrupt {
#[macro_export]
macro_rules! interrupt_error {
($name:ident, |$stack:ident, $error_code:ident| $code:block) => {
#[naked]
#[unsafe(naked)]
pub unsafe extern "C" fn $name() { unsafe {
unsafe extern "C" fn inner($stack: &mut $crate::arch::x86::interrupt::handler::InterruptErrorStack) {
let $error_code: usize = $stack.code;
@@ -409,7 +409,7 @@ macro_rules! interrupt_error {
}}
};
}
#[naked]
#[unsafe(naked)]
unsafe extern "C" fn usercopy_trampoline() {
unsafe {
core::arch::naked_asm!(
@@ -441,7 +441,7 @@ impl ArchIntCtx for InterruptStack {
}
}
#[naked]
#[unsafe(naked)]
pub unsafe extern "C" fn enter_usermode() {
unsafe {
core::arch::naked_asm!(concat!(
+1 -1
View File
@@ -16,7 +16,7 @@ pub mod flags {
pub const FLAG_SINGLESTEP: usize = 1 << SHIFT_SINGLESTEP;
}
#[naked]
#[unsafe(naked)]
#[unsafe(link_section = ".usercopy-fns")]
pub unsafe extern "C" fn arch_copy_to_user(dst: usize, src: usize, len: usize) -> u8 {
unsafe {
+1 -1
View File
@@ -290,7 +290,7 @@ pub unsafe fn switch_to(prev: &mut super::Context, next: &mut super::Context) {
}
}
#[naked]
#[unsafe(naked)]
unsafe extern "C" fn switch_to_inner(_prev: &mut Context, _next: &mut Context) {
unsafe {
core::arch::naked_asm!(
+1 -1
View File
@@ -152,7 +152,7 @@ pub unsafe fn switch_to(prev: &mut super::Context, next: &mut super::Context) {
}
}
#[naked]
#[unsafe(naked)]
unsafe extern "C" fn switch_to_inner(prev: &mut Context, next: &mut Context) {
unsafe {
core::arch::naked_asm!(r#"
+1 -1
View File
@@ -254,7 +254,7 @@ pub unsafe fn switch_to(prev: &mut super::Context, next: &mut super::Context) {
}
// Check disassembly!
#[naked]
#[unsafe(naked)]
unsafe extern "cdecl" fn switch_to_inner() {
unsafe {
use Context as Cx;