ARM: Make ArmLinuxProcess understand "ARM private" system calls.
authorGabe Black <gblack@eecs.umich.edu>
Wed, 10 Jun 2009 06:38:50 +0000 (23:38 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Wed, 10 Jun 2009 06:38:50 +0000 (23:38 -0700)
src/arch/arm/linux/process.cc
src/arch/arm/linux/process.hh

index 3b057ab68e6eaeb10d1463d2bb5e33614385c7f8..25307e106e5e2afa43215e9a9a8add5bad149daa 100644 (file)
@@ -411,20 +411,36 @@ SyscallDesc ArmLinuxProcess::syscallDescs[] = {
     /* 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,
         ObjectFile *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*
 ArmLinuxProcess::getDesc(int callnum)
 {
     // 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)");
-    else if ((callnum & 0x00f00000) == 0x00900000)
+    } else if ((callnum & 0x00f00000) == 0x00900000) {
         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
 
     if (callnum < 0 || callnum > Num_Syscall_Descs)
index 524661b5b60697a51f1b667ea1ef7be66eabefc5..205a40418dc2a883ca57a9d629aeb18a016a7b71 100644 (file)
@@ -45,10 +45,15 @@ class ArmLinuxProcess : public ArmLiveProcess
     /// The target system's hostname.
     static const char *hostname;
 
-     /// Array of syscall descriptors, indexed by call number.
+    /// Array of syscall descriptors, indexed by call number.
     static SyscallDesc syscallDescs[];
 
+    /// Array of "arm private" syscall descriptors.
+    static SyscallDesc privSyscallDescs[];
+
     const int Num_Syscall_Descs;
+
+    const int Num_Priv_Syscall_Descs;
 };
 
 #endif // __ARM_LINUX_PROCESS_HH__