diff options
| author | Richard Henderson | 2016-06-22 02:32:13 +0200 |
|---|---|---|
| committer | Riku Voipio | 2016-06-26 12:17:22 +0200 |
| commit | 4ba92cd736a9ce0dc83c9b16a75d24d385e1cdf3 (patch) | |
| tree | 3646e46492ce1d08edacdd15da98560d9993f49a /linux-user/host/ppc64/hostdep.h | |
| parent | linux-user: Provide safe_syscall for s390x (diff) | |
| download | qemu-4ba92cd736a9ce0dc83c9b16a75d24d385e1cdf3.tar.gz qemu-4ba92cd736a9ce0dc83c9b16a75d24d385e1cdf3.tar.xz qemu-4ba92cd736a9ce0dc83c9b16a75d24d385e1cdf3.zip | |
linux-user: Provide safe_syscall for ppc64
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user/host/ppc64/hostdep.h')
| -rw-r--r-- | linux-user/host/ppc64/hostdep.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/linux-user/host/ppc64/hostdep.h b/linux-user/host/ppc64/hostdep.h index 7609bf5cd7..310e7d1b73 100644 --- a/linux-user/host/ppc64/hostdep.h +++ b/linux-user/host/ppc64/hostdep.h @@ -12,4 +12,27 @@ #ifndef QEMU_HOSTDEP_H #define QEMU_HOSTDEP_H +/* 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) +{ + struct ucontext *uc = puc; + unsigned long *pcreg = &uc->uc_mcontext.gp_regs[PT_NIP]; + + if (*pcreg > (uintptr_t)safe_syscall_start + && *pcreg < (uintptr_t)safe_syscall_end) { + *pcreg = (uintptr_t)safe_syscall_start; + } +} + +#endif /* __ASSEMBLER__ */ + #endif |
