feat(syscall): 添加syscall table的实现 (#1164)

* feat(syscall): 添加syscall table的实现

- 实现syscall table
- 为syscall table适配write/writev、read和readv系统调用

---------

Signed-off-by: longjin <longjin@DragonOS.org>
This commit is contained in:
LoGin
2025-05-13 18:59:18 +08:00
committed by GitHub
parent 545bc2c346
commit b322121dd9
29 changed files with 874 additions and 227 deletions

View File

@ -0,0 +1,7 @@
[package]
name = "syscall_table_macros"
version = "0.1.0"
edition = "2021"
[dependencies]

View File

@ -0,0 +1,19 @@
#![no_std]
#![deny(clippy::all)]
#[macro_export]
#[allow(clippy::crate_in_macro_def)]
macro_rules! declare_syscall {
($nr:ident, $inner_handle:ident) => {
paste::paste! {
#[allow(non_upper_case_globals)]
#[link_section = ".syscall_table"]
#[used]
pub static [<HANDLE_ $nr>]: crate::syscall::table::SyscallHandle = crate::syscall::table::SyscallHandle {
nr: $nr,
inner_handle: &$inner_handle,
name: stringify!($nr),
};
}
};
}