summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2004-02-10 21:43:57 -0800
committerSteve Reinhardt <stever@eecs.umich.edu>2004-02-10 21:43:57 -0800
commitd38f995aeec761879865ea2ab30128da4c5cdaf8 (patch)
tree073ff08b8d931f9de9db5a025b6f5c3ddf374e32 /arch
parentf1aca5e6c52551b21ec864a4d8e88ddc2430c67e (diff)
downloadgem5-d38f995aeec761879865ea2ab30128da4c5cdaf8.tar.xz
Fixes for Linux syscall emulation.
arch/alpha/alpha_linux_process.cc: Fixes for Linux emulation: - stat struct alignment - osf_{get,set}sysinfo return values - additional syscall numbers - initialize $r0 to 0 sim/syscall_emul.cc: brk(0) just returns brk value (don't update it!) --HG-- extra : convert_revision : 78e22458321c81e81540d101c9e65e2e4b0ad117
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/alpha_linux_process.cc41
1 files changed, 37 insertions, 4 deletions
diff --git a/arch/alpha/alpha_linux_process.cc b/arch/alpha/alpha_linux_process.cc
index ae197d1ac..b9eb42a21 100644
--- a/arch/alpha/alpha_linux_process.cc
+++ b/arch/alpha/alpha_linux_process.cc
@@ -106,6 +106,7 @@ class Linux {
uint32_t st_uid; //!< owner's user ID
uint32_t st_gid; //!< owner's group ID
uint32_t st_rdev; //!< device number
+ int32_t _pad1; //!< for alignment
int64_t st_size; //!< file size in bytes
uint64_t st_atimeX; //!< time of last access
uint64_t st_mtimeX; //!< time of last modification
@@ -264,7 +265,7 @@ class Linux {
// I don't think this exactly matches the HW FPCR
*fpcr = 0;
fpcr.copyOut(xc->mem);
- return 1;
+ return 0;
}
default:
@@ -273,7 +274,7 @@ class Linux {
break;
}
- return 0;
+ return 1;
}
/// Target osf_setsysinfo() handler.
@@ -292,7 +293,7 @@ class Linux {
fpcr.copyIn(xc->mem);
DPRINTFR(SyscallVerbose, "osf_setsysinfo(SSI_IEEE_FP_CONTROL): "
" setting FPCR to 0x%x\n", *(uint64_t*)fpcr);
- return 1;
+ return 0;
}
default:
@@ -301,7 +302,7 @@ class Linux {
break;
}
- return 0;
+ return 1;
}
/// Target fnctl() handler.
@@ -810,6 +811,37 @@ SyscallDesc Linux::syscallDescs[] = {
/* 391 */ SyscallDesc("removexattr", unimplementedFunc),
/* 392 */ SyscallDesc("lremovexattr", unimplementedFunc),
/* 393 */ SyscallDesc("fremovexattr", unimplementedFunc),
+ /* 394 */ SyscallDesc("futex", unimplementedFunc),
+ /* 395 */ SyscallDesc("sched_setaffinity", unimplementedFunc),
+ /* 396 */ SyscallDesc("sched_getaffinity", unimplementedFunc),
+ /* 397 */ SyscallDesc("tuxcall", unimplementedFunc),
+ /* 398 */ SyscallDesc("io_setup", unimplementedFunc),
+ /* 399 */ SyscallDesc("io_destroy", unimplementedFunc),
+ /* 400 */ SyscallDesc("io_getevents", unimplementedFunc),
+ /* 401 */ SyscallDesc("io_submit", unimplementedFunc),
+ /* 402 */ SyscallDesc("io_cancel", unimplementedFunc),
+ /* 403 */ SyscallDesc("unknown #403", unimplementedFunc),
+ /* 404 */ SyscallDesc("unknown #404", unimplementedFunc),
+ /* 405 */ SyscallDesc("exit_group", exitFunc), // exit all threads...
+ /* 406 */ SyscallDesc("lookup_dcookie", unimplementedFunc),
+ /* 407 */ SyscallDesc("sys_epoll_create", unimplementedFunc),
+ /* 408 */ SyscallDesc("sys_epoll_ctl", unimplementedFunc),
+ /* 409 */ SyscallDesc("sys_epoll_wait", unimplementedFunc),
+ /* 410 */ SyscallDesc("remap_file_pages", unimplementedFunc),
+ /* 411 */ SyscallDesc("set_tid_address", unimplementedFunc),
+ /* 412 */ SyscallDesc("restart_syscall", unimplementedFunc),
+ /* 413 */ SyscallDesc("fadvise64", unimplementedFunc),
+ /* 414 */ SyscallDesc("timer_create", unimplementedFunc),
+ /* 415 */ SyscallDesc("timer_settime", unimplementedFunc),
+ /* 416 */ SyscallDesc("timer_gettime", unimplementedFunc),
+ /* 417 */ SyscallDesc("timer_getoverrun", unimplementedFunc),
+ /* 418 */ SyscallDesc("timer_delete", unimplementedFunc),
+ /* 419 */ SyscallDesc("clock_settime", unimplementedFunc),
+ /* 420 */ SyscallDesc("clock_gettime", unimplementedFunc),
+ /* 421 */ SyscallDesc("clock_getres", unimplementedFunc),
+ /* 422 */ SyscallDesc("clock_nanosleep", unimplementedFunc),
+ /* 423 */ SyscallDesc("semtimedop", unimplementedFunc),
+ /* 424 */ SyscallDesc("tgkill", unimplementedFunc)
};
const int Linux::Num_Syscall_Descs =
@@ -838,4 +870,5 @@ AlphaLinuxProcess::AlphaLinuxProcess(const std::string &name,
std::vector<std::string> &envp)
: LiveProcess(name, objFile, stdin_fd, stdout_fd, stderr_fd, argv, envp)
{
+ init_regs->intRegFile[0] = 0;
}