2 * FreeBSD has a common ucontext definition for all architectures.
4 * Copyright 2021 Warner Losh <imp@bsdimp.com>
6 * SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause
8 #ifndef TARGET_OS_UCONTEXT_H
9 #define TARGET_OS_UCONTEXT_H
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.
17 /* See FreeBSD's sys/ucontext.h */
18 #define TARGET_MC_GET_CLEAR_RET 0x0001
20 /* FreeBSD's sys/_ucontext.h structures */
21 typedef struct target_ucontext
{
22 target_sigset_t uc_sigmask
;
23 target_mcontext_t uc_mcontext
;
25 target_stack_t uc_stack
;
30 G_STATIC_ASSERT(TARGET_MCONTEXT_SIZE
== sizeof(target_mcontext_t
));
31 G_STATIC_ASSERT(TARGET_UCONTEXT_SIZE
== sizeof(target_ucontext_t
));
33 struct target_sigframe
;
35 abi_long
set_sigtramp_args(CPUArchState
*env
, int sig
,
36 struct target_sigframe
*frame
,
38 struct target_sigaction
*ka
);
39 abi_long
get_mcontext(CPUArchState
*env
, target_mcontext_t
*mcp
, int flags
);
40 abi_long
set_mcontext(CPUArchState
*env
, target_mcontext_t
*mcp
, int srflag
);
41 abi_long
get_ucontext_sigreturn(CPUArchState
*env
, abi_ulong target_sf
,
42 abi_ulong
*target_uc
);
44 #endif /* TARGET_OS_UCONTEXT_H */