mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-24 21:33:27 +00:00
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:
7
kernel/crates/syscall_table_macros/Cargo.toml
Normal file
7
kernel/crates/syscall_table_macros/Cargo.toml
Normal file
@ -0,0 +1,7 @@
|
||||
[package]
|
||||
name = "syscall_table_macros"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
19
kernel/crates/syscall_table_macros/src/lib.rs
Normal file
19
kernel/crates/syscall_table_macros/src/lib.rs
Normal 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),
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user