summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
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);