summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2015-05-05 09:25:59 -0700
committerSteve Reinhardt <steve.reinhardt@amd.com>2015-05-05 09:25:59 -0700
commitc65fa3dceb2163967bbb7199013e9fccdc6ff46c (patch)
treef31fe624e5923d05433fae473512eba6fb39e061 /src/arch
parent40e180ecbe2e8201c9a0bc9b6676c9f030e95fdd (diff)
downloadgem5-c65fa3dceb2163967bbb7199013e9fccdc6ff46c.tar.xz
syscall_emul: fix warn_once behavior
The current ignoreWarnOnceFunc doesn't really work as expected, since it will only generate one warning total, for whichever "warn-once" syscall is invoked first. This patch fixes that behavior by keeping a "warned" flag in the SyscallDesc object, allowing suitably flagged syscalls to warn exactly once per syscall.
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/arm/linux/process.cc14
-rw-r--r--src/arch/x86/linux/process.cc6
2 files changed, 10 insertions, 10 deletions
diff --git a/src/arch/arm/linux/process.cc b/src/arch/arm/linux/process.cc
index 269e92bae..223db7afd 100644
--- a/src/arch/arm/linux/process.cc
+++ b/src/arch/arm/linux/process.cc
@@ -245,7 +245,7 @@ static SyscallDesc syscallDescs32[] = {
/* 123 */ SyscallDesc("unused#123", unimplementedFunc),
/* 124 */ SyscallDesc("adjtimex", unimplementedFunc),
/* 125 */ SyscallDesc("mprotect", ignoreFunc),
- /* 126 */ SyscallDesc("sigprocmask", ignoreWarnOnceFunc),
+ /* 126 */ SyscallDesc("sigprocmask", ignoreFunc, SyscallDesc::WarnOnce),
/* 127 */ SyscallDesc("unused#127", unimplementedFunc),
/* 128 */ SyscallDesc("init_module", unimplementedFunc),
/* 129 */ SyscallDesc("delete_module", unimplementedFunc),
@@ -281,7 +281,7 @@ static SyscallDesc syscallDescs32[] = {
/* 159 */ SyscallDesc("sched_get_priority_max", unimplementedFunc),
/* 160 */ SyscallDesc("sched_get_priority_min", unimplementedFunc),
/* 161 */ SyscallDesc("sched_rr_get_interval", unimplementedFunc),
- /* 162 */ SyscallDesc("nanosleep", ignoreWarnOnceFunc),
+ /* 162 */ SyscallDesc("nanosleep", ignoreFunc, SyscallDesc::WarnOnce),
/* 163 */ SyscallDesc("mremap", mremapFunc<ArmLinux32>), // ARM-specific
/* 164 */ SyscallDesc("setresuid", unimplementedFunc),
/* 165 */ SyscallDesc("getresuid", unimplementedFunc),
@@ -293,8 +293,8 @@ static SyscallDesc syscallDescs32[] = {
/* 171 */ SyscallDesc("getresgid", unimplementedFunc),
/* 172 */ SyscallDesc("prctl", unimplementedFunc),
/* 173 */ SyscallDesc("rt_sigreturn", unimplementedFunc),
- /* 174 */ SyscallDesc("rt_sigaction", ignoreWarnOnceFunc),
- /* 175 */ SyscallDesc("rt_sigprocmask", ignoreWarnOnceFunc),
+ /* 174 */ SyscallDesc("rt_sigaction", ignoreFunc, SyscallDesc::WarnOnce),
+ /* 175 */ SyscallDesc("rt_sigprocmask", ignoreFunc, SyscallDesc::WarnOnce),
/* 176 */ SyscallDesc("rt_sigpending", unimplementedFunc),
/* 177 */ SyscallDesc("rt_sigtimedwait", unimplementedFunc),
/* 178 */ SyscallDesc("rt_sigqueueinfo", ignoreFunc),
@@ -359,7 +359,7 @@ static SyscallDesc syscallDescs32[] = {
/* 237 */ SyscallDesc("fremovexattr", unimplementedFunc),
/* 238 */ SyscallDesc("tkill", unimplementedFunc),
/* 239 */ SyscallDesc("sendfile64", unimplementedFunc),
- /* 240 */ SyscallDesc("futex", ignoreWarnOnceFunc),
+ /* 240 */ SyscallDesc("futex", ignoreFunc, SyscallDesc::WarnOnce),
/* 241 */ SyscallDesc("sched_setaffinity", unimplementedFunc),
/* 242 */ SyscallDesc("sched_getaffinity", unimplementedFunc),
/* 243 */ SyscallDesc("io_setup", unimplementedFunc),
@@ -589,7 +589,7 @@ static SyscallDesc syscallDescs64[] = {
/* 98 */ SyscallDesc("futex", unimplementedFunc),
/* 99 */ SyscallDesc("set_robust_list", unimplementedFunc),
/* 100 */ SyscallDesc("get_robust_list", unimplementedFunc),
- /* 101 */ SyscallDesc("nanosleep", ignoreWarnOnceFunc),
+ /* 101 */ SyscallDesc("nanosleep", ignoreFunc, SyscallDesc::WarnOnce),
/* 102 */ SyscallDesc("getitimer", unimplementedFunc),
/* 103 */ SyscallDesc("setitimer", unimplementedFunc),
/* 104 */ SyscallDesc("kexec_load", unimplementedFunc),
@@ -623,7 +623,7 @@ static SyscallDesc syscallDescs64[] = {
/* 132 */ SyscallDesc("sigaltstack", unimplementedFunc),
/* 133 */ SyscallDesc("rt_sigsuspend", unimplementedFunc),
/* 134 */ SyscallDesc("rt_sigaction", ignoreFunc),
- /* 135 */ SyscallDesc("rt_sigprocmask", ignoreWarnOnceFunc),
+ /* 135 */ SyscallDesc("rt_sigprocmask", ignoreFunc, SyscallDesc::WarnOnce),
/* 136 */ SyscallDesc("rt_sigpending", unimplementedFunc),
/* 137 */ SyscallDesc("rt_sigtimedwait", unimplementedFunc),
/* 138 */ SyscallDesc("rt_sigqueueinfo", ignoreFunc),
diff --git a/src/arch/x86/linux/process.cc b/src/arch/x86/linux/process.cc
index 9a2bb96b5..ed17d7388 100644
--- a/src/arch/x86/linux/process.cc
+++ b/src/arch/x86/linux/process.cc
@@ -231,8 +231,8 @@ static SyscallDesc syscallDescs64[] = {
/* 10 */ SyscallDesc("mprotect", ignoreFunc),
/* 11 */ SyscallDesc("munmap", munmapFunc),
/* 12 */ SyscallDesc("brk", brkFunc),
- /* 13 */ SyscallDesc("rt_sigaction", ignoreFunc),
- /* 14 */ SyscallDesc("rt_sigprocmask", ignoreFunc),
+ /* 13 */ SyscallDesc("rt_sigaction", ignoreFunc, SyscallDesc::WarnOnce),
+ /* 14 */ SyscallDesc("rt_sigprocmask", ignoreFunc, SyscallDesc::WarnOnce),
/* 15 */ SyscallDesc("rt_sigreturn", unimplementedFunc),
/* 16 */ SyscallDesc("ioctl", ioctlFunc<X86Linux64>),
/* 17 */ SyscallDesc("pread64", unimplementedFunc),
@@ -253,7 +253,7 @@ static SyscallDesc syscallDescs64[] = {
/* 32 */ SyscallDesc("dup", dupFunc),
/* 33 */ SyscallDesc("dup2", unimplementedFunc),
/* 34 */ SyscallDesc("pause", unimplementedFunc),
- /* 35 */ SyscallDesc("nanosleep", unimplementedFunc),
+ /* 35 */ SyscallDesc("nanosleep", ignoreFunc, SyscallDesc::WarnOnce),
/* 36 */ SyscallDesc("getitimer", unimplementedFunc),
/* 37 */ SyscallDesc("alarm", unimplementedFunc),
/* 38 */ SyscallDesc("setitimer", unimplementedFunc),