forked from arceos-org/starry-next
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[syscall] Split syscalls into multiple files according to the syscall…
… categories
- Loading branch information
1 parent
6cb97af
commit b306a18
Showing
14 changed files
with
364 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ extern crate axstd; | |
|
||
mod loader; | ||
mod mm; | ||
mod syscall; | ||
mod syscall_imp; | ||
mod task; | ||
use alloc::sync::Arc; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use core::ffi::c_void; | ||
|
||
use crate::syscall_body; | ||
|
||
/// The ioctl() system call manipulates the underlying device parameters | ||
/// of special files. | ||
/// | ||
/// # Arguments | ||
/// * `fd` - The file descriptor | ||
/// * `op` - The request code. It is of type unsigned long in glibc and BSD, | ||
/// and of type int in musl and other UNIX systems. | ||
/// * `argp` - The argument to the request. It is a pointer to a memory location | ||
pub(crate) fn sys_ioctl(_fd: i32, _op: usize, _argp: *mut c_void) -> i32 { | ||
syscall_body!(sys_ioctl, { | ||
warn!("Unimplemented syscall: SYS_IOCTL"); | ||
Ok(0) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use core::ffi::c_void; | ||
|
||
use arceos_posix_api as api; | ||
|
||
pub(crate) fn sys_read(fd: i32, buf: *mut c_void, count: usize) -> isize { | ||
api::sys_read(fd, buf, count) | ||
} | ||
pub(crate) fn sys_write(fd: i32, buf: *const c_void, count: usize) -> isize { | ||
api::sys_write(fd, buf, count) | ||
} | ||
|
||
pub(crate) fn sys_writev(fd: i32, iov: *const api::ctypes::iovec, iocnt: i32) -> isize { | ||
unsafe { api::sys_writev(fd, iov, iocnt) } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
mod ctl; | ||
mod io; | ||
|
||
pub(crate) use ctl::*; | ||
pub(crate) use io::*; |
Oops, something went wrong.