.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Signal trampoline for 64 bits processes in a ppc64 kernel for |
---|
3 | 4 | * use in the vDSO |
---|
4 | 5 | * |
---|
5 | 6 | * Copyright (C) 2004 Benjamin Herrenschmuidt (benh@kernel.crashing.org), IBM Corp. |
---|
6 | 7 | * Copyright (C) 2004 Alan Modra (amodra@au.ibm.com)), IBM Corp. |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or |
---|
9 | | - * modify it under the terms of the GNU General Public License |
---|
10 | | - * as published by the Free Software Foundation; either version |
---|
11 | | - * 2 of the License, or (at your option) any later version. |
---|
12 | 8 | */ |
---|
| 9 | +#include <asm/cache.h> /* IFETCH_ALIGN_BYTES */ |
---|
13 | 10 | #include <asm/processor.h> |
---|
14 | 11 | #include <asm/ppc_asm.h> |
---|
15 | 12 | #include <asm/unistd.h> |
---|
.. | .. |
---|
18 | 15 | |
---|
19 | 16 | .text |
---|
20 | 17 | |
---|
21 | | -/* The nop here is a hack. The dwarf2 unwind routines subtract 1 from |
---|
22 | | - the return address to get an address in the middle of the presumed |
---|
23 | | - call instruction. Since we don't have a call here, we artificially |
---|
24 | | - extend the range covered by the unwind info by padding before the |
---|
25 | | - real start. */ |
---|
26 | | - nop |
---|
| 18 | +/* |
---|
| 19 | + * __kernel_start_sigtramp_rt64 and __kernel_sigtramp_rt64 together |
---|
| 20 | + * are one function split in two parts. The kernel jumps to the former |
---|
| 21 | + * and the signal handler indirectly (by blr) returns to the latter. |
---|
| 22 | + * __kernel_sigtramp_rt64 needs to point to the return address so |
---|
| 23 | + * glibc can correctly identify the trampoline stack frame. |
---|
| 24 | + */ |
---|
27 | 25 | .balign 8 |
---|
| 26 | + .balign IFETCH_ALIGN_BYTES |
---|
| 27 | +V_FUNCTION_BEGIN(__kernel_start_sigtramp_rt64) |
---|
| 28 | +.Lsigrt_start: |
---|
| 29 | + bctrl /* call the handler */ |
---|
| 30 | +V_FUNCTION_END(__kernel_start_sigtramp_rt64) |
---|
28 | 31 | V_FUNCTION_BEGIN(__kernel_sigtramp_rt64) |
---|
29 | | -.Lsigrt_start = . - 4 |
---|
30 | 32 | addi r1, r1, __SIGNAL_FRAMESIZE |
---|
31 | 33 | li r0,__NR_rt_sigreturn |
---|
32 | 34 | sc |
---|
33 | 35 | .Lsigrt_end: |
---|
34 | 36 | V_FUNCTION_END(__kernel_sigtramp_rt64) |
---|
35 | | -/* The ".balign 8" above and the following zeros mimic the old stack |
---|
| 37 | +/* The .balign 8 above and the following zeros mimic the old stack |
---|
36 | 38 | trampoline layout. The last magic value is the ucontext pointer, |
---|
37 | 39 | chosen in such a way that older libgcc unwind code returns a zero |
---|
38 | 40 | for a sigcontext pointer. */ |
---|