]> git.proxmox.com Git - mirror_qemu.git/blob - linux-user/host/ppc/host-signal.h
meson: reuse common_user_inc when building files specific to user-mode emulators
[mirror_qemu.git] / linux-user / host / ppc / host-signal.h
1 /*
2 * host-signal.h: signal info dependent on the host architecture
3 *
4 * Copyright (c) 2003-2005 Fabrice Bellard
5 * Copyright (c) 2021 Linaro Limited
6 *
7 * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
8 * See the COPYING file in the top-level directory.
9 */
10
11 #ifndef PPC_HOST_SIGNAL_H
12 #define PPC_HOST_SIGNAL_H
13
14 static inline uintptr_t host_signal_pc(ucontext_t *uc)
15 {
16 return uc->uc_mcontext.regs->nip;
17 }
18
19 static inline void host_signal_set_pc(ucontext_t *uc, uintptr_t pc)
20 {
21 uc->uc_mcontext.regs->nip = pc;
22 }
23
24 static inline bool host_signal_write(siginfo_t *info, ucontext_t *uc)
25 {
26 return uc->uc_mcontext.regs->trap != 0x400
27 && (uc->uc_mcontext.regs->dsisr & 0x02000000);
28 }
29
30 #endif