Go to the documentation of this file.
37 #include "debug/SyscallVerbose.hh"
63 warn(
"Unknown operating system; assuming Linux.");
74 MipsLinuxObjectFileLoader loader;
84 strcpy(
name->sysname,
"Linux");
85 strcpy(
name->nodename,
"sim.gem5.org");
86 strcpy(
name->release, process->release.c_str());
87 strcpy(
name->version,
"#1 Mon Aug 18 11:32:15 EDT 2003");
88 strcpy(
name->machine,
"mips");
98 unsigned bufPtr,
unsigned nbytes)
110 cerr <<
"sys_getsysinfo: unknown op " <<
op << endl;
121 Addr bufPtr,
unsigned nbytes)
130 DPRINTFR(SyscallVerbose,
"sys_setsysinfo(SSI_IEEE_FP_CONTROL): "
131 " setting FPCR to 0x%x\n",
letoh(*fpcr));
135 cerr <<
"sys_setsysinfo: unknown op " <<
op << endl;
154 { 4003,
"read", readFunc<MipsLinux> },
155 { 4004,
"write", writeFunc<MipsLinux> },
156 { 4005,
"open", openFunc<MipsLinux> },
166 { 4015,
"chmod", chmodFunc<MipsLinux> },
169 { 4018,
"unused#18" },
179 { 4028,
"unused#28" },
205 { 4054,
"ioctl", ioctlFunc<MipsLinux> },
210 { 4059,
"unused#59" },
218 { 4067,
"sigaction" },
219 { 4068,
"sgetmask" },
220 { 4069,
"ssetmask" },
221 { 4070,
"setreuid" },
222 { 4071,
"setregid" },
223 { 4072,
"sigsuspend" },
224 { 4073,
"sigpending" },
226 { 4075,
"setrlimit" },
227 { 4076,
"getrlimit" },
228 { 4077,
"getrusage", getrusageFunc<MipsLinux> },
229 { 4078,
"gettimeofday" },
230 { 4079,
"settimeofday" },
231 { 4080,
"getgroups" },
232 { 4081,
"setgroups" },
233 { 4082,
"reserved#82" },
235 { 4084,
"unused#84" },
241 { 4090,
"mmap", mmapFunc<MipsLinux> },
245 { 4094,
"fchmod", fchmodFunc<MipsLinux> },
247 { 4096,
"getpriority" },
248 { 4097,
"setpriority" },
253 { 4102,
"socketcall" },
255 { 4104,
"setitimer" },
256 { 4105,
"getitimer" },
257 { 4106,
"stat", statFunc<MipsLinux> },
259 { 4108,
"fstat", fstatFunc<MipsLinux> },
260 { 4109,
"unused#109" },
267 { 4116,
"sysinfo", sysinfoFunc<MipsLinux> },
270 { 4119,
"sigreturn" },
272 { 4121,
"setdomainname" },
274 { 4123,
"modify_ldt" },
275 { 4124,
"adjtimex" },
277 { 4126,
"sigprocmask" },
278 { 4127,
"create_module" },
279 { 4128,
"init_module" },
280 { 4129,
"delete_module" },
281 { 4130,
"get_kernel_syms" },
282 { 4131,
"quotactl" },
287 { 4136,
"personality" },
288 { 4137,
"afs_syscall" },
289 { 4138,
"setfsuid" },
290 { 4139,
"setfsgid" },
292 { 4141,
"getdents" },
293 { 4142,
"newselect" },
297 { 4146,
"writev", writevFunc<MipsLinux> },
298 { 4147,
"cacheflush" },
299 { 4148,
"cachectl" },
301 { 4150,
"unused#150" },
303 { 4152,
"fdatasync" },
307 { 4156,
"mlockall" },
308 { 4157,
"munlockall" },
309 { 4158,
"sched_setparam" },
310 { 4159,
"sched_getparam" },
311 { 4160,
"sched_setscheduler" },
312 { 4161,
"sched_getscheduler" },
313 { 4162,
"sched_yield" },
314 { 4163,
"sched_get_prioritymax" },
315 { 4164,
"sched_get_priority_min" },
316 { 4165,
"sched_rr_get_interval" },
317 { 4166,
"nanosleep" },
318 { 4167,
"mremap", mremapFunc<MipsLinux> },
322 { 4171,
"getpeername" },
323 { 4172,
"getsockname" },
324 { 4173,
"getsockopt" },
331 { 4180,
"setsockopt" },
332 { 4181,
"shutdown" },
333 { 4182,
"unknown #182" },
335 { 4184,
"socketpair" },
336 { 4185,
"setresuid" },
337 { 4186,
"getresuid" },
338 { 4187,
"query_module" },
340 { 4189,
"nfsservctl" },
341 { 4190,
"setresgid" },
342 { 4191,
"getresgid" },
344 { 4193,
"rt_sigreturn" },
345 { 4194,
"rt_sigaction" },
346 { 4195,
"rt_sigprocmask" },
347 { 4196,
"rt_sigpending" },
348 { 4197,
"rt_sigtimedwait" },
350 { 4199,
"rt_sigsuspend" },
352 { 4201,
"pwrite64" },
357 { 4206,
"sigalstack" },
358 { 4207,
"sendfile" },
362 { 4211,
"truncate64" },
363 { 4212,
"ftruncate64" },
365 { 4214,
"lstat64", lstat64Func<MipsLinux> },
366 { 4215,
"fstat64", fstat64Func<MipsLinux> },
367 { 4216,
"pivot_root" },
370 { 4219,
"getdents64" },
372 { 4221,
"reserved#221" },
374 { 4223,
"readahead" },
375 { 4224,
"setxattr" },
376 { 4225,
"lsetxattr" },
377 { 4226,
"fsetxattr" },
378 { 4227,
"getxattr" },
379 { 4228,
"lgetxattr" },
380 { 4229,
"fgetxattr" },
381 { 4230,
"listxattr" },
382 { 4231,
"llistxattr" },
383 { 4232,
"flistxattr" },
384 { 4233,
"removexattr" },
385 { 4234,
"lremovexattr" },
388 { 4237,
"sendfile64" },
390 { 4239,
"sched_setaffinity" },
391 { 4240,
"sched_getaffinity" },
392 { 4241,
"io_setup" },
393 { 4242,
"io_destroy" },
394 { 4243,
"io_getevents" },
395 { 4244,
"io_submit" },
396 { 4245,
"io_cancel" },
398 { 4247,
"lookup_dcookie" },
399 { 4248,
"epoll_create" },
400 { 4249,
"epoll_ctl" },
401 { 4250,
"epoll_wait" },
402 { 4251,
"remap_file_pages" },
403 { 4252,
"set_tid_address" },
404 { 4253,
"restart_syscall" },
405 { 4254,
"fadvise64" },
406 { 4255,
"statfs64" },
407 { 4256,
"fstafs64" },
410 { 4259,
"timer_gettime" },
411 { 4260,
"timer_getoverrun" },
412 { 4261,
"timer_delete" },
413 { 4262,
"clock_settime" },
414 { 4263,
"clock_gettime" },
415 { 4264,
"clock_getres" },
416 { 4265,
"clock_nanosleep" },
420 { 4269,
"get_mempolicy" },
421 { 4270,
"set_mempolicy" },
423 { 4272,
"mq_unlink" },
424 { 4273,
"mq_timedsend" },
425 { 4274,
"mq_timedreceive" },
426 { 4275,
"mq_notify" },
427 { 4276,
"mq_getsetattr" },
430 { 4279,
"unknown #279" },
432 { 4281,
"request_key" },
435 { 4284,
"inotify_init" },
436 { 4285,
"inotify_add_watch" },
437 { 4286,
"inotify_rm_watch" },
438 { 4287,
"migrate_pages" },
442 { 4291,
"fchownat" },
443 { 4292,
"futimesat" },
444 { 4293,
"fstatat64" },
445 { 4294,
"unlinkat" },
446 { 4295,
"renameat" },
448 { 4297,
"symlinkat" },
449 { 4298,
"readlinkat" },
450 { 4299,
"fchmodat" },
451 { 4300,
"faccessat" },
452 { 4301,
"pselect6" },
456 { 4305,
"sync_file_range" },
458 { 4307,
"vmsplice" },
459 { 4308,
"move_pages" },
460 { 4309,
"set_robust_list" },
461 { 4310,
"get_robust_list" },
462 { 4311,
"kexec_load" },
464 { 4313,
"epoll_pwait" },
465 { 4314,
"ioprio_set" },
466 { 4315,
"ioprio_get" },
467 { 4316,
"utimensat" },
468 { 4317,
"signalfd" },
SyscallReturn geteuidFunc(SyscallDesc *desc, ThreadContext *tc)
Target geteuid() handler.
SyscallReturn munmapFunc(SyscallDesc *desc, ThreadContext *tc, Addr start, size_t length)
Target munmap() handler.
Each instance of a Loader subclass will have a chance to try to load an object file when tryLoaders i...
SyscallReturn ignoreFunc(SyscallDesc *desc, ThreadContext *tc)
Handler for unimplemented syscalls that we never intend to implement (signal handling,...
A process with emulated Mips/Linux syscalls.
SyscallReturn getpagesizeFunc(SyscallDesc *desc, ThreadContext *tc)
Target getpagesize() handler.
SyscallReturn chownFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname, uint32_t owner, uint32_t group)
Target chown() handler.
SyscallReturn mkdirFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname, mode_t mode)
Target mkdir() handler.
SyscallReturn unlinkFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname)
Target unlink() handler.
static SyscallReturn sys_setsysinfoFunc(SyscallDesc *desc, ThreadContext *tc, unsigned op, Addr bufPtr, unsigned nbytes)
Target sys_setsysinfo() handler.
static SyscallDescTable< SyscallABI > syscallDescs
Syscall descriptors, indexed by call number.
SyscallReturn getegidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getegid() handler.
virtual Process * getProcessPtr()=0
SyscallReturn ftruncateFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, off_t length)
Target ftruncate() handler.
SyscallReturn umaskFunc(SyscallDesc *desc, ThreadContext *tc)
Target umask() handler.
virtual void syscall(ThreadContext *tc)
void syscall(ThreadContext *tc) override
SyscallReturn lseekFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint64_t offs, int whence)
Target lseek() handler.
SyscallReturn exitFunc(SyscallDesc *desc, ThreadContext *tc, int status)
Target exit() handler: terminate current context.
SyscallReturn getpidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getpid() handler.
SyscallReturn brkFunc(SyscallDesc *desc, ThreadContext *tc, Addr new_brk)
Target brk() handler: set brk address.
SyscallReturn fchownFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint32_t owner, uint32_t group)
Target fchown() handler.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
SyscallReturn readlinkFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname, Addr buf_ptr, size_t bufsiz)
Target readlink() handler.
SyscallReturn truncateFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname, off_t length)
Target truncate() handler.
static SyscallReturn sys_getsysinfoFunc(SyscallDesc *desc, ThreadContext *tc, unsigned op, unsigned bufPtr, unsigned nbytes)
Target sys_getsysyinfo() handler.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
This class represents the return value from an emulated system call, including any errno setting.
const std::string & name()
void doSyscall(ThreadContext *tc)
Interface for invoking the system call funcion pointer.
SyscallReturn fcntlFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int cmd, GuestABI::VarArgs< int > varargs)
Target fcntl() handler.
SyscallReturn getcwdFunc(SyscallDesc *desc, ThreadContext *tc, Addr buf_ptr, unsigned long size)
Target getcwd() handler.
SyscallReturn getuidFunc(SyscallDesc *desc, ThreadContext *tc)
SyscallReturn closeFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd)
Target close() handler.
Overload hash function for BasicBlockRange type.
SyscallReturn gethostnameFunc(SyscallDesc *desc, ThreadContext *tc, Addr buf_ptr, int name_len)
Target gethostname() handler.
static SyscallReturn unameFunc(SyscallDesc *desc, ThreadContext *tc, VPtr< Linux::utsname > name)
Target uname() handler.
SyscallReturn fcntl64Func(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int cmd)
Target fcntl64() handler.
virtual void setMiscRegNoEffect(RegIndex misc_reg, RegVal val)=0
static SyscallReturn setThreadAreaFunc(SyscallDesc *desc, ThreadContext *tc, Addr addr)
SyscallDesc * get(int num, bool fatal_if_missing=true)
virtual RegVal readIntReg(RegIndex reg_idx) const =0
SyscallReturn getgidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getgid() handler.
SyscallReturn pipePseudoFunc(SyscallDesc *desc, ThreadContext *tc)
Pseudo Funcs - These functions use a different return convension, returning a second value in a regis...
MipsLinuxProcess(ProcessParams *params, ::Loader::ObjectFile *objFile)
Constructor.
This class provides the wrapper interface for the system call implementations which are defined in th...
Generated on Wed Sep 30 2020 14:01:59 for gem5 by doxygen 1.8.17