kernel/syscalls.rs
1//! This module provides access to all the syscalls.
2
3use core::ffi::{c_int, c_uint};
4
5mod file;
6mod tasks;
7
8// We need to import everything so that the macro is able to find the entry functions.
9use file::*;
10use tasks::*;
11
12#[unsafe(no_mangle)]
13pub extern "C" fn handle_syscall(number: usize, args: *const c_uint) -> c_int {
14 // All functions that are annotated with the #[syscall_handler(num = X)] macro are syscalls.
15 // build.rs will generate a match statement that matches the syscall number to the function which is then included here.
16 include!(concat!(env!("OUT_DIR"), "/syscall_dispatcher.in"))
17}