OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "sandbox/linux/seccomp-bpf/syscall_iterator.h" | 5 #include "sandbox/linux/seccomp-bpf/syscall_iterator.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "sandbox/linux/seccomp-bpf/linux_seccomp.h" | 8 #include "sandbox/linux/seccomp-bpf/linux_seccomp.h" |
9 | 9 |
10 namespace playground2 { | 10 namespace sandbox { |
11 | 11 |
12 uint32_t SyscallIterator::Next() { | 12 uint32_t SyscallIterator::Next() { |
13 if (done_) { | 13 if (done_) { |
14 return num_; | 14 return num_; |
15 } | 15 } |
16 | 16 |
17 uint32_t val; | 17 uint32_t val; |
18 do { | 18 do { |
19 // |num_| has been initialized to 0, which we assume is also MIN_SYSCALL. | 19 // |num_| has been initialized to 0, which we assume is also MIN_SYSCALL. |
20 // This true for supported architectures (Intel and ARM EABI). | 20 // This true for supported architectures (Intel and ARM EABI). |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 | 82 |
83 #if defined(__arm__) && (defined(__thumb__) || defined(__ARM_EABI__)) | 83 #if defined(__arm__) && (defined(__thumb__) || defined(__ARM_EABI__)) |
84 bool SyscallIterator::IsArmPrivate(uint32_t num) { | 84 bool SyscallIterator::IsArmPrivate(uint32_t num) { |
85 return (num >= MIN_PRIVATE_SYSCALL && num <= MAX_PRIVATE_SYSCALL) || | 85 return (num >= MIN_PRIVATE_SYSCALL && num <= MAX_PRIVATE_SYSCALL) || |
86 (num >= MIN_GHOST_SYSCALL && num <= MAX_SYSCALL); | 86 (num >= MIN_GHOST_SYSCALL && num <= MAX_SYSCALL); |
87 } | 87 } |
88 #else | 88 #else |
89 bool SyscallIterator::IsArmPrivate(uint32_t) { return false; } | 89 bool SyscallIterator::IsArmPrivate(uint32_t) { return false; } |
90 #endif | 90 #endif |
91 | 91 |
92 } // namespace | 92 } // namespace |
Robert Sesek
2013/12/10 21:15:26
"namespace sandbox"
jln (very slow on Chromium)
2013/12/10 21:36:38
Done.
| |
OLD | NEW |