SE mode: Make keeping track of the number of syscalls less hacky.
This commit is contained in:
parent
b8333a5155
commit
ca85981478
6 changed files with 18 additions and 18 deletions
|
@ -60,18 +60,6 @@ SparcLinuxProcess::getDesc32(int callnum)
|
||||||
return &syscall32Descs[callnum];
|
return &syscall32Descs[callnum];
|
||||||
}
|
}
|
||||||
|
|
||||||
SparcLinuxProcess::SparcLinuxProcess() :
|
|
||||||
Num_Syscall_Descs(284), //sizeof(syscallDescs) / sizeof(SyscallDesc)),
|
|
||||||
Num_Syscall32_Descs(299) //sizeof(syscall32Descs) / sizeof(SyscallDesc))
|
|
||||||
{
|
|
||||||
// The sparc syscall table must be <= 284 entries because that is all there
|
|
||||||
// is space for.
|
|
||||||
assert(Num_Syscall_Descs <= 284);
|
|
||||||
// The sparc 32 bit syscall table bust be <= 299 entries because that is
|
|
||||||
// all there is space for.
|
|
||||||
assert(Num_Syscall_Descs <= 299);
|
|
||||||
}
|
|
||||||
|
|
||||||
Sparc32LinuxProcess::Sparc32LinuxProcess(LiveProcessParams * params,
|
Sparc32LinuxProcess::Sparc32LinuxProcess(LiveProcessParams * params,
|
||||||
ObjectFile *objFile)
|
ObjectFile *objFile)
|
||||||
: Sparc32LiveProcess(params, objFile)
|
: Sparc32LiveProcess(params, objFile)
|
||||||
|
|
|
@ -43,8 +43,6 @@ namespace SparcISA {
|
||||||
class SparcLinuxProcess
|
class SparcLinuxProcess
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SparcLinuxProcess();
|
|
||||||
|
|
||||||
/// Array of syscall descriptors, indexed by call number.
|
/// Array of syscall descriptors, indexed by call number.
|
||||||
static SyscallDesc syscallDescs[];
|
static SyscallDesc syscallDescs[];
|
||||||
|
|
||||||
|
@ -55,8 +53,8 @@ class SparcLinuxProcess
|
||||||
SyscallDesc* getDesc(int callnum);
|
SyscallDesc* getDesc(int callnum);
|
||||||
SyscallDesc* getDesc32(int callnum);
|
SyscallDesc* getDesc32(int callnum);
|
||||||
|
|
||||||
const int Num_Syscall_Descs;
|
static const int Num_Syscall_Descs;
|
||||||
const int Num_Syscall32_Descs;
|
static const int Num_Syscall32_Descs;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A process with emulated SPARC/Linux syscalls.
|
/// A process with emulated SPARC/Linux syscalls.
|
||||||
|
|
|
@ -390,6 +390,9 @@ SyscallDesc SparcLinuxProcess::syscall32Descs[] = {
|
||||||
/* 299 */ SyscallDesc("unshare", unimplementedFunc)
|
/* 299 */ SyscallDesc("unshare", unimplementedFunc)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const int SparcLinuxProcess::Num_Syscall32_Descs =
|
||||||
|
sizeof(SparcLinuxProcess::syscall32Descs) / sizeof(SyscallDesc);
|
||||||
|
|
||||||
SyscallDesc SparcLinuxProcess::syscallDescs[] = {
|
SyscallDesc SparcLinuxProcess::syscallDescs[] = {
|
||||||
/* 0 */ SyscallDesc("restart_syscall", unimplementedFunc),
|
/* 0 */ SyscallDesc("restart_syscall", unimplementedFunc),
|
||||||
/* 1 */ SyscallDesc("exit", exitFunc),
|
/* 1 */ SyscallDesc("exit", exitFunc),
|
||||||
|
@ -677,4 +680,7 @@ SyscallDesc SparcLinuxProcess::syscallDescs[] = {
|
||||||
/* 283 */ SyscallDesc("keyctl", unimplementedFunc)
|
/* 283 */ SyscallDesc("keyctl", unimplementedFunc)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const int SparcLinuxProcess::Num_Syscall_Descs =
|
||||||
|
sizeof(SparcLinuxProcess::syscallDescs) / sizeof(SyscallDesc);
|
||||||
|
|
||||||
} // namespace SparcISA
|
} // namespace SparcISA
|
||||||
|
|
|
@ -70,10 +70,10 @@ using namespace X86ISA;
|
||||||
|
|
||||||
X86_64LinuxProcess::X86_64LinuxProcess(LiveProcessParams * params,
|
X86_64LinuxProcess::X86_64LinuxProcess(LiveProcessParams * params,
|
||||||
ObjectFile *objFile)
|
ObjectFile *objFile)
|
||||||
: X86_64LiveProcess(params, objFile, syscallDescs, 273)
|
: X86_64LiveProcess(params, objFile, syscallDescs, numSyscalls)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
I386LinuxProcess::I386LinuxProcess(LiveProcessParams * params,
|
I386LinuxProcess::I386LinuxProcess(LiveProcessParams * params,
|
||||||
ObjectFile *objFile)
|
ObjectFile *objFile)
|
||||||
: I386LiveProcess(params, objFile, syscallDescs, 324)
|
: I386LiveProcess(params, objFile, syscallDescs, numSyscalls)
|
||||||
{}
|
{}
|
||||||
|
|
|
@ -69,6 +69,7 @@ class X86_64LinuxProcess : public X86_64LiveProcess
|
||||||
protected:
|
protected:
|
||||||
/// Array of syscall descriptors, indexed by call number.
|
/// Array of syscall descriptors, indexed by call number.
|
||||||
static SyscallDesc syscallDescs[];
|
static SyscallDesc syscallDescs[];
|
||||||
|
static const int numSyscalls;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
|
@ -80,6 +81,7 @@ class I386LinuxProcess : public I386LiveProcess
|
||||||
protected:
|
protected:
|
||||||
/// Array of syscall descriptors, indexed by call number.
|
/// Array of syscall descriptors, indexed by call number.
|
||||||
static SyscallDesc syscallDescs[];
|
static SyscallDesc syscallDescs[];
|
||||||
|
static const int numSyscalls;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
|
|
|
@ -503,6 +503,9 @@ SyscallDesc X86_64LinuxProcess::syscallDescs[] = {
|
||||||
/* 272 */ SyscallDesc("unshare", unimplementedFunc)
|
/* 272 */ SyscallDesc("unshare", unimplementedFunc)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const int X86_64LinuxProcess::numSyscalls =
|
||||||
|
sizeof(X86_64LinuxProcess::syscallDescs) / sizeof(SyscallDesc);
|
||||||
|
|
||||||
SyscallDesc I386LinuxProcess::syscallDescs[] = {
|
SyscallDesc I386LinuxProcess::syscallDescs[] = {
|
||||||
/* 0 */ SyscallDesc("restart_syscall", unimplementedFunc),
|
/* 0 */ SyscallDesc("restart_syscall", unimplementedFunc),
|
||||||
/* 1 */ SyscallDesc("exit", unimplementedFunc),
|
/* 1 */ SyscallDesc("exit", unimplementedFunc),
|
||||||
|
@ -829,3 +832,6 @@ SyscallDesc I386LinuxProcess::syscallDescs[] = {
|
||||||
/* 322 */ SyscallDesc("timerfd", unimplementedFunc),
|
/* 322 */ SyscallDesc("timerfd", unimplementedFunc),
|
||||||
/* 323 */ SyscallDesc("eventfd", unimplementedFunc)
|
/* 323 */ SyscallDesc("eventfd", unimplementedFunc)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const int I386LinuxProcess::numSyscalls =
|
||||||
|
sizeof(I386LinuxProcess::syscallDescs) / sizeof(SyscallDesc);
|
||||||
|
|
Loading…
Reference in a new issue