summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/sigaltstack/current_stack_pointer.h
blob: ea9bdf3a90b16449a0ffcdfcdc54247125f1c806 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* SPDX-License-Identifier: GPL-2.0 */

#if __alpha__
register unsigned long sp asm("$30");
#elif __arm__ || __aarch64__ || __csky__ || __m68k__ || __mips__ || __riscv
register unsigned long sp asm("sp");
#elif __i386__
register unsigned long sp asm("esp");
#elif __loongarch64
register unsigned long sp asm("$sp");
#elif __ppc__
register unsigned long sp asm("r1");
#elif __s390x__
register unsigned long sp asm("%15");
#elif __sh__
register unsigned long sp asm("r15");
#elif __x86_64__
register unsigned long sp asm("rsp");
#elif __XTENSA__
register unsigned long sp asm("a1");
#else
#error "implement current_stack_pointer equivalent"
#endif