Skip to content

Commit 468f25e

Browse files
committed
remove unused syscall
1 parent 3a5b86e commit 468f25e

File tree

3 files changed

+1
-30
lines changed

3 files changed

+1
-30
lines changed

os/src/config.rs

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

os/src/syscall/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ pub const SYSCALL_MAIL_WRITE: usize = 402;
7474
pub const SYSCALL_DUP: usize = 24;
7575
/// pipe syscall
7676
pub const SYSCALL_PIPE: usize = 59;
77-
/// task info syscall
78-
pub const SYSCALL_TASK_INFO: usize = 410;
7977
/// thread_create syscall
8078
pub const SYSCALL_THREAD_CREATE: usize = 460;
8179
/// waittid syscall
@@ -137,7 +135,6 @@ pub fn syscall(syscall_id: usize, args: [usize; 4]) -> isize {
137135
SYSCALL_MMAP => sys_mmap(args[0], args[1], args[2]),
138136
SYSCALL_MUNMAP => sys_munmap(args[0], args[1]),
139137
SYSCALL_SET_PRIORITY => sys_set_priority(args[0] as isize),
140-
SYSCALL_TASK_INFO => sys_task_info(args[0] as *mut TaskInfo),
141138
SYSCALL_SPAWN => sys_spawn(args[0] as *const u8),
142139
SYSCALL_THREAD_CREATE => sys_thread_create(args[0], args[1]),
143140
SYSCALL_WAITTID => sys_waittid(args[0]) as isize,

os/src/syscall/process.rs

+1-25
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
use crate::{
2-
config::MAX_SYSCALL_NUM,
32
fs::{open_file, OpenFlags},
43
mm::{translated_ref, translated_refmut, translated_str},
54
task::{
65
current_process, current_task, current_user_token, exit_current_and_run_next, pid2process,
7-
suspend_current_and_run_next, SignalFlags, TaskStatus,
6+
suspend_current_and_run_next, SignalFlags,
87
},
98
};
109
use alloc::{string::String, sync::Arc, vec::Vec};
@@ -16,16 +15,6 @@ pub struct TimeVal {
1615
pub usec: usize,
1716
}
1817

19-
/// Task information
20-
#[allow(dead_code)]
21-
pub struct TaskInfo {
22-
/// Task status in it's life cycle
23-
status: TaskStatus,
24-
/// The numbers of syscall called by task
25-
syscall_times: [u32; MAX_SYSCALL_NUM],
26-
/// Total running time of task
27-
time: usize,
28-
}
2918
/// exit syscall
3019
///
3120
/// exit the current task and run the next task in task list
@@ -170,19 +159,6 @@ pub fn sys_get_time(_ts: *mut TimeVal, _tz: usize) -> isize {
170159
-1
171160
}
172161

173-
/// task_info syscall
174-
///
175-
/// YOUR JOB: Finish sys_task_info to pass testcases
176-
/// HINT: You might reimplement it with virtual memory management.
177-
/// HINT: What if [`TaskInfo`] is splitted by two pages ?
178-
pub fn sys_task_info(_ti: *mut TaskInfo) -> isize {
179-
trace!(
180-
"kernel:pid[{}] sys_task_info NOT IMPLEMENTED",
181-
current_task().unwrap().process.upgrade().unwrap().getpid()
182-
);
183-
-1
184-
}
185-
186162
/// mmap syscall
187163
///
188164
/// YOUR JOB: Implement mmap.

0 commit comments

Comments
 (0)