Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: sandbox/linux/bpf_dsl/linux_syscall_ranges.h

Issue 1071653002: Remove #include <asm/unistd.h> from linux_syscall_ranges.h and syscall.cc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | sandbox/linux/seccomp-bpf/syscall.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef SANDBOX_LINUX_BPF_DSL_LINUX_SYSCALL_RANGES_H_ 5 #ifndef SANDBOX_LINUX_BPF_DSL_LINUX_SYSCALL_RANGES_H_
6 #define SANDBOX_LINUX_BPF_DSL_LINUX_SYSCALL_RANGES_H_ 6 #define SANDBOX_LINUX_BPF_DSL_LINUX_SYSCALL_RANGES_H_
7 7
8 #include <asm/unistd.h> // For __NR_SYSCALL_BASE
9
10 #if defined(__x86_64__) 8 #if defined(__x86_64__)
11 9
12 #define MIN_SYSCALL 0u 10 #define MIN_SYSCALL 0u
13 #define MAX_PUBLIC_SYSCALL 1024u 11 #define MAX_PUBLIC_SYSCALL 1024u
14 #define MAX_SYSCALL MAX_PUBLIC_SYSCALL 12 #define MAX_SYSCALL MAX_PUBLIC_SYSCALL
15 13
16 #elif defined(__i386__) 14 #elif defined(__i386__)
17 15
18 #define MIN_SYSCALL 0u 16 #define MIN_SYSCALL 0u
19 #define MAX_PUBLIC_SYSCALL 1024u 17 #define MAX_PUBLIC_SYSCALL 1024u
20 #define MAX_SYSCALL MAX_PUBLIC_SYSCALL 18 #define MAX_SYSCALL MAX_PUBLIC_SYSCALL
21 19
22 #elif defined(__arm__) && (defined(__thumb__) || defined(__ARM_EABI__)) 20 #elif defined(__arm__) && (defined(__thumb__) || defined(__ARM_EABI__))
23 21
24 // ARM EABI includes "ARM private" system calls starting at |__ARM_NR_BASE|, 22 // ARM EABI includes "ARM private" system calls starting at |__ARM_NR_BASE|,
25 // and a "ghost syscall private to the kernel", cmpxchg, 23 // and a "ghost syscall private to the kernel", cmpxchg,
26 // at |__ARM_NR_BASE+0x00fff0|. 24 // at |__ARM_NR_BASE+0x00fff0|.
27 // See </arch/arm/include/asm/unistd.h> in the Linux kernel. 25 // See </arch/arm/include/asm/unistd.h> in the Linux kernel.
26
27 #if !defined(__NR_SYSCALL_BASE)
28 #define __NR_SYSCALL_BASE 0
mdempsky 2015/04/08 18:23:51 Unless you think there's any particular value to s
hidehiko 2015/04/09 02:34:37 Done.
29 #endif
30
31 #if !defined(__ARM_NR_BASE)
32 #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xf0000u)
33 #endif
34
28 #define MIN_SYSCALL ((unsigned int)__NR_SYSCALL_BASE) 35 #define MIN_SYSCALL ((unsigned int)__NR_SYSCALL_BASE)
29 #define MAX_PUBLIC_SYSCALL (MIN_SYSCALL + 1024u) 36 #define MAX_PUBLIC_SYSCALL (MIN_SYSCALL + 1024u)
30 #define MIN_PRIVATE_SYSCALL ((unsigned int)__ARM_NR_BASE) 37 #define MIN_PRIVATE_SYSCALL ((unsigned int)__ARM_NR_BASE)
31 #define MAX_PRIVATE_SYSCALL (MIN_PRIVATE_SYSCALL + 16u) 38 #define MAX_PRIVATE_SYSCALL (MIN_PRIVATE_SYSCALL + 16u)
32 #define MIN_GHOST_SYSCALL ((unsigned int)__ARM_NR_BASE + 0xfff0u) 39 #define MIN_GHOST_SYSCALL ((unsigned int)__ARM_NR_BASE + 0xfff0u)
33 #define MAX_SYSCALL (MIN_GHOST_SYSCALL + 4u) 40 #define MAX_SYSCALL (MIN_GHOST_SYSCALL + 4u)
34 41
35 #elif defined(__mips__) && (_MIPS_SIM == _ABIO32) 42 #elif defined(__mips__) && (_MIPS_SIM == _ABIO32)
36 43
37 #define MIN_SYSCALL __NR_O32_Linux 44 #define MIN_SYSCALL __NR_O32_Linux
mdempsky 2015/04/08 18:23:51 I think this will require <asm/unistd.h>? Unfortu
hidehiko 2015/04/09 02:34:37 Good catch. Fixed.
38 #define MAX_PUBLIC_SYSCALL (MIN_SYSCALL + __NR_Linux_syscalls) 45 #define MAX_PUBLIC_SYSCALL (MIN_SYSCALL + __NR_Linux_syscalls)
39 #define MAX_SYSCALL MAX_PUBLIC_SYSCALL 46 #define MAX_SYSCALL MAX_PUBLIC_SYSCALL
40 47
41 #elif defined(__mips__) && (_MIPS_SIM == _ABI64) 48 #elif defined(__mips__) && (_MIPS_SIM == _ABI64)
42 49
43 #error "Add support to header file" 50 #error "Add support to header file"
44 51
45 #elif defined(__aarch64__) 52 #elif defined(__aarch64__)
46 53
47 #define MIN_SYSCALL 0u 54 #define MIN_SYSCALL 0u
48 #define MAX_PUBLIC_SYSCALL 279u 55 #define MAX_PUBLIC_SYSCALL 279u
49 #define MAX_SYSCALL MAX_PUBLIC_SYSCALL 56 #define MAX_SYSCALL MAX_PUBLIC_SYSCALL
50 57
51 #else 58 #else
52 #error "Unsupported architecture" 59 #error "Unsupported architecture"
53 #endif 60 #endif
54 61
55 #endif // SANDBOX_LINUX_BPF_DSL_LINUX_SYSCALL_RANGES_H_ 62 #endif // SANDBOX_LINUX_BPF_DSL_LINUX_SYSCALL_RANGES_H_
OLDNEW
« no previous file with comments | « no previous file | sandbox/linux/seccomp-bpf/syscall.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698