ucontext_i.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* Copyright (C) 2004 Hewlett-Packard Co.
  2. Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
  3. This file is part of libunwind.
  4. Permission is hereby granted, free of charge, to any person obtaining
  5. a copy of this software and associated documentation files (the
  6. "Software"), to deal in the Software without restriction, including
  7. without limitation the rights to use, copy, modify, merge, publish,
  8. distribute, sublicense, and/or sell copies of the Software, and to
  9. permit persons to whom the Software is furnished to do so, subject to
  10. the following conditions:
  11. The above copyright notice and this permission notice shall be
  12. included in all copies or substantial portions of the Software.
  13. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  14. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  15. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  16. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  17. LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  18. OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  19. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  20. #if defined __linux__
  21. #define UC_MCONTEXT_GREGS_R8 0x28
  22. #define UC_MCONTEXT_GREGS_R9 0x30
  23. #define UC_MCONTEXT_GREGS_R10 0x38
  24. #define UC_MCONTEXT_GREGS_R11 0x40
  25. #define UC_MCONTEXT_GREGS_R12 0x48
  26. #define UC_MCONTEXT_GREGS_R13 0x50
  27. #define UC_MCONTEXT_GREGS_R14 0x58
  28. #define UC_MCONTEXT_GREGS_R15 0x60
  29. #define UC_MCONTEXT_GREGS_RDI 0x68
  30. #define UC_MCONTEXT_GREGS_RSI 0x70
  31. #define UC_MCONTEXT_GREGS_RBP 0x78
  32. #define UC_MCONTEXT_GREGS_RBX 0x80
  33. #define UC_MCONTEXT_GREGS_RDX 0x88
  34. #define UC_MCONTEXT_GREGS_RAX 0x90
  35. #define UC_MCONTEXT_GREGS_RCX 0x98
  36. #define UC_MCONTEXT_GREGS_RSP 0xa0
  37. #define UC_MCONTEXT_GREGS_RIP 0xa8
  38. #define UC_MCONTEXT_FPREGS_PTR 0x1a8
  39. #define UC_MCONTEXT_FPREGS_MEM 0xe0
  40. #define UC_SIGMASK 0x128
  41. #define FPREGS_OFFSET_MXCSR 0x18
  42. #elif defined __FreeBSD__
  43. #define UC_SIGMASK 0x0
  44. #define UC_MCONTEXT_GREGS_RDI 0x18
  45. #define UC_MCONTEXT_GREGS_RSI 0x20
  46. #define UC_MCONTEXT_GREGS_RDX 0x28
  47. #define UC_MCONTEXT_GREGS_RCX 0x30
  48. #define UC_MCONTEXT_GREGS_R8 0x38
  49. #define UC_MCONTEXT_GREGS_R9 0x40
  50. #define UC_MCONTEXT_GREGS_RAX 0x48
  51. #define UC_MCONTEXT_GREGS_RBX 0x50
  52. #define UC_MCONTEXT_GREGS_RBP 0x58
  53. #define UC_MCONTEXT_GREGS_R10 0x60
  54. #define UC_MCONTEXT_GREGS_R11 0x68
  55. #define UC_MCONTEXT_GREGS_R12 0x70
  56. #define UC_MCONTEXT_GREGS_R13 0x78
  57. #define UC_MCONTEXT_GREGS_R14 0x80
  58. #define UC_MCONTEXT_GREGS_R15 0x88
  59. #define UC_MCONTEXT_FS 0x94
  60. #define UC_MCONTEXT_GS 0x96
  61. #define UC_MCONTEXT_FLAGS 0xa0
  62. #define UC_MCONTEXT_ES 0xa4
  63. #define UC_MCONTEXT_DS 0xa6
  64. #define UC_MCONTEXT_GREGS_RIP 0xb0
  65. #define UC_MCONTEXT_CS 0xb8
  66. #define UC_MCONTEXT_RFLAGS 0xc0
  67. #define UC_MCONTEXT_GREGS_RSP 0xc8
  68. #define UC_MCONTEXT_SS 0xd0
  69. #define UC_MCONTEXT_MC_LEN 0xd8
  70. #define UC_MCONTEXT_FPFORMAT 0xe0
  71. #define UC_MCONTEXT_OWNEDFP 0xe8
  72. #define UC_MCONTEXT_FPSTATE 0xf0
  73. #define UC_MCONTEXT_FPOWNED_FPU 0x20001
  74. #define UC_MCONTEXT_FPFMT_XMM 0x10002
  75. #define UC_MCONTEXT_MC_LEN_VAL 0x320
  76. #endif