]> Git Repo - linux.git/blob - tools/testing/selftests/rseq/rseq-ppc-thread-pointer.h
x86/kaslr: Expose and use the end of the physical memory address space
[linux.git] / tools / testing / selftests / rseq / rseq-ppc-thread-pointer.h
1 /* SPDX-License-Identifier: LGPL-2.1-only OR MIT */
2 /*
3  * rseq-ppc-thread-pointer.h
4  *
5  * (C) Copyright 2021 - Mathieu Desnoyers <[email protected]>
6  */
7
8 #ifndef _RSEQ_PPC_THREAD_POINTER
9 #define _RSEQ_PPC_THREAD_POINTER
10
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
15 static inline void *rseq_thread_pointer(void)
16 {
17 #ifdef __powerpc64__
18         register void *__result asm ("r13");
19 #else
20         register void *__result asm ("r2");
21 #endif
22         asm ("" : "=r" (__result));
23         return __result;
24 }
25
26 #ifdef __cplusplus
27 }
28 #endif
29
30 #endif
This page took 0.034037 seconds and 4 git commands to generate.