Skip to content

Commit fd870a0

Browse files
committed
fix: remove "C" calling convention specification for vmexit_trampoline and run_guest functions
1 parent 50fd109 commit fd870a0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/exception.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ fn current_el_sync_handler(tf: &mut TrapFrame) {
340340
/// invoked as part of the low-level hypervisor or VM exit handling routines.
341341
#[unsafe(naked)]
342342
#[unsafe(no_mangle)]
343-
unsafe extern "C" fn vmexit_trampoline() -> ! {
343+
unsafe extern fn vmexit_trampoline() -> ! {
344344
core::arch::naked_asm!(
345345
// Curretly `sp` points to the base address of `Aarch64VCpu.ctx`, which stores guest's `TrapFrame`.
346346
"add x9, sp, 34 * 8", // Skip the exception frame.

src/pcpu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ static ORI_EXCEPTION_VECTOR_BASE: usize = 0;
2323
#[percpu::def_percpu]
2424
pub static IRQ_HANDLER: OnceCell<&(dyn Fn() + Send + Sync)> = OnceCell::new();
2525

26-
unsafe extern "C" {
26+
unsafe extern {
2727
fn exception_vector_base_vcpu();
2828
}
2929

src/vcpu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ impl<H: AxVCpuHal> Aarch64VCpu<H> {
215215
/// When a VM-Exit happens when guest's vCpu is running,
216216
/// the control flow will be redirected to this function through `return_run_guest`.
217217
#[unsafe(naked)]
218-
unsafe extern "C" fn run_guest(&mut self) -> usize {
218+
unsafe extern fn run_guest(&mut self) -> usize {
219219
// Fixes: https://github.com/arceos-hypervisor/arm_vcpu/issues/22
220220
//
221221
// The original issue seems to be caused by an unexpected compiler optimization that takes

0 commit comments

Comments
 (0)