configure: Fix atomic64 test for --enable-werror on macOS
[qemu/ar7.git] / linux-user / host / riscv64 / hostdep.h
blob865f0fb9ff8310b8ec976d5974c457f9cc0da541
1 /*
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.
6 */
8 #ifndef RISCV64_HOSTDEP_H
9 #define RISCV64_HOSTDEP_H
11 /* We have a safe-syscall.inc.S */
12 #define HAVE_SAFE_SYSCALL
14 #ifndef __ASSEMBLER__
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)
23 ucontext_t *uc = 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__ */
34 #endif