ucontext.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (C) 2012 ARM Ltd.
  3. * Copyright (C) 2017 SiFive, Inc.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. *
  17. * This file was copied from arch/arm64/include/uapi/asm/ucontext.h
  18. */
  19. #ifndef _UAPI__ASM_UCONTEXT_H
  20. #define _UAPI__ASM_UCONTEXT_H
  21. #include <linux/types.h>
  22. struct ucontext {
  23. unsigned long uc_flags;
  24. struct ucontext *uc_link;
  25. stack_t uc_stack;
  26. sigset_t uc_sigmask;
  27. /* There's some padding here to allow sigset_t to be expanded in the
  28. * future. Though this is unlikely, other architectures put uc_sigmask
  29. * at the end of this structure and explicitly state it can be
  30. * expanded, so we didn't want to box ourselves in here. */
  31. __u8 __unused[1024 / 8 - sizeof(sigset_t)];
  32. /* We can't put uc_sigmask at the end of this structure because we need
  33. * to be able to expand sigcontext in the future. For example, the
  34. * vector ISA extension will almost certainly add ISA state. We want
  35. * to ensure all user-visible ISA state can be saved and restored via a
  36. * ucontext, so we're putting this at the end in order to allow for
  37. * infinite extensibility. Since we know this will be extended and we
  38. * assume sigset_t won't be extended an extreme amount, we're
  39. * prioritizing this. */
  40. struct sigcontext uc_mcontext;
  41. };
  42. #endif /* _UAPI__ASM_UCONTEXT_H */