change the naming of MainBins. didn't check this in before because i had random...
[gem5.git] / kern / tru64 / tru64_syscalls.cc
1 /*
2 * Copyright (c) 2003 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/tru64/tru64_syscalls.hh"
30
31 namespace {
32 const char *
33 standard_strings[SystemCalls<Tru64>::StandardNumber] = {
34 "syscall", // 0
35 "exit", // 1
36 "fork", // 2
37 "read", // 3
38 "write", // 4
39 "old_open", // 5
40 "close", // 6
41 "wait4", // 7
42 "old_creat", // 8
43 "link", // 9
44
45 "unlink", // 10
46 "execv", // 11
47 "chdir", // 12
48 "fchdir", // 13
49 "mknod", // 14
50 "chmod", // 15
51 "chown", // 16
52 "obreak", // 17
53 "pre_F64_getfsstat", // 18
54 "lseek", // 19
55
56 "getpid", // 20
57 "mount", // 21
58 "unmount", // 22
59 "setuid", // 23
60 "getuid", // 24
61 "exec_with_loader", // 25
62 "ptrace", // 26
63 "recvmsg", // 27
64 "sendmsg", // 28
65 "recvfrom", // 29
66
67 "accept", // 30
68 "getpeername", // 31
69 "getsockname", // 32
70 "access", // 33
71 "chflags", // 34
72 "fchflags", // 35
73 "sync", // 36
74 "kill", // 37
75 "old_stat", // 38
76 "setpgid", // 39
77
78 "old_lstat", // 40
79 "dup", // 41
80 "pipe", // 42
81 "set_program_attributes", // 43
82 "profil", // 44
83 "open", // 45
84 "obsolete_osigaction", // 46
85 "getgid", // 47
86 "sigprocmask", // 48
87 "getlogin", // 49
88
89 "setlogin", // 50
90 "acct", // 51
91 "sigpending", // 52
92 "classcntl", // 53
93 "ioctl", // 54
94 "reboot", // 55
95 "revoke", // 56
96 "symlink", // 57
97 "readlink", // 58
98 "execve", // 59
99
100 "umask", // 60
101 "chroot", // 61
102 "old_fstat", // 62
103 "getpgrp", // 63
104 "getpagesize", // 64
105 "mremap", // 65
106 "vfork", // 66
107 "pre_F64_stat", // 67
108 "pre_F64_lstat", // 68
109 "sbrk", // 69
110
111 "sstk", // 70
112 "mmap", // 71
113 "ovadvise", // 72
114 "munmap", // 73
115 "mprotect", // 74
116 "madvise", // 75
117 "old_vhangup", // 76
118 "kmodcall", // 77
119 "mincore", // 78
120 "getgroups", // 79
121
122 "setgroups", // 80
123 "old_getpgrp", // 81
124 "setpgrp", // 82
125 "setitimer", // 83
126 "old_wait", // 84
127 "table", // 85
128 "getitimer", // 86
129 "gethostname", // 87
130 "sethostname", // 88
131 "getdtablesize", // 89
132
133 "dup2", // 90
134 "pre_F64_fstat", // 91
135 "fcntl", // 92
136 "select", // 93
137 "poll", // 94
138 "fsync", // 95
139 "setpriority", // 96
140 "socket", // 97
141 "connect", // 98
142 "old_accept", // 99
143
144 "getpriority", // 100
145 "old_send", // 101
146 "old_recv", // 102
147 "sigreturn", // 103
148 "bind", // 104
149 "setsockopt", // 105
150 "listen", // 106
151 "plock", // 107
152 "old_sigvec", // 108
153 "old_sigblock", // 109
154
155 "old_sigsetmask", // 110
156 "sigsuspend", // 111
157 "sigstack", // 112
158 "old_recvmsg", // 113
159 "old_sendmsg", // 114
160 "obsolete_vtrcae", // 115
161 "gettimeofday", // 116
162 "getrusage", // 117
163 "getsockopt", // 118
164 "numa_syscalls", // 119
165
166 "readv", // 120
167 "writev", // 121
168 "settimeofday", // 122
169 "fchown", // 123
170 "fchmod", // 124
171 "old_recvfrom", // 125
172 "setreuid", // 126
173 "setregid", // 127
174 "rename", // 128
175 "truncate", // 129
176
177 "ftruncate", // 130
178 "flock", // 131
179 "setgid", // 132
180 "sendto", // 133
181 "shutdown", // 134
182 "socketpair", // 135
183 "mkdir", // 136
184 "rmdir", // 137
185 "utimes", // 138
186 "obsolete_42_sigreturn", // 139
187
188 "adjtime", // 140
189 "old_getpeername", // 141
190 "gethostid", // 142
191 "sethostid", // 143
192 "getrlimit", // 144
193 "setrlimit", // 145
194 "old_killpg", // 146
195 "setsid", // 147
196 "quotactl", // 148
197 "oldquota", // 149
198
199 "old_getsockname", // 150
200 "pread", // 151
201 "pwrite", // 152
202 "pid_block", // 153
203 "pid_unblock", // 154
204 "signal_urti", // 155
205 "sigaction", // 156
206 "sigwaitprim", // 157
207 "nfssvc", // 158
208 "getdirentries", // 159
209
210 "pre_F64_statfs", // 160
211 "pre_F64_fstatfs", // 161
212 0, // 162
213 "async_daemon", // 163
214 "getfh", // 164
215 "getdomainname", // 165
216 "setdomainname", // 166
217 0, // 167
218 0, // 168
219 "exportfs", // 169
220
221 0, // 170
222 0, // 171
223 0, // 172
224 0, // 173
225 0, // 174
226 0, // 175
227 0, // 176
228 0, // 177
229 0, // 178
230 0, // 179
231
232 0, // 180
233 "alt_plock", // 181
234 0, // 182
235 0, // 183
236 "getmnt", // 184
237 0, // 185
238 0, // 186
239 "alt_sigpending", // 187
240 "alt_setsid", // 188
241 0, // 189
242
243 0, // 190
244 0, // 191
245 0, // 192
246 0, // 193
247 0, // 194
248 0, // 195
249 0, // 196
250 0, // 197
251 0, // 198
252 "swapon", // 199
253
254 "msgctl", // 200
255 "msgget", // 201
256 "msgrcv", // 202
257 "msgsnd", // 203
258 "semctl", // 204
259 "semget", // 205
260 "semop", // 206
261 "uname", // 207
262 "lchown", // 208
263 "shmat", // 209
264
265 "shmctl", // 210
266 "shmdt", // 211
267 "shmget", // 212
268 "mvalid", // 213
269 "getaddressconf", // 214
270 "msleep", // 215
271 "mwakeup", // 216
272 "msync", // 217
273 "signal", // 218
274 "utc_gettime", // 219
275
276 "utc_adjtime", // 220
277 0, // 221
278 "security", // 222
279 "kloadcall", // 223
280 "stat", // 224
281 "lstat", // 225
282 "fstat", // 226
283 "statfs", // 227
284 "fstatfs", // 228
285 "getfsstat", // 229
286
287 "gettimeofday64", // 230
288 "settimeofday64", // 231
289 0, // 232
290 "getpgid", // 233
291 "getsid", // 234
292 "sigaltstack", // 235
293 "waitid", // 236
294 "priocntlset", // 237
295 "sigsendset", // 238
296 "set_speculative", // 239
297
298 "msfs_syscall", // 240
299 "sysinfo", // 241
300 "uadmin", // 242
301 "fuser", // 243
302 "proplist_syscall", // 244
303 "ntp_adjtime", // 245
304 "ntp_gettime", // 246
305 "pathconf", // 247
306 "fpathconf", // 248
307 "sync2", // 249
308
309 "uswitch", // 250
310 "usleep_thread", // 251
311 "audcntl", // 252
312 "audgen", // 253
313 "sysfs", // 254
314 "subsys_info", // 255
315 "getsysinfo", // 256
316 "setsysinfo", // 257
317 "afs_syscall", // 258
318 "swapctl", // 259
319
320 "memcntl", // 260
321 "fdatasync", // 261
322 "oflock", // 262
323 "_F64_readv", // 263
324 "_F64_writev", // 264
325 "cdslxlate", // 265
326 "sendfile", // 266
327 };
328
329 const char *
330 mach_strings[SystemCalls<Tru64>::MachNumber] = {
331 0, // 0
332 0, // 1
333 0, // 2
334 0, // 3
335 0, // 4
336 0, // 5
337 0, // 6
338 0, // 7
339 0, // 8
340 0, // 9
341
342 "task_self", // 10
343 "thread_reply", // 11
344 "task_notify", // 12
345 "thread_self", // 13
346 0, // 14
347 0, // 15
348 0, // 16
349 0, // 17
350 0, // 18
351 0, // 19
352
353 "msg_send_trap", // 20
354 "msg_receive_trap", // 21
355 "msg_rpc_trap", // 22
356 0, // 23
357 "nxm_block", // 24
358 "nxm_unblock", // 25
359 0, // 26
360 0, // 27
361 0, // 28
362 "nxm_thread_destroy", // 29
363
364 "lw_wire", // 30
365 "lw_unwire", // 31
366 "nxm_thread_create", // 32
367 "nxm_task_init", // 33
368 0, // 34
369 "nxm_idle", // 35
370 "nxm_wakeup_idle", // 36
371 "nxm_set_pthid", // 37
372 "nxm_thread_kill", // 38
373 "nxm_thread_block", // 39
374
375 "nxm_thread_wakeup", // 40
376 "init_process", // 41
377 "nxm_get_binding", // 42
378 "map_fd", // 43
379 "nxm_resched", // 44
380 "nxm_set_cancel", // 45
381 "nxm_set_binding", // 46
382 "stack_create", // 47
383 "nxm_get_state", // 48
384 "nxm_thread_suspend", // 49
385
386 "nxm_thread_resume", // 50
387 "nxm_signal_check", // 51
388 "htg_unix_syscall", // 52
389 0, // 53
390 0, // 54
391 "host_self", // 55
392 "host_priv_self", // 56
393 0, // 57
394 0, // 58
395 "swtch_pri", // 59
396
397 "swtch", // 60
398 "thread_switch", // 61
399 "semop_fast", // 62
400 "nxm_pshared_init", // 63
401 "nxm_pshared_block", // 64
402 "nxm_pshared_unblock", // 65
403 "nxm_pshared_destroy", // 66
404 "nxm_swtch_pri", // 67
405 "lw_syscall", // 68
406 0, // 69
407
408 "mach_sctimes_0", // 70
409 "mach_sctimes_1", // 71
410 "mach_sctimes_2", // 72
411 "mach_sctimes_3", // 73
412 "mach_sctimes_4", // 74
413 "mach_sctimes_5", // 75
414 "mach_sctimes_6", // 76
415 "mach_sctimes_7", // 77
416 "mach_sctimes_8", // 78
417 "mach_sctimes_9", // 79
418
419 "mach_sctimes_10", // 80
420 "mach_sctimes_11", // 81
421 "mach_sctimes_port_alloc_dealloc", // 82
422 };
423 }
424
425 const char *
426 SystemCalls<Tru64>::name(int num)
427 {
428 if (num >= Number)
429 return 0;
430 else if (num >= StandardNumber)
431 return mach_strings[num - StandardNumber];
432 else if (num >= 0)
433 return standard_strings[num];
434 else if (num > -MachNumber)
435 return mach_strings[-num];
436 else
437 return 0;
438 }