Merge ktlim@zamp:/z/ktlim2/clean/m5-o3
[gem5.git] / src / kern / linux / linux_syscalls.cc
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 #include "kern/linux/linux_syscalls.hh"
32
33 namespace {
34 const char *
35 standard_strings[SystemCalls<Linux>::Number] = {
36
37
38 "llseek", //0
39 "newselect", //1
40 "sysctl", //2
41 "access", //3
42 "acct", //4
43 "adjtimex", //5
44 "afs_syscall", //6
45 "alarm", //7
46 "bdflush", //8
47 "break", //9
48
49
50 "brk", //10
51 "capget", //11
52 "capset", //12
53 "chdir", //13
54 "chmod", //14
55 "chown", //15
56 "chown32", //16
57 "chroot", //17
58 "clock_getres", //18
59 "clock_gettime", //19
60
61
62 "clock_nanosleep", //20
63 "clock_settime", //21
64 "clone", //22
65 "close", //23
66 "creat", //24
67 "create_module", //25
68 "delete_module", //26
69 "dup", //27
70 "dup2", //28
71 "epoll_create", //29
72
73
74 "epoll_ctl", //30
75 "epoll_wait", //31
76 "execve", //32
77 "exit", //33
78 "exit_group", //34
79 "fadvise64", //35
80 "fadvise64_64", //36
81 "fchdir", //37
82 "fchmod", //38
83 "fchown", //39
84
85
86 "fchown32", //40
87 "fcntl", //41
88 "fcntl64", //42
89 "fdatasync", //43
90 "fgetxattr", //44
91 "flistxattr", //45
92 "flock", //46
93 "fork", //47
94 "fremovexattr", //48
95 "fsetxattr", //49
96
97
98 "fstat", //50
99 "fstat64", //51
100 "fstatfs", //52
101 "fstatfs64", //53
102 "fsync", //54
103 "ftime", //55
104 "ftruncate", //56
105 "ftruncate64", //57
106 "futex", //58
107 "get_kernel_syms", //59
108
109
110 "get_thread_area", //60
111 "getcwd", //61
112 "getdents", //62
113 "getdents64", //63
114 "getegid", //64
115 "getegid32", //65
116 "geteuid", //66
117 "geteuid32", //67
118 "getgid", //68
119 "getgid32", //69
120
121
122 "getgroups", //70
123 "getgroups32", //71
124 "getitimer", //72
125 "getpgid", //73
126 "getpgrp", //74
127 "getpid", //75
128 "getpmsg", //76
129 "getppid", //77
130 "getpriority", //78
131 "getresgid", //79
132
133
134 "getresgid32", //80
135 "getresuid", //81
136 "getresuid32", //82
137 "getrlimit", //83
138 "getrusage", //84
139 "getsid", //85
140 "gettid", //86
141 "gettimeofday", //87
142 "getuid", //88
143 "getuid32", //89
144
145
146 "getxattr", //90
147 "gtty", //91
148 "idle", //92
149 "init_module", //93
150 "io_cancel", //94
151 "io_destroy", //95
152 "io_getevents", //96
153 "io_setup", //97
154 "io_submit", //98
155 "ioctl", //99
156
157
158 "ioperm", //100
159 "iopl", //101
160 "ipc", //102
161 "kill", //103
162 "lchown", //104
163 "lchown32", //105
164 "lgetxattr", //106
165 "link", //107
166 "listxattr", //108
167 "llistxattr", //109
168
169
170 "lock", //110
171 "lookup_dcookie", //111
172 "lremovexattr", //112
173 "lseek", //113
174 "lsetxattr", //114
175 "lstat", //115
176 "lstat64", //116
177 "madvise", //117
178 "madvise1", //118
179 "mincore", //119
180
181
182 "mkdir", //120
183 "mknod", //121
184 "mlock", //122
185 "mlockall", //123
186 "mmap", //124
187 "mmap2", //125
188 "modify_ldt", //126
189 "mount", //127
190 "mprotect", //128
191 "mpx", //129
192
193
194 "mremap", //130
195 "msync", //131
196 "munlock", //132
197 "munlockall", //133
198 "munmap", //134
199 "nanosleep", //135
200 "nfsservctl", //136
201 "nice", //137
202 "oldfstat", //138
203 "oldlstat", //139
204
205
206 "oldolduname", //140
207 "oldstat", //141
208 "olduname", //142
209 "open", //143
210 "pause", //144
211 "personality", //145
212 "pipe", //146
213 "pivot_root", //147
214 "poll", //148
215 "prctl", //149
216
217
218 "pread64", //150
219 "prof", //151
220 "profil", //152
221 "ptrace", //153
222 "putpmsg", //154
223 "pwrite64", //155
224 "query_module", //156
225 "quotactl", //157
226 "read", //158
227 "readahead", //159
228
229
230 "readdir", //160
231 "readlink", //161
232 "readv", //162
233 "reboot", //163
234 "remap_file_pages", //164
235 "removexattr", //165
236 "rename", //166
237 "restart_syscall", //167
238 "rmdir", //168
239 "rt_sigaction", //169
240
241
242 "rt_sigpending", //170
243 "rt_sigprocmask", //171
244 "rt_sigqueueinfo", //172
245 "rt_sigreturn", //173
246 "rt_sigsuspend", //174
247 "rt_sigtimedwait", //175
248 "sched_get_priority_max", //176
249 "sched_get_priority_min", //177
250 "sched_getaffinity", //178
251 "sched_getparam", //179
252
253
254 "sched_getscheduler", //180
255 "sched_rr_get_interval", //181
256 "sched_setaffinity", //182
257 "sched_setparam", //183
258 "sched_setscheduler", //184
259 "sched_yield", //185
260 "select", //186
261 "sendfile", //187
262 "sendfile64", //188
263 "set_thread_area", //189
264
265
266 "set_tid_address", //190
267 "setdomainname", //191
268 "setfsgid", //192
269 "setfsgid32", //193
270 "setfsuid", //194
271 "setfsuid32", //195
272 "setgid", //196
273 "setgid32", //197
274 "setgroups", //198
275 "setgroups32", //199
276
277
278 "sethostname", //200
279 "setitimer", //201
280 "setpgid", //202
281 "setpriority", //203
282 "setregid", //204
283 "setregid32", //205
284 "setresgid", //206
285 "setresgid32", //207
286 "setresuid", //208
287 "setresuid32", //209
288
289
290 "setreuid", //210
291 "setreuid32", //211
292 "setrlimit", //212
293 "setsid", //213
294 "settimeofday", //214
295 "setuid", //215
296 "setuid32", //216
297 "setxattr", //217
298 "sgetmask", //218
299 "sigaction", //219
300
301
302 "sigaltstack", //220
303 "signal", //221
304 "sigpending", //222
305 "sigprocmask", //223
306 "sigreturn", //224
307 "sigsuspend", //225
308 "socketcall", //226
309 "ssetmask", //227
310 "stat", //228
311 "stat64", //229
312
313
314 "statfs", //230
315 "statfs64", //231
316 "stime", //232
317 "stty", //233
318 "swapoff", //234
319 "swapon", //235
320 "symlink", //236
321 "sync", //237
322 "sysfs", //238
323 "sysinfo", //239
324
325
326 "syslog", //240
327 "tgkill", //241
328 "time", //242
329 "timer_create", //243
330 "timer_delete", //244
331 "timer_getoverrun", //245
332 "timer_gettime", //246
333 "timer_settime", //247
334 "times", //248
335 "tkill", //249
336
337
338 "truncate", //250
339 "truncate64", //251
340 "ugetrlimit", //252
341 "ulimit", //253
342 "umask", //254
343 "umount", //255
344 "umount2", //256
345 "uname", //257
346 "unlink", //258
347 "uselib", //259
348
349
350 "ustat", //260
351 "utime", //261
352 "utimes", //262
353 "vfork", //263
354 "vhangup", //264
355 "vm86", //265
356 "vm86old", //266
357 "vserver", //267
358 "wait4", //268
359 "waitpid", //269
360
361
362 "write", //270
363 "writev", //271
364 };
365
366
367 }
368
369 const char *
370 SystemCalls<Linux>::name(int num)
371 {
372 if ((num >= 0) && (num < Number))
373 return standard_strings[num];
374 else
375 return 0;
376 }