2016-05-12 20:47:46 +03:00
|
|
|
/*
|
2016-06-13 13:57:18 +03:00
|
|
|
* hostdep.h : things which are dependent on the host architecture
|
2016-05-12 20:47:46 +03:00
|
|
|
*
|
|
|
|
* * Written by Peter Maydell <peter.maydell@linaro.org>
|
|
|
|
*
|
|
|
|
* Copyright (C) 2016 Linaro Limited
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*/
|
|
|
|
|
2016-06-29 17:22:46 +03:00
|
|
|
#ifndef ARM_HOSTDEP_H
|
|
|
|
#define ARM_HOSTDEP_H
|
2016-05-12 20:47:46 +03:00
|
|
|
|
2016-06-22 03:32:10 +03:00
|
|
|
/* We have a safe-syscall.inc.S */
|
|
|
|
#define HAVE_SAFE_SYSCALL
|
|
|
|
|
|
|
|
#ifndef __ASSEMBLER__
|
|
|
|
|
|
|
|
/* These are defined by the safe-syscall.inc.S file */
|
|
|
|
extern char safe_syscall_start[];
|
|
|
|
extern char safe_syscall_end[];
|
|
|
|
|
|
|
|
/* Adjust the signal context to rewind out of safe-syscall if we're in it */
|
|
|
|
static inline void rewind_if_in_safe_syscall(void *puc)
|
|
|
|
{
|
2017-06-28 23:44:52 +03:00
|
|
|
ucontext_t *uc = puc;
|
2016-06-22 03:32:10 +03:00
|
|
|
unsigned long *pcreg = &uc->uc_mcontext.arm_pc;
|
|
|
|
|
|
|
|
if (*pcreg > (uintptr_t)safe_syscall_start
|
|
|
|
&& *pcreg < (uintptr_t)safe_syscall_end) {
|
|
|
|
*pcreg = (uintptr_t)safe_syscall_start;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* __ASSEMBLER__ */
|
|
|
|
|
2016-05-12 20:47:46 +03:00
|
|
|
#endif
|