target_os_ucontext.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. * Defines the common bits for all of FreeBSD's architectures. Has to be
  12. * included AFTER the MD target_mcontext_t is defined, however, so can't
  13. * be in the grab-bag that is target_os_signal.h.
  14. */
  15. /* See FreeBSD's sys/ucontext.h */
  16. #define TARGET_MC_GET_CLEAR_RET 0x0001
  17. /* FreeBSD's sys/_ucontext.h structures */
  18. typedef struct target_ucontext {
  19. target_sigset_t uc_sigmask;
  20. target_mcontext_t uc_mcontext;
  21. abi_ulong uc_link;
  22. target_stack_t uc_stack;
  23. int32_t uc_flags;
  24. int32_t __spare__[4];
  25. } target_ucontext_t;
  26. G_STATIC_ASSERT(TARGET_MCONTEXT_SIZE == sizeof(target_mcontext_t));
  27. G_STATIC_ASSERT(TARGET_UCONTEXT_SIZE == sizeof(target_ucontext_t));
  28. struct target_sigframe;
  29. abi_long set_sigtramp_args(CPUArchState *env, int sig,
  30. struct target_sigframe *frame,
  31. abi_ulong frame_addr,
  32. struct target_sigaction *ka);
  33. abi_long get_mcontext(CPUArchState *env, target_mcontext_t *mcp, int flags);
  34. abi_long set_mcontext(CPUArchState *env, target_mcontext_t *mcp, int srflag);
  35. abi_long get_ucontext_sigreturn(CPUArchState *env, abi_ulong target_sf,
  36. abi_ulong *target_uc);
  37. #endif /* TARGET_OS_UCONTEXT_H */