linux-user: Clean up hostdep.h header guards
[qemu/kevin.git] / linux-user / host / aarch64 / hostdep.h
blob64f75cef491908f300e4e5ec1ce8750a3325c4fe
1 /*
2 * hostdep.h : things which are dependent on the host architecture
4 * * Written by Peter Maydell <peter.maydell@linaro.org>
6 * Copyright (C) 2016 Linaro Limited
8 * This work is licensed under the terms of the GNU GPL, version 2 or later.
9 * See the COPYING file in the top-level directory.
12 #ifndef AARCH64_HOSTDEP_H
13 #define AARCH64_HOSTDEP_H
15 /* We have a safe-syscall.inc.S */
16 #define HAVE_SAFE_SYSCALL
18 #ifndef __ASSEMBLER__
20 /* These are defined by the safe-syscall.inc.S file */
21 extern char safe_syscall_start[];
22 extern char safe_syscall_end[];
24 /* Adjust the signal context to rewind out of safe-syscall if we're in it */
25 static inline void rewind_if_in_safe_syscall(void *puc)
27 struct ucontext *uc = puc;
28 __u64 *pcreg = &uc->uc_mcontext.pc;
30 if (*pcreg > (uintptr_t)safe_syscall_start
31 && *pcreg < (uintptr_t)safe_syscall_end) {
32 *pcreg = (uintptr_t)safe_syscall_start;
36 #endif /* __ASSEMBLER__ */
38 #endif