unwind.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef _UNWIND_H_
  2. #define _UNWIND_H_
  3. #include <linux/list.h>
  4. /* From ABI specifications */
  5. struct unwind_table_entry {
  6. unsigned int region_start;
  7. unsigned int region_end;
  8. unsigned int Cannot_unwind:1; /* 0 */
  9. unsigned int Millicode:1; /* 1 */
  10. unsigned int Millicode_save_sr0:1; /* 2 */
  11. unsigned int Region_description:2; /* 3..4 */
  12. unsigned int reserved1:1; /* 5 */
  13. unsigned int Entry_SR:1; /* 6 */
  14. unsigned int Entry_FR:4; /* number saved *//* 7..10 */
  15. unsigned int Entry_GR:5; /* number saved *//* 11..15 */
  16. unsigned int Args_stored:1; /* 16 */
  17. unsigned int Variable_Frame:1; /* 17 */
  18. unsigned int Separate_Package_Body:1; /* 18 */
  19. unsigned int Frame_Extension_Millicode:1; /* 19 */
  20. unsigned int Stack_Overflow_Check:1; /* 20 */
  21. unsigned int Two_Instruction_SP_Increment:1; /* 21 */
  22. unsigned int Ada_Region:1; /* 22 */
  23. unsigned int cxx_info:1; /* 23 */
  24. unsigned int cxx_try_catch:1; /* 24 */
  25. unsigned int sched_entry_seq:1; /* 25 */
  26. unsigned int reserved2:1; /* 26 */
  27. unsigned int Save_SP:1; /* 27 */
  28. unsigned int Save_RP:1; /* 28 */
  29. unsigned int Save_MRP_in_frame:1; /* 29 */
  30. unsigned int extn_ptr_defined:1; /* 30 */
  31. unsigned int Cleanup_defined:1; /* 31 */
  32. unsigned int MPE_XL_interrupt_marker:1; /* 0 */
  33. unsigned int HP_UX_interrupt_marker:1; /* 1 */
  34. unsigned int Large_frame:1; /* 2 */
  35. unsigned int Pseudo_SP_Set:1; /* 3 */
  36. unsigned int reserved4:1; /* 4 */
  37. unsigned int Total_frame_size:27; /* 5..31 */
  38. };
  39. struct unwind_table {
  40. struct list_head list;
  41. const char *name;
  42. unsigned long gp;
  43. unsigned long base_addr;
  44. unsigned long start;
  45. unsigned long end;
  46. const struct unwind_table_entry *table;
  47. unsigned long length;
  48. };
  49. struct unwind_frame_info {
  50. struct task_struct *t;
  51. /* Eventually we would like to be able to get at any of the registers
  52. available; but for now we only try to get the sp and ip for each
  53. frame */
  54. /* struct pt_regs regs; */
  55. unsigned long sp, ip, rp, r31;
  56. unsigned long prev_sp, prev_ip;
  57. };
  58. struct unwind_table *
  59. unwind_table_add(const char *name, unsigned long base_addr,
  60. unsigned long gp, void *start, void *end);
  61. void
  62. unwind_table_remove(struct unwind_table *table);
  63. void unwind_frame_init(struct unwind_frame_info *info, struct task_struct *t,
  64. struct pt_regs *regs);
  65. void unwind_frame_init_from_blocked_task(struct unwind_frame_info *info, struct task_struct *t);
  66. void unwind_frame_init_running(struct unwind_frame_info *info, struct pt_regs *regs);
  67. int unwind_once(struct unwind_frame_info *info);
  68. int unwind_to_user(struct unwind_frame_info *info);
  69. int unwind_init(void);
  70. #endif