patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / include / linux / vserver / switch.h
1 #ifndef _VX_SWITCH_H
2 #define _VX_SWITCH_H
3
4 #include <linux/types.h>
5
6 #define VC_CATEGORY(c)          (((c) >> 24) & 0x3F)
7 #define VC_COMMAND(c)           (((c) >> 16) & 0xFF)
8 #define VC_VERSION(c)           ((c) & 0xFFF)
9
10 #define VC_CMD(c,i,v)           ((((VC_CAT_ ## c) & 0x3F) << 24) \
11                                 | (((i) & 0xFF) << 16) | ((v) & 0xFFF))
12
13 /*
14
15   Syscall Matrix V2.7
16
17          |VERSION|CREATE |MODIFY |MIGRATE|CONTROL|EXPERIM| |SPECIAL|SPECIAL|
18          |STATS  |DESTROY|ALTER  |CHANGE |LIMIT  |TEST   | |       |       |
19          |INFO   |SETUP  |       |MOVE   |       |       | |       |       |
20   -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
21   SYSTEM |VERSION|VSETUP |VHOST  |       |       |       | |DEVICES|       |
22   HOST   |     00|     01|     02|     03|     04|     05| |     06|     07|
23   -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
24   CPU    |       |VPROC  |PROCALT|PROCMIG|PROCTRL|       | |SCHED. |       |
25   PROCESS|     08|     09|     10|     11|     12|     13| |     14|     15|
26   -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
27   MEMORY |       |       |       |       |       |       | |SWAP   |       |
28          |     16|     17|     18|     19|     20|     21| |     22|     23|
29   -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
30   NETWORK|       |VNET   |NETALT |NETMIG |NETCTL |       | |SERIAL |       |
31          |     24|     25|     26|     27|     28|     29| |     30|     31|
32   -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
33   DISK   |       |       |       |       |DLIMIT |       | |INODE  |       |
34   VFS    |     32|     33|     34|     35|     36|     37| |     38|     39|
35   -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
36   OTHER  |       |       |       |       |       |       | |VINFO  |       |
37          |     40|     41|     42|     43|     44|     45| |     46|     47|
38   =======+=======+=======+=======+=======+=======+=======+ +=======+=======+
39   SPECIAL|       |       |       |       |FLAGS  |       | |       |       |
40          |     48|     49|     50|     51|     52|     53| |     54|     55|
41   -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
42   SPECIAL|       |       |       |       |RLIMIT |SYSCALL| |       |COMPAT |
43          |     56|     57|     58|     59|     60|TEST 61| |     62|     63|
44   -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
45
46 */
47
48 #define VC_CAT_VERSION          0
49
50 #define VC_CAT_VSETUP           1
51 #define VC_CAT_VHOST            2
52         
53 #define VC_CAT_VPROC            9
54 #define VC_CAT_PROCALT          10
55 #define VC_CAT_PROCMIG          11
56 #define VC_CAT_PROCTRL          12
57
58 #define VC_CAT_SCHED            14
59
60 #define VC_CAT_VNET             25
61 #define VC_CAT_NETALT           26
62 #define VC_CAT_NETMIG           27
63 #define VC_CAT_NETCTRL          28
64
65 #define VC_CAT_DLIMIT           36
66 #define VC_CAT_INODE            38
67
68 #define VC_CAT_VINFO            46
69
70 #define VC_CAT_FLAGS            52
71 #define VC_CAT_RLIMIT           60
72
73 #define VC_CAT_SYSTEST          61
74 #define VC_CAT_COMPAT           63
75         
76 /*  interface version */
77
78 #define VCI_VERSION             0x00010016
79
80
81 /*  query version */
82
83 #define VCMD_get_version        VC_CMD(VERSION, 0, 0)
84
85
86 #ifdef  __KERNEL__
87
88 #include <linux/errno.h>
89
90 #define ENOTSUP         -EOPNOTSUPP
91
92 #else   /* __KERNEL__ */
93 #define __user
94 #endif  /* __KERNEL__ */
95
96 #endif  /* _VX_SWITCH_H */