Chromium Code Reviews| Index: sandbox/linux/seccomp-bpf/syscall.h |
| diff --git a/sandbox/linux/seccomp-bpf/syscall.h b/sandbox/linux/seccomp-bpf/syscall.h |
| index 57970a35b040641069969b4874bf369a0aca990a..511e9c5507b2a5936c20516c197b9641176ceb8f 100644 |
| --- a/sandbox/linux/seccomp-bpf/syscall.h |
| +++ b/sandbox/linux/seccomp-bpf/syscall.h |
| @@ -5,6 +5,7 @@ |
| #ifndef SANDBOX_LINUX_SECCOMP_BPF_SYSCALL_H__ |
| #define SANDBOX_LINUX_SECCOMP_BPF_SYSCALL_H__ |
| +#include <signal.h> |
| #include <stdint.h> |
| #include "base/macros.h" |
| @@ -80,8 +81,28 @@ class SANDBOX_EXPORT Syscall { |
| static inline intptr_t Call(int nr) { return Call(nr, 0, 0, 0, 0, 0, 0); } |
| + // Set the registers in |ctx| to match what they would be after a system call |
| + // returning |ret_val|. |ret_val| must follow the Syscall::Call() convention |
| + // of being -errno on errors. |
| + static void PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx); |
| + |
| private: |
| DISALLOW_IMPLICIT_CONSTRUCTORS(Syscall); |
|
jln (very slow on Chromium)
2014/06/20 21:18:18
This should always be at the bottom of the private
nedeljko
2014/07/09 13:29:57
Done.
|
| + |
| +#if defined(__mips__) |
| + // This function basically does on MIPS what SandboxSyscall() is doing on |
| + // other architectures. However, because of specificity of MIPS regarding |
| + // handelling syscall errors, SandboxSyscall() is made as a wrapper for this |
| + // function in order for SandboxSyscall() to behave more like on othere |
| + // architectures on places where return value from SandboxSyscall() is used |
| + // directly (like in most tests). |
| + // The syscall "nr" is called with arguments that are set in an array on which |
| + // pointer "args" points to and an information weather there is an error or no |
| + // is returned to SandboxSyscall() by err_stat. |
| + static intptr_t SandboxSyscallRaw(int nr, |
| + const intptr_t* args, |
| + intptr_t* err_stat); |
| +#endif // defined(__mips__)}; |
| }; |
| } // namespace sandbox |