SE/FS: Get rid of includes of config/full_system.hh.
[gem5.git] / src / kern / linux / linux_syscalls.hh
1 /*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Ali Saidi
29 */
30
31 #ifndef __KERN_LINUX_LINUX_SYSCALLS_HH__
32 #define __KERN_LINUX_LINUX_SYSCALLS_HH__
33
34 #include "kern/linux/linux.hh"
35
36 template <class OS>
37 class SystemCalls;
38
39 template <>
40 class SystemCalls<Linux>
41 {
42 public:
43 enum {
44 syscall = 0,
45 llseek = 1,
46 newselect = 2,
47 sysctl = 3,
48 access = 4,
49 acct = 5,
50 adjtimex = 6,
51 afs_syscall = 7,
52 alarm = 8,
53 bdflush = 9,
54 _break = 10, /*renamed from break*/
55 brk = 11,
56 capget = 12,
57 capset = 13,
58 chdir = 14,
59 chmod = 15,
60 chown = 16,
61 chown32 = 17,
62 chroot = 18,
63 clock_getres = 19,
64 clock_gettime = 20,
65 clock_nanosleep = 21,
66 clock_settime = 22,
67 clone = 23,
68 close = 24,
69 creat = 25,
70 create_module = 26,
71 delete_module = 27,
72 dup = 28,
73 dup2 = 29,
74 epoll_create = 30,
75 epoll_ctl = 31,
76 epoll_wait = 32,
77 execve = 33,
78 exit = 34,
79 exit_group = 35,
80 fadvise64 = 36,
81 fadvise64_64 = 37,
82 fchdir = 38,
83 fchmod = 39,
84 fchown = 40,
85 fchown32 = 41,
86 fcntl = 42,
87 fcntl64 = 43,
88 fdatasync = 44,
89 fgetxattr = 45,
90 flistxattr = 46,
91 flock = 47,
92 fork = 48,
93 fremovexattr = 49,
94 fsetxattr = 50,
95 fstat = 51,
96 fstat64 = 52,
97 fstatfs = 53,
98 fstatfs64 = 54,
99 fsync = 55,
100 ftime = 56,
101 ftruncate = 57,
102 ftruncate64 = 58,
103 futex = 59,
104 get_kernel_syms = 60,
105 get_thread_area = 61,
106 getcwd = 62,
107 getdents = 63,
108 getdents64 = 64,
109 getegid = 65,
110 getegid32 = 66,
111 geteuid = 67,
112 geteuid32 = 68,
113 getgid = 69,
114 getgid32 = 70,
115 getgroups = 71,
116 getgroups32 = 72,
117 getitimer = 73,
118 getpgid = 74,
119 getpgrp = 75,
120 getpid = 76,
121 getpmsg = 77,
122 getppid = 78,
123 getpriority = 79,
124 getresgid = 80,
125 getresgid32 = 81,
126 getresuid = 82,
127 getresuid32 = 83,
128 getrlimit = 84,
129 getrusage = 85,
130 getsid = 86,
131 gettid = 87,
132 gettimeofday = 88,
133 getuid = 89,
134 getuid32 = 90,
135 getxattr = 91,
136 gtty = 92,
137 idle = 93,
138 init_module = 94,
139 io_cancel = 95,
140 io_destroy = 96,
141 io_getevents = 97,
142 io_setup = 98,
143 io_submit = 99,
144 ioctl = 100,
145 ioperm = 101,
146 iopl = 102,
147 ipc = 103,
148 kill = 104,
149 lchown = 105,
150 lchown32 = 106,
151 lgetxattr = 107,
152 link = 108,
153 listxattr = 109,
154 llistxattr = 110,
155 lock = 111,
156 lookup_dcookie = 112,
157 lremovexattr = 113,
158 lseek = 114,
159 lsetxattr = 115,
160 lstat = 116,
161 lstat64 = 117,
162 madvise = 118,
163 madvise1 = 119,
164 mincore = 120,
165 mkdir = 121,
166 mknod = 122,
167 mlock = 123,
168 mlockall = 124,
169 mmap = 125,
170 mmap2 = 126,
171 modify_ldt = 127,
172 mount = 128,
173 mprotect = 129,
174 mpx = 130,
175 mremap = 131,
176 msync = 132,
177 munlock = 133,
178 munlockall = 134,
179 munmap = 135,
180 nanosleep = 136,
181 nfsservctl = 137,
182 nice = 138,
183 oldfstat = 139,
184 oldlstat = 140,
185 oldolduname = 141,
186 oldstat = 142,
187 olduname = 143,
188 open = 144,
189 pause = 145,
190 personality = 146,
191 pipe = 147,
192 pivot_root = 148,
193 poll = 149,
194 prctl = 150,
195 pread64 = 151,
196 prof = 152,
197 profil = 153,
198 ptrace = 154,
199 putpmsg = 155,
200 pwrite64 = 156,
201 query_module = 157,
202 quotactl = 158,
203 read = 159,
204 readahead = 160,
205 readdir = 161,
206 readlink = 162,
207 readv = 163,
208 reboot = 164,
209 remap_file_pages = 165,
210 removexattr = 166,
211 rename = 167,
212 restart_syscall = 168,
213 rmdir = 169,
214 rt_sigaction = 170,
215 rt_sigpending = 171,
216 rt_sigprocmask = 172,
217 rt_sigqueueinfo = 173,
218 rt_sigreturn = 174,
219 rt_sigsuspend = 175,
220 rt_sigtimedwait = 176,
221 sched_get_priority_max = 177,
222 sched_get_priority_min = 178,
223 sched_getaffinity = 179,
224 sched_getparam = 180,
225 sched_getscheduler = 181,
226 sched_rr_get_interval = 182,
227 sched_setaffinity = 183,
228 sched_setparam = 184,
229 sched_setscheduler = 185,
230 sched_yield = 186,
231 select = 187,
232 sendfile = 188,
233 sendfile64 = 189,
234 set_thread_area = 190,
235 set_tid_address = 191,
236 setdomainname = 192,
237 setfsgid = 193,
238 setfsgid32 = 194,
239 setfsuid = 195,
240 setfsuid32 = 196,
241 setgid = 197,
242 setgid32 = 198,
243 setgroups = 199,
244 setgroups32 = 200,
245 sethostname = 201,
246 setitimer = 202,
247 setpgid = 203,
248 setpriority = 204,
249 setregid = 205,
250 setregid32 = 206,
251 setresgid = 207,
252 setresgid32 = 208,
253 setresuid = 209,
254 setresuid32 = 210,
255 setreuid = 211,
256 setreuid32 = 212,
257 setrlimit = 213,
258 setsid = 214,
259 settimeofday = 215,
260 setuid = 216,
261 setuid32 = 217,
262 setxattr = 218,
263 sgetmask = 219,
264 sigaction = 220,
265 sigaltstack = 221,
266 signal = 222,
267 sigpending = 223,
268 sigprocmask = 224,
269 sigreturn = 225,
270 sigsuspend = 226,
271 socketcall = 227,
272 ssetmask = 228,
273 stat = 229,
274 stat64 = 230,
275 statfs = 231,
276 statfs64 = 232,
277 stime = 233,
278 stty = 234,
279 swapoff = 235,
280 swapon = 236,
281 symlink = 237,
282 sync = 238,
283 sysfs = 239,
284 sysinfo = 240,
285 syslog = 241,
286 tgkill = 242,
287 time = 243,
288 timer_create = 244,
289 timer_delete = 245,
290 timer_getoverrun = 246,
291 timer_gettime = 247,
292 timer_settime = 248,
293 times = 249,
294 tkill = 250,
295 truncate = 251,
296 truncate64 = 252,
297 ugetrlimit = 253,
298 ulimit = 254,
299 umask = 255,
300 umount = 256,
301 umount2 = 257,
302 uname = 258,
303 unlink = 259,
304 uselib = 260,
305 ustat = 261,
306 utime = 262,
307 utimes = 263,
308 vfork = 264,
309 vhangup = 265,
310 vm86 = 266,
311 vm86old = 267,
312 vserver = 268,
313 wait4 = 269,
314 waitpid = 270,
315 write = 271,
316 writev = 272,
317 Number
318 };
319
320 static const char *name(int num);
321
322 static bool validSyscallNumber(int num) {
323 return num < Number;
324 }
325
326 };
327
328 #endif // __KERN_LINUX_LINUX_SYSCALLS_HH__