]> git.proxmox.com Git - mirror_qemu.git/blame - linux-user/host/x86_64/host-signal.h
meson: reuse common_user_inc when building files specific to user-mode emulators
[mirror_qemu.git] / linux-user / host / x86_64 / host-signal.h
CommitLineData
85442fce
RH
1/*
2 * host-signal.h: signal info dependent on the host architecture
3 *
4 * Copyright (C) 2021 Linaro Limited
5 *
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
8 */
9
10#ifndef X86_64_HOST_SIGNAL_H
11#define X86_64_HOST_SIGNAL_H
12
13static inline uintptr_t host_signal_pc(ucontext_t *uc)
14{
15 return uc->uc_mcontext.gregs[REG_RIP];
16}
17
c6cda6a4
WL
18static inline void host_signal_set_pc(ucontext_t *uc, uintptr_t pc)
19{
20 uc->uc_mcontext.gregs[REG_RIP] = pc;
21}
22
85442fce
RH
23static inline bool host_signal_write(siginfo_t *info, ucontext_t *uc)
24{
25 return uc->uc_mcontext.gregs[REG_TRAPNO] == 0xe
26 && (uc->uc_mcontext.gregs[REG_ERR] & 0x2);
27}
28
29#endif