1 /*
2 * Copyright (c) 2018 Dmitry V. Levin <ldv@strace.io>
3 * Copyright (c) 2018-2022 The strace developers.
4 * All rights reserved.
5 *
6 * SPDX-License-Identifier: LGPL-2.1-or-later
7 */
8
9 #ifndef STRACE_ARCH_DEFS_H
10 # define STRACE_ARCH_DEFS_H
11
12 # include "arch_defs_.h"
13
14 /* Fallbacks for architecture-specific definitions. */
15
16 # ifndef HAVE_ARCH_GETRVAL2
17 # define HAVE_ARCH_GETRVAL2 0
18 # endif
19
20 # ifndef HAVE_ARCH_OLD_MMAP
21 # define HAVE_ARCH_OLD_MMAP 0
22 # endif
23
24 # ifndef HAVE_ARCH_OLD_MMAP_PGOFF
25 # define HAVE_ARCH_OLD_MMAP_PGOFF 0
26 # endif
27
28 # ifndef HAVE_ARCH_OLD_SELECT
29 # define HAVE_ARCH_OLD_SELECT 0
30 # endif
31
32 # ifndef HAVE_ARCH_UID16_SYSCALLS
33 # define HAVE_ARCH_UID16_SYSCALLS 0
34 # endif
35
36 # ifndef DEFAULT_PERSONALITY
37 # define DEFAULT_PERSONALITY 0
38 # endif
39
40 # ifndef SUPPORTED_PERSONALITIES
41 # define SUPPORTED_PERSONALITIES 1
42 # endif
43
44 # ifndef PERSONALITY_DESIGNATORS
45 # if SUPPORTED_PERSONALITIES == 1
46 # define PERSONALITY_DESIGNATORS { STRINGIFY_VAL(__WORDSIZE) }
47 # elif SUPPORTED_PERSONALITIES == 2
48 # define PERSONALITY_DESIGNATORS { "64", "32" }
49 # endif
50 # endif
51
52 # ifndef PERSONALITY_NAMES
53 # if SUPPORTED_PERSONALITIES == 1
54 # define PERSONALITY_NAMES { STRINGIFY_VAL(__WORDSIZE) " bit" }
55 # elif SUPPORTED_PERSONALITIES == 2
56 # define PERSONALITY_NAMES { "64 bit", "32 bit" }
57 # endif
58 # endif
59
60 # ifndef HAVE_ARCH_DEDICATED_ERR_REG
61 # define HAVE_ARCH_DEDICATED_ERR_REG 0
62 # endif
63
64 # ifndef CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL
65 # define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 0
66 # endif
67
68 # ifndef ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING
69 # define ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING 0
70 # endif
71
72 # ifndef ARCH_NEEDS_NON_SHUFFLED_SCNO_CHECK
73 # define ARCH_NEEDS_NON_SHUFFLED_SCNO_CHECK 0
74 # endif
75
76 # ifndef MIN_WORDSIZE
77 # if SUPPORTED_PERSONALITIES > 1
78 # define MIN_WORDSIZE 4
79 # else
80 # define MIN_WORDSIZE SIZEOF_LONG
81 # endif
82 # endif
83
84 # ifndef HAVE_ARCH_TIME32_SYSCALLS
85 # define HAVE_ARCH_TIME32_SYSCALLS (MIN_WORDSIZE == 4)
86 # endif
87
88 # ifndef HAVE_ARCH_OLD_TIME64_SYSCALLS
89 # define HAVE_ARCH_OLD_TIME64_SYSCALLS (SIZEOF_LONG == 8)
90 # endif
91
92 # ifndef MIN_KLONGSIZE
93 # if SUPPORTED_PERSONALITIES > 1
94 # define MIN_KLONGSIZE 4
95 # else
96 # define MIN_KLONGSIZE SIZEOF_KERNEL_LONG_T
97 # endif
98 # endif
99
100 # ifndef HAVE_ARCH_TIMESPEC32
101 # define HAVE_ARCH_TIMESPEC32 (MIN_KLONGSIZE == 4)
102 # endif
103
104 #endif /* !STRACE_ARCH_DEFS_H */