ptrace_64.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright 2003 PathScale, Inc.
  3. * Copyright (C) 2003 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  4. *
  5. * Licensed under the GPL
  6. */
  7. #ifndef __SYSDEP_X86_64_PTRACE_H
  8. #define __SYSDEP_X86_64_PTRACE_H
  9. #define MAX_FP_NR HOST_FP_SIZE
  10. #define REGS_R8(r) ((r)[HOST_R8])
  11. #define REGS_R9(r) ((r)[HOST_R9])
  12. #define REGS_R10(r) ((r)[HOST_R10])
  13. #define REGS_R11(r) ((r)[HOST_R11])
  14. #define REGS_R12(r) ((r)[HOST_R12])
  15. #define REGS_R13(r) ((r)[HOST_R13])
  16. #define REGS_R14(r) ((r)[HOST_R14])
  17. #define REGS_R15(r) ((r)[HOST_R15])
  18. #define HOST_FS_BASE 21
  19. #define HOST_GS_BASE 22
  20. #define HOST_DS 23
  21. #define HOST_ES 24
  22. #define HOST_FS 25
  23. #define HOST_GS 26
  24. /* Also defined in asm/ptrace-x86_64.h, but not in libc headers. So, these
  25. * are already defined for kernel code, but not for userspace code.
  26. */
  27. #ifndef FS_BASE
  28. /* These aren't defined in ptrace.h, but exist in struct user_regs_struct,
  29. * which is what x86_64 ptrace actually uses.
  30. */
  31. #define FS_BASE (HOST_FS_BASE * sizeof(long))
  32. #define GS_BASE (HOST_GS_BASE * sizeof(long))
  33. #define DS (HOST_DS * sizeof(long))
  34. #define ES (HOST_ES * sizeof(long))
  35. #define FS (HOST_FS * sizeof(long))
  36. #define GS (HOST_GS * sizeof(long))
  37. #endif
  38. #define UPT_R8(r) REGS_R8((r)->gp)
  39. #define UPT_R9(r) REGS_R9((r)->gp)
  40. #define UPT_R10(r) REGS_R10((r)->gp)
  41. #define UPT_R11(r) REGS_R11((r)->gp)
  42. #define UPT_R12(r) REGS_R12((r)->gp)
  43. #define UPT_R13(r) REGS_R13((r)->gp)
  44. #define UPT_R14(r) REGS_R14((r)->gp)
  45. #define UPT_R15(r) REGS_R15((r)->gp)
  46. #define UPT_SYSCALL_ARG1(r) UPT_DI(r)
  47. #define UPT_SYSCALL_ARG2(r) UPT_SI(r)
  48. #define UPT_SYSCALL_ARG3(r) UPT_DX(r)
  49. #define UPT_SYSCALL_ARG4(r) UPT_R10(r)
  50. #define UPT_SYSCALL_ARG5(r) UPT_R8(r)
  51. #define UPT_SYSCALL_ARG6(r) UPT_R9(r)
  52. static inline void arch_init_registers(int pid)
  53. {
  54. }
  55. #endif