Extract x86-specific syscall dispatch to arch/x86

This commit is contained in:
YanWQ-monad
2024-05-04 04:36:19 +08:00
committed by Tate, Hongliang Tian
parent f19dfc7873
commit 0d5131c822
110 changed files with 444 additions and 776 deletions

View File

@ -1,13 +1,12 @@
// SPDX-License-Identifier: MPL-2.0
use super::{SyscallReturn, SYS_SHUTDOWN};
use super::SyscallReturn;
use crate::{
fs::file_table::FileDesc, log_syscall_entry, net::socket::SockShutdownCmd, prelude::*,
fs::file_table::FileDesc, net::socket::SockShutdownCmd, prelude::*,
util::net::get_socket_from_fd,
};
pub fn sys_shutdown(sockfd: FileDesc, how: i32) -> Result<SyscallReturn> {
log_syscall_entry!(SYS_SHUTDOWN);
let shutdown_cmd = SockShutdownCmd::try_from(how)?;
debug!("sockfd = {sockfd}, cmd = {shutdown_cmd:?}");