diff options
Diffstat (limited to 'sysdeps/aarch64/sysdep.h')
-rw-r--r-- | sysdeps/aarch64/sysdep.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sysdeps/aarch64/sysdep.h b/sysdeps/aarch64/sysdep.h index 500c272745..2879aeaa5c 100644 --- a/sysdeps/aarch64/sysdep.h +++ b/sysdeps/aarch64/sysdep.h @@ -35,6 +35,17 @@ #define PTR_SIZE (1<<PTR_LOG_SIZE) +#ifndef __ASSEMBLER__ +/* Strip pointer authentication code from pointer p. */ +static inline void * +strip_pac (void *p) +{ + register void *ra asm ("x30") = (p); + asm ("hint 7 // xpaclri" : "+r"(ra)); + return ra; +} +#endif + #ifdef __ASSEMBLER__ /* Syntactic details of assembler. */ |