1/* SPDX-License-Identifier: GPL-2.0 */ 2#include <linux/linkage.h> 3#include <asm/unistd_32.h> 4#include <asm/asm-offsets.h> 5 6#ifndef SYSCALL_ENTER_KERNEL 7#define SYSCALL_ENTER_KERNEL int $0x80 8#endif 9 10 .text 11 .globl __kernel_sigreturn 12 .type __kernel_sigreturn,@function 13 nop /* this guy is needed for .LSTARTFDEDLSI1 below (watch for HACK) */ 14 ALIGN 15__kernel_sigreturn: 16.LSTART_sigreturn: 17 popl %eax /* XXX does this mean it needs unwind info? */ 18 movl $__NR_sigreturn, %eax 19 SYSCALL_ENTER_KERNEL 20.LEND_sigreturn: 21SYM_INNER_LABEL(vdso32_sigreturn_landing_pad, SYM_L_GLOBAL) 22 nop 23 .size __kernel_sigreturn,.-.LSTART_sigreturn 24 25 .globl __kernel_rt_sigreturn 26 .type __kernel_rt_sigreturn,@function 27 ALIGN 28__kernel_rt_sigreturn: 29.LSTART_rt_sigreturn: 30 movl $__NR_rt_sigreturn, %eax 31 SYSCALL_ENTER_KERNEL 32.LEND_rt_sigreturn: 33SYM_INNER_LABEL(vdso32_rt_sigreturn_landing_pad, SYM_L_GLOBAL) 34 nop 35 .size __kernel_rt_sigreturn,.-.LSTART_rt_sigreturn 36 .previous 37 38 .section .eh_frame,"a",@progbits 39.LSTARTFRAMEDLSI1: 40 .long .LENDCIEDLSI1-.LSTARTCIEDLSI1 41.LSTARTCIEDLSI1: 42 .long 0 /* CIE ID */ 43 .byte 1 /* Version number */ 44 .string "zRS" /* NUL-terminated augmentation string */ 45 .uleb128 1 /* Code alignment factor */ 46 .sleb128 -4 /* Data alignment factor */ 47 .byte 8 /* Return address register column */ 48 .uleb128 1 /* Augmentation value length */ 49 .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */ 50 .byte 0 /* DW_CFA_nop */ 51 .align 4 52.LENDCIEDLSI1: 53 .long .LENDFDEDLSI1-.LSTARTFDEDLSI1 /* Length FDE */ 54.LSTARTFDEDLSI1: 55 .long .LSTARTFDEDLSI1-.LSTARTFRAMEDLSI1 /* CIE pointer */ 56 /* HACK: The dwarf2 unwind routines will subtract 1 from the 57 return address to get an address in the middle of the 58 presumed call instruction. Since we didn't get here via 59 a call, we need to include the nop before the real start 60 to make up for it. */ 61 .long .LSTART_sigreturn-1-. /* PC-relative start address */ 62 .long .LEND_sigreturn-.LSTART_sigreturn+1 63 .uleb128 0 /* Augmentation */ 64 /* What follows are the instructions for the table generation. 65 We record the locations of each register saved. This is 66 complicated by the fact that the "CFA" is always assumed to 67 be the value of the stack pointer in the caller. This means 68 that we must define the CFA of this body of code to be the 69 saved value of the stack pointer in the sigcontext. Which 70 also means that there is no fixed relation to the other 71 saved registers, which means that we must use DW_CFA_expression 72 to compute their addresses. It also means that when we 73 adjust the stack with the popl, we have to do it all over again. */ 74 75#define do_cfa_expr(offset) \ 76 .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ 77 .uleb128 1f-0f; /* length */ \ 780: .byte 0x74; /* DW_OP_breg4 */ \ 79 .sleb128 offset; /* offset */ \ 80 .byte 0x06; /* DW_OP_deref */ \ 811: 82 83#define do_expr(regno, offset) \ 84 .byte 0x10; /* DW_CFA_expression */ \ 85 .uleb128 regno; /* regno */ \ 86 .uleb128 1f-0f; /* length */ \ 870: .byte 0x74; /* DW_OP_breg4 */ \ 88 .sleb128 offset; /* offset */ \ 891: 90 91 do_cfa_expr(IA32_SIGCONTEXT_sp+4) 92 do_expr(0, IA32_SIGCONTEXT_ax+4) 93 do_expr(1, IA32_SIGCONTEXT_cx+4) 94 do_expr(2, IA32_SIGCONTEXT_dx+4) 95 do_expr(3, IA32_SIGCONTEXT_bx+4) 96 do_expr(5, IA32_SIGCONTEXT_bp+4) 97 do_expr(6, IA32_SIGCONTEXT_si+4) 98 do_expr(7, IA32_SIGCONTEXT_di+4) 99 do_expr(8, IA32_SIGCONTEXT_ip+4) 100 101 .byte 0x42 /* DW_CFA_advance_loc 2 -- nop; popl eax. */ 102 103 do_cfa_expr(IA32_SIGCONTEXT_sp) 104 do_expr(0, IA32_SIGCONTEXT_ax) 105 do_expr(1, IA32_SIGCONTEXT_cx) 106 do_expr(2, IA32_SIGCONTEXT_dx) 107 do_expr(3, IA32_SIGCONTEXT_bx) 108 do_expr(5, IA32_SIGCONTEXT_bp) 109 do_expr(6, IA32_SIGCONTEXT_si) 110 do_expr(7, IA32_SIGCONTEXT_di) 111 do_expr(8, IA32_SIGCONTEXT_ip) 112 113 .align 4 114.LENDFDEDLSI1: 115 116 .long .LENDFDEDLSI2-.LSTARTFDEDLSI2 /* Length FDE */ 117.LSTARTFDEDLSI2: 118 .long .LSTARTFDEDLSI2-.LSTARTFRAMEDLSI1 /* CIE pointer */ 119 /* HACK: See above wrt unwind library assumptions. */ 120 .long .LSTART_rt_sigreturn-1-. /* PC-relative start address */ 121 .long .LEND_rt_sigreturn-.LSTART_rt_sigreturn+1 122 .uleb128 0 /* Augmentation */ 123 /* What follows are the instructions for the table generation. 124 We record the locations of each register saved. This is 125 slightly less complicated than the above, since we don't 126 modify the stack pointer in the process. */ 127 128 do_cfa_expr(IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_sp) 129 do_expr(0, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_ax) 130 do_expr(1, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_cx) 131 do_expr(2, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_dx) 132 do_expr(3, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_bx) 133 do_expr(5, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_bp) 134 do_expr(6, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_si) 135 do_expr(7, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_di) 136 do_expr(8, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_ip) 137 138 .align 4 139.LENDFDEDLSI2: 140 .previous 141