]> git.proxmox.com Git - mirror_qemu.git/blame - bsd-user/freebsd/target_os_ucontext.h
Merge tag 'bsd-user-mmap-pull-request' of https://gitlab.com/bsdimp/qemu into staging
[mirror_qemu.git] / bsd-user / freebsd / target_os_ucontext.h
CommitLineData
aa3a2428
WL
1/*
2 * FreeBSD has a common ucontext definition for all architectures.
3 *
4 * Copyright 2021 Warner Losh <imp@bsdimp.com>
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause
7 */
8#ifndef TARGET_OS_UCONTEXT_H
9#define TARGET_OS_UCONTEXT_H
10
11/*
12 * Defines the common bits for all of FreeBSD's architectures. Has to be
13 * included AFTER the MD target_mcontext_t is defined, however, so can't
14 * be in the grab-bag that is target_os_signal.h.
15 */
16
17/* See FreeBSD's sys/ucontext.h */
18#define TARGET_MC_GET_CLEAR_RET 0x0001
19
20/* FreeBSD's sys/_ucontext.h structures */
21typedef struct target_ucontext {
22 target_sigset_t uc_sigmask;
23 target_mcontext_t uc_mcontext;
24 abi_ulong uc_link;
25 target_stack_t uc_stack;
26 int32_t uc_flags;
27 int32_t __spare__[4];
28} target_ucontext_t;
29
aa3a2428
WL
30G_STATIC_ASSERT(TARGET_MCONTEXT_SIZE == sizeof(target_mcontext_t));
31G_STATIC_ASSERT(TARGET_UCONTEXT_SIZE == sizeof(target_ucontext_t));
aa3a2428 32
108fffe5
WL
33struct target_sigframe;
34
35abi_long set_sigtramp_args(CPUArchState *env, int sig,
36 struct target_sigframe *frame,
37 abi_ulong frame_addr,
38 struct target_sigaction *ka);
1103d59c
WL
39abi_long get_mcontext(CPUArchState *env, target_mcontext_t *mcp, int flags);
40abi_long set_mcontext(CPUArchState *env, target_mcontext_t *mcp, int srflag);
41abi_long get_ucontext_sigreturn(CPUArchState *env, abi_ulong target_sf,
108fffe5
WL
42 abi_ulong *target_uc);
43
aa3a2428 44#endif /* TARGET_OS_UCONTEXT_H */