diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2021-09-16 19:44:47 -0700 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2021-11-02 07:00:38 -0400 |
commit | 85442fce49eb81c216112f87e871cf1a6a2e6c7b (patch) | |
tree | 82a8a98f4645a961744178815ed9d32d4dce0fbb /linux-user/host/x86_64 | |
parent | e6037d04c58284285726721d0d4741e1386594e9 (diff) | |
download | qemu-85442fce49eb81c216112f87e871cf1a6a2e6c7b.zip qemu-85442fce49eb81c216112f87e871cf1a6a2e6c7b.tar.gz qemu-85442fce49eb81c216112f87e871cf1a6a2e6c7b.tar.bz2 |
linux-user/host/x86: Populate host_signal.h
Split host_signal_pc and host_signal_write out of user-exec.c.
Drop the *BSD code, to be re-created under bsd-user/ later.
Reviewed-by: Warner Losh <imp@bsdimp.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'linux-user/host/x86_64')
-rw-r--r-- | linux-user/host/x86_64/host-signal.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/linux-user/host/x86_64/host-signal.h b/linux-user/host/x86_64/host-signal.h index f4b4d65..883d2fc 100644 --- a/linux-user/host/x86_64/host-signal.h +++ b/linux-user/host/x86_64/host-signal.h @@ -1 +1,24 @@ -#define HOST_SIGNAL_PLACEHOLDER +/* + * host-signal.h: signal info dependent on the host architecture + * + * Copyright (C) 2021 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. + */ + +#ifndef X86_64_HOST_SIGNAL_H +#define X86_64_HOST_SIGNAL_H + +static inline uintptr_t host_signal_pc(ucontext_t *uc) +{ + return uc->uc_mcontext.gregs[REG_RIP]; +} + +static inline bool host_signal_write(siginfo_t *info, ucontext_t *uc) +{ + return uc->uc_mcontext.gregs[REG_TRAPNO] == 0xe + && (uc->uc_mcontext.gregs[REG_ERR] & 0x2); +} + +#endif |