2
0

target_os_siginfo.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #ifndef TARGET_OS_SIGINFO_H
  2. #define TARGET_OS_SIGINFO_H
  3. #define TARGET_NSIG 32 /* counting 0; could be 33 (mask is 1-32) */
  4. #define TARGET_NSIG_BPW (sizeof(uint32_t) * 8)
  5. #define TARGET_NSIG_WORDS (TARGET_NSIG / TARGET_NSIG_BPW)
  6. /* this struct defines a stack used during syscall handling */
  7. typedef struct target_sigaltstack {
  8. abi_long ss_sp;
  9. abi_ulong ss_size;
  10. abi_long ss_flags;
  11. } target_stack_t;
  12. typedef struct {
  13. uint32_t __bits[TARGET_NSIG_WORDS];
  14. } target_sigset_t
  15. struct target_sigaction {
  16. abi_ulong _sa_handler;
  17. int32_t sa_flags;
  18. target_sigset_t sa_mask;
  19. };
  20. /* Compare to sys/siginfo.h */
  21. typedef union target_sigval {
  22. int sival_int;
  23. abi_ulong sival_ptr;
  24. } target_sigval_t;
  25. struct target_ksiginfo {
  26. int32_t _signo;
  27. int32_t _code;
  28. int32_t _errno;
  29. #if TARGET_ABI_BITS == 64
  30. int32_t _pad;
  31. #endif
  32. union {
  33. struct {
  34. int32_t _pid;
  35. int32_t _uid;
  36. target_sigval_t _value;
  37. } _rt;
  38. struct {
  39. int32_t _pid;
  40. int32_t _uid;
  41. int32_t _struct;
  42. /* clock_t _utime; */
  43. /* clock_t _stime; */
  44. } _child;
  45. struct {
  46. abi_ulong _addr;
  47. int32_t _trap;
  48. } _fault;
  49. struct {
  50. long _band;
  51. int _fd;
  52. } _poll;
  53. } _reason;
  54. };
  55. typedef union target_siginfo {
  56. int8_t si_pad[128];
  57. struct target_ksiginfo _info;
  58. } target_siginfo_t;
  59. #define target_si_signo _info._signo
  60. #define target_si_code _info._code
  61. #define target_si_errno _info._errno
  62. #define target_si_addr _info._reason._fault._addr
  63. #define TARGET_SEGV_MAPERR 1
  64. #define TARGET_SEGV_ACCERR 2
  65. #define TARGET_TRAP_BRKPT 1
  66. #define TARGET_TRAP_TRACE 2
  67. #endif /* TARGET_OS_SIGINFO_H */