libunwind-sh.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /* libunwind - a platform-independent unwind library
  2. Copyright (C) 2008 CodeSourcery
  3. Copyright (C) 2012 Tommi Rantala <[email protected]>
  4. This file is part of libunwind.
  5. Permission is hereby granted, free of charge, to any person obtaining
  6. a copy of this software and associated documentation files (the
  7. "Software"), to deal in the Software without restriction, including
  8. without limitation the rights to use, copy, modify, merge, publish,
  9. distribute, sublicense, and/or sell copies of the Software, and to
  10. permit persons to whom the Software is furnished to do so, subject to
  11. the following conditions:
  12. The above copyright notice and this permission notice shall be
  13. included in all copies or substantial portions of the Software.
  14. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  15. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  16. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  17. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  18. LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  19. OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  20. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  21. #ifndef LIBUNWIND_H
  22. #define LIBUNWIND_H
  23. #if defined(__cplusplus) || defined(c_plusplus)
  24. extern "C" {
  25. #endif
  26. #include <inttypes.h>
  27. #include <stddef.h>
  28. #include <ucontext.h>
  29. #define UNW_TARGET sh
  30. #define UNW_TARGET_SH 1
  31. #define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
  32. /* This needs to be big enough to accommodate "struct cursor", while
  33. leaving some slack for future expansion. Changing this value will
  34. require recompiling all users of this library. Stack allocation is
  35. relatively cheap and unwind-state copying is relatively rare, so we
  36. want to err on making it rather too big than too small. */
  37. #define UNW_TDEP_CURSOR_LEN 4096
  38. typedef uint32_t unw_word_t;
  39. typedef int32_t unw_sword_t;
  40. typedef long double unw_tdep_fpreg_t;
  41. typedef enum
  42. {
  43. UNW_SH_R0,
  44. UNW_SH_R1,
  45. UNW_SH_R2,
  46. UNW_SH_R3,
  47. UNW_SH_R4,
  48. UNW_SH_R5,
  49. UNW_SH_R6,
  50. UNW_SH_R7,
  51. UNW_SH_R8,
  52. UNW_SH_R9,
  53. UNW_SH_R10,
  54. UNW_SH_R11,
  55. UNW_SH_R12,
  56. UNW_SH_R13,
  57. UNW_SH_R14,
  58. UNW_SH_R15,
  59. UNW_SH_PC,
  60. UNW_SH_PR,
  61. UNW_TDEP_LAST_REG = UNW_SH_PR,
  62. UNW_TDEP_IP = UNW_SH_PR,
  63. UNW_TDEP_SP = UNW_SH_R15,
  64. UNW_TDEP_EH = UNW_SH_R0
  65. }
  66. sh_regnum_t;
  67. #define UNW_TDEP_NUM_EH_REGS 2
  68. typedef ucontext_t unw_tdep_context_t;
  69. #define unw_tdep_getcontext(uc) (getcontext (uc), 0)
  70. typedef struct unw_tdep_save_loc
  71. {
  72. /* Additional target-dependent info on a save location. */
  73. /* ANDROID support update. */
  74. char __reserved;
  75. /* End of ANDROID update. */
  76. }
  77. unw_tdep_save_loc_t;
  78. #include "libunwind-dynamic.h"
  79. typedef struct
  80. {
  81. /* no sh-specific auxiliary proc-info */
  82. /* ANDROID support update. */
  83. char __reserved;
  84. /* End of ANDROID update. */
  85. }
  86. unw_tdep_proc_info_t;
  87. #include "libunwind-common.h"
  88. #define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
  89. extern int unw_tdep_is_fpreg (int);
  90. #if defined(__cplusplus) || defined(c_plusplus)
  91. }
  92. #endif
  93. #endif /* LIBUNWIND_H */