kernel/abi/
scarlet.rs

1//! Scarlet Native ABI Module
2//! 
3//! This module implements the Scarlet ABI for the Scarlet kernel.
4//! It provides the necessary functionality for handling system calls
5//! and interacting with the Scarlet kernel.
6//! 
7
8use crate::{arch::Trapframe, early_initcall, register_abi, syscall::syscall_handler};
9
10use super::AbiModule;
11
12#[derive(Default, Copy, Clone)]
13pub struct ScarletAbi;
14
15impl AbiModule for ScarletAbi {
16    fn name() -> &'static str {
17        "scarlet"
18    }
19
20    fn handle_syscall(&self, trapframe: &mut Trapframe) -> Result<usize, &'static str> {
21        syscall_handler(trapframe)
22    }
23}
24
25fn register_scarlet_abi() {
26    register_abi!(ScarletAbi);
27}
28
29early_initcall!(register_scarlet_abi);