Skip to content

Commit b4fe19f

Browse files
committed
Merge tag 'arm64-uapi' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64
Pull arm64 uapi disintegration from Catalin Marinas: "UAPI headers for arm64 together with some clean-up to make it possible: - Do not export the COMPAT_* definitions to user - Simplify the compat unistd32.h definitions and remove the __SYSCALL_COMPAT guard - Disintegrate the arch/arm64/include/asm/* headers" * tag 'arm64-uapi' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64: UAPI: (Scripted) Disintegrate arch/arm64/include/asm arm64: Do not export the compat-specific definitions to the user arm64: Do not include asm/unistd32.h in asm/unistd.h arm64: Remove unused definitions from asm/unistd32.h
2 parents ff69497 + 48b3b32 commit b4fe19f

27 files changed

+637
-998
lines changed

arch/arm64/include/asm/Kbuild

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
include include/asm-generic/Kbuild.asm
21

3-
header-y += hwcap.h
42

53
generic-y += bug.h
64
generic-y += bugs.h

arch/arm64/include/asm/hwcap.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616
#ifndef __ASM_HWCAP_H
1717
#define __ASM_HWCAP_H
1818

19-
/*
20-
* HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP
21-
*/
22-
#define HWCAP_FP (1 << 0)
23-
#define HWCAP_ASIMD (1 << 1)
19+
#include <uapi/asm/hwcap.h>
2420

2521
#define COMPAT_HWCAP_HALF (1 << 1)
2622
#define COMPAT_HWCAP_THUMB (1 << 2)
@@ -35,7 +31,6 @@
3531
#define COMPAT_HWCAP_IDIVT (1 << 18)
3632
#define COMPAT_HWCAP_IDIV (COMPAT_HWCAP_IDIVA|COMPAT_HWCAP_IDIVT)
3733

38-
#ifdef __KERNEL__
3934
#ifndef __ASSEMBLY__
4035
/*
4136
* This yields a mask that user programs can use to figure out what
@@ -51,5 +46,3 @@
5146
extern unsigned int elf_hwcap;
5247
#endif
5348
#endif
54-
55-
#endif

arch/arm64/include/asm/ptrace.h

Lines changed: 4 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
#ifndef __ASM_PTRACE_H
2020
#define __ASM_PTRACE_H
2121

22-
#include <linux/types.h>
23-
24-
#include <asm/hwcap.h>
22+
#include <uapi/asm/ptrace.h>
2523

2624
/* AArch32-specific ptrace requests */
2725
#define COMPAT_PTRACE_GETREGS 12
@@ -32,80 +30,18 @@
3230
#define COMPAT_PTRACE_SETVFPREGS 28
3331
#define COMPAT_PTRACE_GETHBPREGS 29
3432
#define COMPAT_PTRACE_SETHBPREGS 30
35-
36-
/*
37-
* PSR bits
38-
*/
39-
#define PSR_MODE_EL0t 0x00000000
40-
#define PSR_MODE_EL1t 0x00000004
41-
#define PSR_MODE_EL1h 0x00000005
42-
#define PSR_MODE_EL2t 0x00000008
43-
#define PSR_MODE_EL2h 0x00000009
44-
#define PSR_MODE_EL3t 0x0000000c
45-
#define PSR_MODE_EL3h 0x0000000d
46-
#define PSR_MODE_MASK 0x0000000f
47-
48-
/* AArch32 CPSR bits */
49-
#define PSR_MODE32_BIT 0x00000010
5033
#define COMPAT_PSR_MODE_USR 0x00000010
5134
#define COMPAT_PSR_T_BIT 0x00000020
5235
#define COMPAT_PSR_IT_MASK 0x0600fc00 /* If-Then execution state mask */
53-
54-
/* AArch64 SPSR bits */
55-
#define PSR_F_BIT 0x00000040
56-
#define PSR_I_BIT 0x00000080
57-
#define PSR_A_BIT 0x00000100
58-
#define PSR_D_BIT 0x00000200
59-
#define PSR_Q_BIT 0x08000000
60-
#define PSR_V_BIT 0x10000000
61-
#define PSR_C_BIT 0x20000000
62-
#define PSR_Z_BIT 0x40000000
63-
#define PSR_N_BIT 0x80000000
64-
65-
/*
66-
* Groups of PSR bits
67-
*/
68-
#define PSR_f 0xff000000 /* Flags */
69-
#define PSR_s 0x00ff0000 /* Status */
70-
#define PSR_x 0x0000ff00 /* Extension */
71-
#define PSR_c 0x000000ff /* Control */
72-
7336
/*
7437
* These are 'magic' values for PTRACE_PEEKUSR that return info about where a
7538
* process is located in memory.
7639
*/
77-
#define PT_TEXT_ADDR 0x10000
78-
#define PT_DATA_ADDR 0x10004
79-
#define PT_TEXT_END_ADDR 0x10008
80-
40+
#define COMPAT_PT_TEXT_ADDR 0x10000
41+
#define COMPAT_PT_DATA_ADDR 0x10004
42+
#define COMPAT_PT_TEXT_END_ADDR 0x10008
8143
#ifndef __ASSEMBLY__
8244

83-
/*
84-
* User structures for general purpose, floating point and debug registers.
85-
*/
86-
struct user_pt_regs {
87-
__u64 regs[31];
88-
__u64 sp;
89-
__u64 pc;
90-
__u64 pstate;
91-
};
92-
93-
struct user_fpsimd_state {
94-
__uint128_t vregs[32];
95-
__u32 fpsr;
96-
__u32 fpcr;
97-
};
98-
99-
struct user_hwdebug_state {
100-
__u32 dbg_info;
101-
struct {
102-
__u64 addr;
103-
__u32 ctrl;
104-
} dbg_regs[16];
105-
};
106-
107-
#ifdef __KERNEL__
108-
10945
/* sizeof(struct user) for AArch32 */
11046
#define COMPAT_USER_SZ 296
11147
/* AArch32 uses x13 as the stack pointer... */
@@ -200,8 +136,5 @@ extern unsigned long profile_pc(struct pt_regs *regs);
200136

201137
extern int aarch32_break_trap(struct pt_regs *regs);
202138

203-
#endif /* __KERNEL__ */
204-
205139
#endif /* __ASSEMBLY__ */
206-
207140
#endif

arch/arm64/include/asm/sigcontext.h

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,8 @@
1616
#ifndef __ASM_SIGCONTEXT_H
1717
#define __ASM_SIGCONTEXT_H
1818

19-
#include <linux/types.h>
19+
#include <uapi/asm/sigcontext.h>
2020

21-
/*
22-
* Signal context structure - contains all info to do with the state
23-
* before the signal handler was invoked.
24-
*/
25-
struct sigcontext {
26-
__u64 fault_address;
27-
/* AArch64 registers */
28-
__u64 regs[31];
29-
__u64 sp;
30-
__u64 pc;
31-
__u64 pstate;
32-
/* 4K reserved for FP/SIMD state and future expansion */
33-
__u8 __reserved[4096] __attribute__((__aligned__(16)));
34-
};
35-
36-
/*
37-
* Header to be used at the beginning of structures extending the user
38-
* context. Such structures must be placed after the rt_sigframe on the stack
39-
* and be 16-byte aligned. The last structure must be a dummy one with the
40-
* magic and size set to 0.
41-
*/
42-
struct _aarch64_ctx {
43-
__u32 magic;
44-
__u32 size;
45-
};
46-
47-
#define FPSIMD_MAGIC 0x46508001
48-
49-
struct fpsimd_context {
50-
struct _aarch64_ctx head;
51-
__u32 fpsr;
52-
__u32 fpcr;
53-
__uint128_t vregs[32];
54-
};
55-
56-
#ifdef __KERNEL__
5721
/*
5822
* Auxiliary context saved in the sigcontext.__reserved array. Not exported to
5923
* user space as it will change with the addition of new context. User space
@@ -65,5 +29,3 @@ struct aux_context {
6529
struct _aarch64_ctx end;
6630
};
6731
#endif
68-
69-
#endif

arch/arm64/include/asm/stat.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
#ifndef __ASM_STAT_H
1717
#define __ASM_STAT_H
1818

19-
#include <asm-generic/stat.h>
19+
#include <uapi/asm/stat.h>
2020

21-
#ifdef __KERNEL__
2221
#ifdef CONFIG_COMPAT
2322

2423
#include <asm/compat.h>
@@ -60,5 +59,3 @@ struct stat64 {
6059

6160
#endif
6261
#endif
63-
64-
#endif

arch/arm64/include/asm/unistd.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@
1313
* You should have received a copy of the GNU General Public License
1414
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1515
*/
16-
17-
#ifndef __SYSCALL_COMPAT
18-
#include <asm-generic/unistd.h>
19-
#endif
20-
21-
#ifdef __KERNEL__
2216
#ifdef CONFIG_COMPAT
23-
#include <asm/unistd32.h>
24-
#endif
17+
#define __ARCH_WANT_COMPAT_IPC_PARSE_VERSION
18+
#define __ARCH_WANT_COMPAT_STAT64
19+
#define __ARCH_WANT_SYS_GETHOSTNAME
20+
#define __ARCH_WANT_SYS_PAUSE
21+
#define __ARCH_WANT_SYS_GETPGRP
22+
#define __ARCH_WANT_SYS_LLSEEK
23+
#define __ARCH_WANT_SYS_NICE
24+
#define __ARCH_WANT_SYS_SIGPENDING
25+
#define __ARCH_WANT_SYS_SIGPROCMASK
26+
#define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
27+
#define __ARCH_WANT_COMPAT_SYS_SENDFILE
2528
#endif
29+
#include <uapi/asm/unistd.h>

0 commit comments

Comments
 (0)