Skip to content

Commit fce6f41

Browse files
committedFeb 24, 2025·
remove unused syscall
1 parent 2f2ba3f commit fce6f41

File tree

3 files changed

+1
-26
lines changed

3 files changed

+1
-26
lines changed
 

‎os/src/config.rs

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ pub const KERNEL_HEAP_SIZE: usize = 0x200_0000;
1313
pub const PAGE_SIZE: usize = 0x1000;
1414
/// page size bits: 12
1515
pub const PAGE_SIZE_BITS: usize = 0xc;
16-
/// the max number of syscall
17-
pub const MAX_SYSCALL_NUM: usize = 500;
1816
/// the virtual addr of trapoline
1917
pub const TRAMPOLINE: usize = usize::MAX - PAGE_SIZE + 1;
2018
/// the virtual addr of trap context

‎os/src/syscall/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ const SYSCALL_MMAP: usize = 222;
6060
const SYSCALL_WAITPID: usize = 260;
6161
/// spawn syscall
6262
const SYSCALL_SPAWN: usize = 400;
63-
/// taskinfo syscall
64-
const SYSCALL_TASK_INFO: usize = 410;
6563

6664
mod fs;
6765
mod process;
@@ -98,7 +96,6 @@ pub fn syscall(syscall_id: usize, args: [usize; 4]) -> isize {
9896
SYSCALL_EXEC => sys_exec(args[0] as *const u8, args[1] as *const usize),
9997
SYSCALL_WAITPID => sys_waitpid(args[0] as isize, args[1] as *mut i32),
10098
SYSCALL_GET_TIME => sys_get_time(args[0] as *mut TimeVal, args[1]),
101-
SYSCALL_TASK_INFO => sys_task_info(args[0] as *mut TaskInfo),
10299
SYSCALL_MMAP => sys_mmap(args[0], args[1], args[2]),
103100
SYSCALL_MUNMAP => sys_munmap(args[0], args[1]),
104101
SYSCALL_SBRK => sys_sbrk(args[0] as i32),

‎os/src/syscall/process.rs

+1-21
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
//! Process management syscalls
22
33
use crate::{
4-
config::MAX_SYSCALL_NUM,
54
fs::{open_file, OpenFlags},
65
mm::{translated_ref, translated_refmut, translated_str},
76
task::{
87
add_task, current_task, current_user_token, exit_current_and_run_next, pid2task,
9-
suspend_current_and_run_next, SignalAction, SignalFlags, TaskStatus, MAX_SIG,
8+
suspend_current_and_run_next, SignalAction, SignalFlags, MAX_SIG,
109
},
1110
};
1211
use alloc::{string::String, sync::Arc, vec::Vec};
@@ -18,17 +17,6 @@ pub struct TimeVal {
1817
pub usec: usize,
1918
}
2019

21-
/// Task information
22-
#[allow(dead_code)]
23-
pub struct TaskInfo {
24-
/// Task status in it's life cycle
25-
status: TaskStatus,
26-
/// The numbers of syscall called by task
27-
syscall_times: [u32; MAX_SYSCALL_NUM],
28-
/// Total running time of task
29-
time: usize,
30-
}
31-
3220
pub fn sys_exit(exit_code: i32) -> ! {
3321
trace!("kernel:pid[{}] sys_exit",current_task().unwrap().pid.0);
3422
exit_current_and_run_next(exit_code);
@@ -153,14 +141,6 @@ pub fn sys_get_time(_ts: *mut TimeVal, _tz: usize) -> isize {
153141
-1
154142
}
155143

156-
/// YOUR JOB: Finish sys_task_info to pass testcases
157-
/// HINT: You might reimplement it with virtual memory management.
158-
/// HINT: What if [`TaskInfo`] is splitted by two pages ?
159-
pub fn sys_task_info(_ti: *mut TaskInfo) -> isize {
160-
trace!("kernel:pid[{}] sys_task_info NOT IMPLEMENTED", current_task().unwrap().pid.0);
161-
-1
162-
}
163-
164144
/// YOUR JOB: Implement mmap.
165145
pub fn sys_mmap(_start: usize, _len: usize, _port: usize) -> isize {
166146
trace!("kernel:pid[{}] sys_mmap NOT IMPLEMENTED", current_task().unwrap().pid.0);

0 commit comments

Comments
 (0)
Please sign in to comment.