twizzler_rt_abi/arch/x86_64.rs
1#[cfg(feature = "rt0")]
2#[no_mangle]
3/// Entry for upcalls.
4///
5/// # Safety
6/// This function may not be called except as an upcall from the kernel.
7pub unsafe extern "C-unwind" fn __twz_rt_upcall_entry(
8 rdi: *mut core::ffi::c_void,
9 rsi: *const core::ffi::c_void,
10) -> ! {
11 core::arch::asm!(
12 "and rsp, 0xfffffffffffffff0",
13 "mov rbp, rdx",
14 "push 0",
15 "jmp twz_rt_upcall_entry_c",
16 in("rdi") rdi,
17 in("rsi") rsi,
18 options(noreturn)
19 );
20}