ptrace.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * include/asm-xtensa/ptrace.h
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. *
  8. * Copyright (C) 2001 - 2005 Tensilica Inc.
  9. */
  10. #ifndef _XTENSA_PTRACE_H
  11. #define _XTENSA_PTRACE_H
  12. #include <uapi/asm/ptrace.h>
  13. #ifndef __ASSEMBLY__
  14. #include <asm/coprocessor.h>
  15. /*
  16. * This struct defines the way the registers are stored on the
  17. * kernel stack during a system call or other kernel entry.
  18. */
  19. struct pt_regs {
  20. unsigned long pc; /* 4 */
  21. unsigned long ps; /* 8 */
  22. unsigned long depc; /* 12 */
  23. unsigned long exccause; /* 16 */
  24. unsigned long excvaddr; /* 20 */
  25. unsigned long debugcause; /* 24 */
  26. unsigned long wmask; /* 28 */
  27. unsigned long lbeg; /* 32 */
  28. unsigned long lend; /* 36 */
  29. unsigned long lcount; /* 40 */
  30. unsigned long sar; /* 44 */
  31. unsigned long windowbase; /* 48 */
  32. unsigned long windowstart; /* 52 */
  33. unsigned long syscall; /* 56 */
  34. unsigned long icountlevel; /* 60 */
  35. unsigned long scompare1; /* 64 */
  36. /* Additional configurable registers that are used by the compiler. */
  37. xtregs_opt_t xtregs_opt;
  38. /* Make sure the areg field is 16 bytes aligned. */
  39. int align[0] __attribute__ ((aligned(16)));
  40. /* current register frame.
  41. * Note: The ESF for kernel exceptions ends after 16 registers!
  42. */
  43. unsigned long areg[16]; /* 128 (64) */
  44. };
  45. #include <variant/core.h>
  46. # define arch_has_single_step() (1)
  47. # define task_pt_regs(tsk) ((struct pt_regs*) \
  48. (task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1)
  49. # define user_mode(regs) (((regs)->ps & 0x00000020)!=0)
  50. # define instruction_pointer(regs) ((regs)->pc)
  51. # ifndef CONFIG_SMP
  52. # define profile_pc(regs) instruction_pointer(regs)
  53. # endif
  54. #define user_stack_pointer(regs) ((regs)->areg[1])
  55. #else /* __ASSEMBLY__ */
  56. # include <asm/asm-offsets.h>
  57. #define PT_REGS_OFFSET (KERNEL_STACK_SIZE - PT_USER_SIZE)
  58. #endif /* !__ASSEMBLY__ */
  59. #endif /* _XTENSA_PTRACE_H */