Skip to content

Commit d4176c3

Browse files
committed
remove unused syscall
1 parent ff028e1 commit d4176c3

File tree

4 files changed

+4
-31
lines changed

4 files changed

+4
-31
lines changed

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ easy-fs-fuse/target/*
1515
tools/
1616
pushall.sh
1717
*.bak
18-
19-
user/*
18+
ci-user/
19+
user/
20+
os/vendor/

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
@@ -48,8 +48,6 @@ const SYSCALL_MMAP: usize = 222;
4848
const SYSCALL_WAITPID: usize = 260;
4949
/// spawn syscall
5050
const SYSCALL_SPAWN: usize = 400;
51-
/// taskinfo syscall
52-
const SYSCALL_TASK_INFO: usize = 410;
5351

5452
mod fs;
5553
mod process;
@@ -76,7 +74,6 @@ pub fn syscall(syscall_id: usize, args: [usize; 4]) -> isize {
7674
SYSCALL_EXEC => sys_exec(args[0] as *const u8),
7775
SYSCALL_WAITPID => sys_waitpid(args[0] as isize, args[1] as *mut i32),
7876
SYSCALL_GET_TIME => sys_get_time(args[0] as *mut TimeVal, args[1]),
79-
SYSCALL_TASK_INFO => sys_task_info(args[0] as *mut TaskInfo),
8077
SYSCALL_MMAP => sys_mmap(args[0], args[1], args[2]),
8178
SYSCALL_MUNMAP => sys_munmap(args[0], args[1]),
8279
SYSCALL_SBRK => sys_sbrk(args[0] as i32),

os/src/syscall/process.rs

+1-24
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
use alloc::sync::Arc;
44

55
use crate::{
6-
config::MAX_SYSCALL_NUM,
76
fs::{open_file, OpenFlags},
87
mm::{translated_refmut, translated_str},
98
task::{
109
add_task, current_task, current_user_token, exit_current_and_run_next,
11-
suspend_current_and_run_next, TaskStatus,
10+
suspend_current_and_run_next,
1211
},
1312
};
1413

@@ -19,17 +18,6 @@ pub struct TimeVal {
1918
pub usec: usize,
2019
}
2120

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

128-
/// YOUR JOB: Finish sys_task_info to pass testcases
129-
/// HINT: You might reimplement it with virtual memory management.
130-
/// HINT: What if [`TaskInfo`] is splitted by two pages ?
131-
pub fn sys_task_info(_ti: *mut TaskInfo) -> isize {
132-
trace!(
133-
"kernel:pid[{}] sys_task_info NOT IMPLEMENTED",
134-
current_task().unwrap().pid.0
135-
);
136-
-1
137-
}
138-
139116
/// YOUR JOB: Implement mmap.
140117
pub fn sys_mmap(_start: usize, _len: usize, _port: usize) -> isize {
141118
trace!(

0 commit comments

Comments
 (0)