1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * AArch32 sigreturn code.
4 * Based on the kuser helpers in arch/arm/kernel/entry-armv.S.
5 *
6 * Copyright (C) 2005-2011 Nicolas Pitre <nico@fluxnic.net>
7 * Copyright (C) 2012-2018 ARM Ltd.
8 *
9 * For ARM syscalls, the syscall number has to be loaded into r7.
10 * We do not support an OABI userspace.
11 *
12 * For Thumb syscalls, we also pass the syscall number via r7. We therefore
13 * need two 16-bit instructions.
14 */
15
16#include <asm/unistd.h>
17
18 .section .rodata
19 .globl __aarch32_sigret_code_start
20__aarch32_sigret_code_start:
21
22 /*
23 * ARM Code
24 */
25 .byte __NR_compat_sigreturn, 0x70, 0xa0, 0xe3 // mov r7, #__NR_compat_sigreturn
26 .byte __NR_compat_sigreturn, 0x00, 0x00, 0xef // svc #__NR_compat_sigreturn
27
28 /*
29 * Thumb code
30 */
31 .byte __NR_compat_sigreturn, 0x27 // svc #__NR_compat_sigreturn
32 .byte __NR_compat_sigreturn, 0xdf // mov r7, #__NR_compat_sigreturn
33
34 /*
35 * ARM code
36 */
37 .byte __NR_compat_rt_sigreturn, 0x70, 0xa0, 0xe3 // mov r7, #__NR_compat_rt_sigreturn
38 .byte __NR_compat_rt_sigreturn, 0x00, 0x00, 0xef // svc #__NR_compat_rt_sigreturn
39
40 /*
41 * Thumb code
42 */
43 .byte __NR_compat_rt_sigreturn, 0x27 // svc #__NR_compat_rt_sigreturn
44 .byte __NR_compat_rt_sigreturn, 0xdf // mov r7, #__NR_compat_rt_sigreturn
45
46 .globl __aarch32_sigret_code_end
47__aarch32_sigret_code_end:
48

source code of linux/arch/arm64/kernel/sigreturn32.S