11use 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} ;
109use 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