ucontext.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) 2022, Ali Mohammad Pur <mpfard@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <Kernel/API/POSIX/signal.h>
  8. #include <Kernel/API/POSIX/sys/types.h>
  9. #include <Kernel/Arch/mcontext.h>
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. typedef struct __mcontext mcontext_t;
  14. typedef struct __ucontext {
  15. struct __ucontext* uc_link;
  16. sigset_t uc_sigmask;
  17. stack_t uc_stack;
  18. mcontext_t uc_mcontext;
  19. } ucontext_t;
  20. #define ILL_ILLOPC 0
  21. #define ILL_ILLOPN 1
  22. #define ILL_ILLADR 2
  23. #define ILL_ILLTRP 3
  24. #define ILL_PRVOPC 4
  25. #define ILL_PRVREG 5
  26. #define ILL_COPROC 6
  27. #define ILL_BADSTK 7
  28. #define FPE_INTDIV 0
  29. #define FPE_INTOVF 1
  30. #define FPE_FLTDIV 2
  31. #define FPE_FLTOVF 3
  32. #define FPE_FLTUND 4
  33. #define FPE_FLTRES 5
  34. #define FPE_FLTINV 6
  35. #define SEGV_MAPERR 0
  36. #define SEGV_ACCERR 1
  37. #define BUS_ADRALN 0
  38. #define BUS_ADRERR 1
  39. #define BUS_OBJERR 2
  40. #define TRAP_BRKPT 0
  41. #define TRAP_TRACE 1
  42. #define SI_USER 0x40000000
  43. #define SI_QUEUE 0x40000001
  44. #define SI_TIMER 0x40000002
  45. #define SI_ASYNCIO 0x40000003
  46. #define SI_MESGQ 0x40000004
  47. #define SI_NOINFO 0x40000042
  48. #ifdef __cplusplus
  49. }
  50. #endif