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