OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.h" | 5 #include "content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 case __NR_openat: | 111 case __NR_openat: |
112 return Allow(); | 112 return Allow(); |
113 default: | 113 default: |
114 return CrosArmGpuProcessPolicy::EvaluateSyscall(sysno); | 114 return CrosArmGpuProcessPolicy::EvaluateSyscall(sysno); |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
118 } // namespace | 118 } // namespace |
119 | 119 |
120 CrosArmGpuProcessPolicy::CrosArmGpuProcessPolicy(bool allow_shmat) | 120 CrosArmGpuProcessPolicy::CrosArmGpuProcessPolicy(bool allow_shmat) |
121 : allow_shmat_(allow_shmat) {} | 121 #if defined(__arm__) || defined(__aarch64__) |
| 122 : allow_shmat_(allow_shmat) |
| 123 #endif |
| 124 { |
| 125 } |
122 | 126 |
123 CrosArmGpuProcessPolicy::~CrosArmGpuProcessPolicy() {} | 127 CrosArmGpuProcessPolicy::~CrosArmGpuProcessPolicy() {} |
124 | 128 |
125 ResultExpr CrosArmGpuProcessPolicy::EvaluateSyscall(int sysno) const { | 129 ResultExpr CrosArmGpuProcessPolicy::EvaluateSyscall(int sysno) const { |
126 #if defined(__arm__) || defined(__aarch64__) | 130 #if defined(__arm__) || defined(__aarch64__) |
127 if (allow_shmat_ && sysno == __NR_shmat) | 131 if (allow_shmat_ && sysno == __NR_shmat) |
128 return Allow(); | 132 return Allow(); |
129 #endif // defined(__arm__) || defined(__aarch64__) | 133 #endif // defined(__arm__) || defined(__aarch64__) |
130 | 134 |
131 switch (sysno) { | 135 switch (sysno) { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // Preload the Tegra V4L2 (video decode acceleration) library. | 173 // Preload the Tegra V4L2 (video decode acceleration) library. |
170 dlopen("/usr/lib/libtegrav4l2.so", dlopen_flag); | 174 dlopen("/usr/lib/libtegrav4l2.so", dlopen_flag); |
171 // Resetting errno since platform-specific libraries will fail on other | 175 // Resetting errno since platform-specific libraries will fail on other |
172 // platforms. | 176 // platforms. |
173 errno = 0; | 177 errno = 0; |
174 | 178 |
175 return true; | 179 return true; |
176 } | 180 } |
177 | 181 |
178 } // namespace content | 182 } // namespace content |
OLD | NEW |