summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-04-19 04:15:32 -0700
committerGabe Black <gblack@eecs.umich.edu>2009-04-19 04:15:32 -0700
commitca8598147835cc3bf4cb6125b4f32cbd941f1ae7 (patch)
tree66b6a0f9e09c2988a56962dcd0b66a4b80dd35c1 /src/arch/x86
parentb8333a5155d1231dc1e76762de6ece23ea702d8a (diff)
downloadgem5-ca8598147835cc3bf4cb6125b4f32cbd941f1ae7.tar.xz
SE mode: Make keeping track of the number of syscalls less hacky.
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/linux/process.cc4
-rw-r--r--src/arch/x86/linux/process.hh2
-rw-r--r--src/arch/x86/linux/syscalls.cc6
3 files changed, 10 insertions, 2 deletions
diff --git a/src/arch/x86/linux/process.cc b/src/arch/x86/linux/process.cc
index da22d9851..1d109ae27 100644
--- a/src/arch/x86/linux/process.cc
+++ b/src/arch/x86/linux/process.cc
@@ -70,10 +70,10 @@ using namespace X86ISA;
X86_64LinuxProcess::X86_64LinuxProcess(LiveProcessParams * params,
ObjectFile *objFile)
- : X86_64LiveProcess(params, objFile, syscallDescs, 273)
+ : X86_64LiveProcess(params, objFile, syscallDescs, numSyscalls)
{}
I386LinuxProcess::I386LinuxProcess(LiveProcessParams * params,
ObjectFile *objFile)
- : I386LiveProcess(params, objFile, syscallDescs, 324)
+ : I386LiveProcess(params, objFile, syscallDescs, numSyscalls)
{}
diff --git a/src/arch/x86/linux/process.hh b/src/arch/x86/linux/process.hh
index ca3606ef0..8ea5e6f01 100644
--- a/src/arch/x86/linux/process.hh
+++ b/src/arch/x86/linux/process.hh
@@ -69,6 +69,7 @@ class X86_64LinuxProcess : public X86_64LiveProcess
protected:
/// Array of syscall descriptors, indexed by call number.
static SyscallDesc syscallDescs[];
+ static const int numSyscalls;
public:
/// Constructor.
@@ -80,6 +81,7 @@ class I386LinuxProcess : public I386LiveProcess
protected:
/// Array of syscall descriptors, indexed by call number.
static SyscallDesc syscallDescs[];
+ static const int numSyscalls;
public:
/// Constructor.
diff --git a/src/arch/x86/linux/syscalls.cc b/src/arch/x86/linux/syscalls.cc
index 09235ec94..49a7d8b77 100644
--- a/src/arch/x86/linux/syscalls.cc
+++ b/src/arch/x86/linux/syscalls.cc
@@ -503,6 +503,9 @@ SyscallDesc X86_64LinuxProcess::syscallDescs[] = {
/* 272 */ SyscallDesc("unshare", unimplementedFunc)
};
+const int X86_64LinuxProcess::numSyscalls =
+ sizeof(X86_64LinuxProcess::syscallDescs) / sizeof(SyscallDesc);
+
SyscallDesc I386LinuxProcess::syscallDescs[] = {
/* 0 */ SyscallDesc("restart_syscall", unimplementedFunc),
/* 1 */ SyscallDesc("exit", unimplementedFunc),
@@ -829,3 +832,6 @@ SyscallDesc I386LinuxProcess::syscallDescs[] = {
/* 322 */ SyscallDesc("timerfd", unimplementedFunc),
/* 323 */ SyscallDesc("eventfd", unimplementedFunc)
};
+
+const int I386LinuxProcess::numSyscalls =
+ sizeof(I386LinuxProcess::syscallDescs) / sizeof(SyscallDesc);