ARM: Make ArmLinuxProcess understand "ARM private" system calls.

This commit is contained in:
Gabe Black 2009-06-09 23:38:50 -07:00
parent fbf4dc9da2
commit 5daeefc505
2 changed files with 25 additions and 4 deletions

View file

@ -411,20 +411,36 @@ SyscallDesc ArmLinuxProcess::syscallDescs[] = {
/* 346 */ SyscallDesc("epoll_pwait", unimplementedFunc), /* 346 */ SyscallDesc("epoll_pwait", unimplementedFunc),
}; };
SyscallDesc ArmLinuxProcess::privSyscallDescs[] = {
/* 1 */ SyscallDesc("breakpoint", unimplementedFunc),
/* 2 */ SyscallDesc("cacheflush", unimplementedFunc),
/* 3 */ SyscallDesc("usr26", unimplementedFunc),
/* 4 */ SyscallDesc("usr32", unimplementedFunc),
/* 5 */ SyscallDesc("set_tls", unimplementedFunc)
};
ArmLinuxProcess::ArmLinuxProcess(LiveProcessParams * params, ArmLinuxProcess::ArmLinuxProcess(LiveProcessParams * params,
ObjectFile *objFile) ObjectFile *objFile)
: ArmLiveProcess(params, objFile), : ArmLiveProcess(params, objFile),
Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc)) Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc)),
Num_Priv_Syscall_Descs(sizeof(privSyscallDescs) / sizeof(SyscallDesc))
{ } { }
SyscallDesc* SyscallDesc*
ArmLinuxProcess::getDesc(int callnum) ArmLinuxProcess::getDesc(int callnum)
{ {
// Angel SWI syscalls are unsupported in this release // Angel SWI syscalls are unsupported in this release
if (callnum == 0x123456) if (callnum == 0x123456) {
panic("Attempt to execute an ANGEL_SWI system call (newlib-related)"); panic("Attempt to execute an ANGEL_SWI system call (newlib-related)");
else if ((callnum & 0x00f00000) == 0x00900000) } else if ((callnum & 0x00f00000) == 0x00900000) {
callnum &= 0x000fffff; callnum &= 0x000fffff;
if ((callnum & 0x0f0000) == 0xf0000) {
callnum -= 0x0f0001;
if (callnum < 0 || callnum > Num_Priv_Syscall_Descs)
return NULL;
return &privSyscallDescs[callnum];
}
}
// Linux syscalls have to strip off the 0x00900000 // Linux syscalls have to strip off the 0x00900000
if (callnum < 0 || callnum > Num_Syscall_Descs) if (callnum < 0 || callnum > Num_Syscall_Descs)

View file

@ -45,10 +45,15 @@ class ArmLinuxProcess : public ArmLiveProcess
/// The target system's hostname. /// The target system's hostname.
static const char *hostname; static const char *hostname;
/// Array of syscall descriptors, indexed by call number. /// Array of syscall descriptors, indexed by call number.
static SyscallDesc syscallDescs[]; static SyscallDesc syscallDescs[];
/// Array of "arm private" syscall descriptors.
static SyscallDesc privSyscallDescs[];
const int Num_Syscall_Descs; const int Num_Syscall_Descs;
const int Num_Priv_Syscall_Descs;
}; };
#endif // __ARM_LINUX_PROCESS_HH__ #endif // __ARM_LINUX_PROCESS_HH__