mirror of
https://github.com/LegitCamper/picocalc-os-rs.git
synced 2026-10-22 22:57:36 -06:00
user app can invoke kernel syscall!!!!
This commit is contained in:
1 parent
6dcdd88a0f
commit
c4f2c6cffb
12 files changed
+201
-170
No files matched your search
+9
-1
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user