VM: munmap used by VM for itself is no longer used
[minix.git] / include / minix / priv.h
blob03c0665c82ed405e052b00815a8d83b404e980ea
1 /* Privilege-related definitions. */
3 #ifndef _MINIX_PRIV_H
4 #define _MINIX_PRIV_H
6 #include <minix/com.h>
7 #include <minix/config.h>
9 /* Static privilege id definitions. */
10 #define NR_STATIC_PRIV_IDS NR_BOOT_PROCS
11 #define is_static_priv_id(id) (id >= 0 && id < NR_STATIC_PRIV_IDS)
12 #define static_priv_id(n) (NR_TASKS + (n))
14 /* Unprivileged user processes all share the privilege structure of the
15 * user processesess.
16 * This id must be fixed because it is used to check send mask entries.
18 #define USER_PRIV_ID static_priv_id(ROOT_USR_PROC_NR)
19 /* Specifies a null privilege id.
21 #define NULL_PRIV_ID (-1)
23 /* Allowed targets. */
24 #define NO_M (-1) /* no targets allowed */
25 #define ALL_M (-2) /* all targets allowed */
27 /* Allowed calls. */
28 #define NO_C (-1) /* no calls allowed */
29 #define ALL_C (-2) /* all calls allowed */
30 #define NULL_C (-3) /* null call entry */
33 * Default privilege settings used in the system
35 /* privilege flags */
36 #define IDL_F (SYS_PROC | BILLABLE) /* idle task is not preemptible as we
37 * don't want it to interfere with the
38 * timer tick interrupt handler code.
39 * Unlike other processes idle task is
40 * handled in a special way and is
41 * preempted always if timer tick occurs
42 * and there is another runnable process
44 #define TSK_F (SYS_PROC) /* other kernel tasks */
45 #define SRV_F (SYS_PROC | PREEMPTIBLE) /* system services */
46 #define DSRV_F (SRV_F | DYN_PRIV_ID) /* dynamic system services */
47 #define RSYS_F (SRV_F | ROOT_SYS_PROC) /* root sys proc */
48 #define VM_F (SYS_PROC | VM_SYS_PROC) /* vm */
49 #define USR_F (BILLABLE | PREEMPTIBLE) /* user processes */
50 #define IMM_F (ROOT_SYS_PROC | VM_SYS_PROC | PREEMPTIBLE) /* immutable */
52 /* allowed traps */
53 #define CSK_T (1 << RECEIVE) /* clock and system */
54 #define TSK_T 0 /* other kernel tasks */
55 #define SRV_T (~0) /* system services */
56 #define DSRV_T (~0) /* dynamic system services */
57 #define USR_T (1 << SENDREC) /* user processes */
59 /* allowed targets */
60 #define TSK_M NO_M /* all kernel tasks */
61 #define SRV_M ALL_M /* system services */
62 #define DSRV_M ALL_M /* dynamic system services */
63 #define USR_M ALL_M /* user processes */
65 /* allowed kernel calls */
66 #define TSK_KC NO_C /* all kernel tasks */
67 #define SRV_KC ALL_C /* dynamic system services */
68 #define DSRV_KC ALL_C /* default sys proc */
69 #define USR_KC NO_C /* user processes */
71 /* allowed vm calls */
72 #define SRV_VC ALL_C /* dynamic system services */
73 #define DSRV_VC ALL_C /* default sys proc */
74 #define USR_VC ALL_C /* user processes */
76 /* signal manager */
77 #define SRV_SM ROOT_SYS_PROC_NR /* system services */
78 #define DSRV_SM ROOT_SYS_PROC_NR /* dynamic system services */
79 #define USR_SM PM_PROC_NR /* user processes */
81 /* scheduler */
82 #define SRV_SCH KERNEL /* system services */
83 #define DSRV_SCH SCHED_PROC_NR /* dynamic system services */
84 #define USR_SCH NONE /* user processes */
86 /* scheduling priority queue. */
87 #define SRV_Q USER_Q /* system services */
88 #define DSRV_Q USER_Q /* dynamic system services */
89 #define USR_Q USER_Q /* user processes */
91 /* scheduling quantum. */
92 #define SRV_QT USER_QUANTUM /* system services */
93 #define DSRV_QT USER_QUANTUM /* dynamic system services */
94 #define USR_QT USER_QUANTUM /* user processes */
96 /* default CPU */
97 #define DSRV_CPU USER_DEFAULT_CPU
99 #endif /* _MINIX_PRIV_H */