user app can invoke kernel syscall!!!!

This commit is contained in:
2025-08-26 18:44:46 -06:00
parent 6dcdd88a0f
commit c4f2c6cffb
12 changed files with 201 additions and 170 deletions

View File

@@ -3,8 +3,16 @@
use core::ffi::c_void;
use shared::keyboard::{KeyCode, KeyEvent, KeyState, Modifiers};
// Instead of extern, declare a static pointer in a dedicated section
#[unsafe(no_mangle)]
pub unsafe fn call_abi(_call: *const Syscall) {}
#[unsafe(link_section = ".user_reloc")]
pub static mut call_abi_ptr: usize = 0;
// Helper to call it
pub unsafe fn call_abi(call: *const Syscall) {
let f: extern "C" fn(*const Syscall) = unsafe { core::mem::transmute(call_abi_ptr) };
f(call);
}
#[repr(C)]
pub enum Syscall {