ptrace-x86_64.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Copyright 2003 PathScale, Inc.
  3. *
  4. * Licensed under the GPL
  5. */
  6. #ifndef __UM_PTRACE_X86_64_H
  7. #define __UM_PTRACE_X86_64_H
  8. #include "linux/compiler.h"
  9. #define signal_fault signal_fault_x86_64
  10. #define __FRAME_OFFSETS /* Needed to get the R* macros */
  11. #include "asm/ptrace-generic.h"
  12. #undef signal_fault
  13. #define HOST_AUDIT_ARCH AUDIT_ARCH_X86_64
  14. void signal_fault(struct pt_regs_subarch *regs, void *frame, char *where);
  15. #define FS_BASE (21 * sizeof(unsigned long))
  16. #define GS_BASE (22 * sizeof(unsigned long))
  17. #define DS (23 * sizeof(unsigned long))
  18. #define ES (24 * sizeof(unsigned long))
  19. #define FS (25 * sizeof(unsigned long))
  20. #define GS (26 * sizeof(unsigned long))
  21. #define PT_REGS_RBX(r) UPT_RBX(&(r)->regs)
  22. #define PT_REGS_RCX(r) UPT_RCX(&(r)->regs)
  23. #define PT_REGS_RDX(r) UPT_RDX(&(r)->regs)
  24. #define PT_REGS_RSI(r) UPT_RSI(&(r)->regs)
  25. #define PT_REGS_RDI(r) UPT_RDI(&(r)->regs)
  26. #define PT_REGS_RBP(r) UPT_RBP(&(r)->regs)
  27. #define PT_REGS_RAX(r) UPT_RAX(&(r)->regs)
  28. #define PT_REGS_R8(r) UPT_R8(&(r)->regs)
  29. #define PT_REGS_R9(r) UPT_R9(&(r)->regs)
  30. #define PT_REGS_R10(r) UPT_R10(&(r)->regs)
  31. #define PT_REGS_R11(r) UPT_R11(&(r)->regs)
  32. #define PT_REGS_R12(r) UPT_R12(&(r)->regs)
  33. #define PT_REGS_R13(r) UPT_R13(&(r)->regs)
  34. #define PT_REGS_R14(r) UPT_R14(&(r)->regs)
  35. #define PT_REGS_R15(r) UPT_R15(&(r)->regs)
  36. #define PT_REGS_FS(r) UPT_FS(&(r)->regs)
  37. #define PT_REGS_GS(r) UPT_GS(&(r)->regs)
  38. #define PT_REGS_DS(r) UPT_DS(&(r)->regs)
  39. #define PT_REGS_ES(r) UPT_ES(&(r)->regs)
  40. #define PT_REGS_SS(r) UPT_SS(&(r)->regs)
  41. #define PT_REGS_CS(r) UPT_CS(&(r)->regs)
  42. #define PT_REGS_ORIG_RAX(r) UPT_ORIG_RAX(&(r)->regs)
  43. #define PT_REGS_RIP(r) UPT_IP(&(r)->regs)
  44. #define PT_REGS_RSP(r) UPT_SP(&(r)->regs)
  45. #define PT_REGS_EFLAGS(r) UPT_EFLAGS(&(r)->regs)
  46. /* XXX */
  47. #define user_mode(r) UPT_IS_USER(&(r)->regs)
  48. #define PT_REGS_ORIG_SYSCALL(r) PT_REGS_RAX(r)
  49. #define PT_REGS_SYSCALL_RET(r) PT_REGS_RAX(r)
  50. #define PT_FIX_EXEC_STACK(sp) do ; while(0)
  51. #define profile_pc(regs) PT_REGS_IP(regs)
  52. #endif
  53. /*
  54. * Overrides for Emacs so that we follow Linus's tabbing style.
  55. * Emacs will notice this stuff at the end of the file and automatically
  56. * adjust the settings for this buffer only. This must remain at the end
  57. * of the file.
  58. * ---------------------------------------------------------------------------
  59. * Local variables:
  60. * c-file-style: "linux"
  61. * End:
  62. */