-
Notifications
You must be signed in to change notification settings - Fork 46
/
do_winfo.c
63 lines (51 loc) · 1.23 KB
/
do_winfo.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* Syscall in this file: winfo
* NB this is a winix specific system call
* Input: m1_i1: type of information to be displayed
*
* Return: reply_res: 0
*
* @author Bruce Tan
* @email [email protected]
*
* @author Paul Monigatti
* @email [email protected]
*
* @create date 2017-08-23 06:10:46
*
*/
#include <kernel/kernel.h>
int do_winfo(struct proc *who, struct message *m){
struct filp* file = who->fp_filp[STDOUT_FILENO];
if(!file)
return -EINVAL;
switch(m->m1_i1){
case WINFO_PS:
kreport_all_procs(file);
break;
case WINFO_SLAB:
kprint_slab();
break;
case WINFO_MEM:
kreport_sysmap();
break;
case WINFO_TRACE_SYSCALL:
trace_syscall = true;
break;
case WINFO_DISABLE_TRACE:
trace_syscall = false;
break;
case WINFO_DEBUG_IPC:
debug_ipc(999);
break;
case WINFO_DEBUG_SCHEDULING:
debug_scheduling(m->m1_i2);
break;
case WINFO_NO_GPF:
who->flags |= PROC_NO_GPF;
break;
default:
return -EINVAL;
}
return 0;
}