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