2 * hostdep.h : things which are dependent on the host architecture
4 * This work is licensed under the terms of the GNU GPL, version 2 or later.
5 * See the COPYING file in the top-level directory.
8 #ifndef RISCV64_HOSTDEP_H
9 #define RISCV64_HOSTDEP_H
11 /* We have a safe-syscall.inc.S */
12 #define HAVE_SAFE_SYSCALL
16 /* These are defined by the safe-syscall.inc.S file */
17 extern char safe_syscall_start
[];
18 extern char safe_syscall_end
[];
20 /* Adjust the signal context to rewind out of safe-syscall if we're in it */
21 static inline void rewind_if_in_safe_syscall(void *puc
)
24 unsigned long *pcreg
= &uc
->uc_mcontext
.__gregs
[REG_PC
];
26 if (*pcreg
> (uintptr_t)safe_syscall_start
27 && *pcreg
< (uintptr_t)safe_syscall_end
) {
28 *pcreg
= (uintptr_t)safe_syscall_start
;
32 #endif /* __ASSEMBLER__ */