ptrace.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef __UM_X86_PTRACE_H
  2. #define __UM_X86_PTRACE_H
  3. #ifdef CONFIG_X86_32
  4. # include "ptrace_32.h"
  5. #else
  6. # include "ptrace_64.h"
  7. #endif
  8. #define PT_REGS_AX(r) UPT_AX(&(r)->regs)
  9. #define PT_REGS_BX(r) UPT_BX(&(r)->regs)
  10. #define PT_REGS_CX(r) UPT_CX(&(r)->regs)
  11. #define PT_REGS_DX(r) UPT_DX(&(r)->regs)
  12. #define PT_REGS_SI(r) UPT_SI(&(r)->regs)
  13. #define PT_REGS_DI(r) UPT_DI(&(r)->regs)
  14. #define PT_REGS_BP(r) UPT_BP(&(r)->regs)
  15. #define PT_REGS_EFLAGS(r) UPT_EFLAGS(&(r)->regs)
  16. #define PT_REGS_CS(r) UPT_CS(&(r)->regs)
  17. #define PT_REGS_SS(r) UPT_SS(&(r)->regs)
  18. #define PT_REGS_DS(r) UPT_DS(&(r)->regs)
  19. #define PT_REGS_ES(r) UPT_ES(&(r)->regs)
  20. #define PT_REGS_ORIG_SYSCALL(r) PT_REGS_AX(r)
  21. #define PT_REGS_SYSCALL_RET(r) PT_REGS_AX(r)
  22. #define PT_FIX_EXEC_STACK(sp) do ; while(0)
  23. #define profile_pc(regs) PT_REGS_IP(regs)
  24. #define UPT_RESTART_SYSCALL(r) (UPT_IP(r) -= 2)
  25. #define PT_REGS_SET_SYSCALL_RETURN(r, res) (PT_REGS_AX(r) = (res))
  26. static inline long regs_return_value(struct pt_regs *regs)
  27. {
  28. return PT_REGS_AX(regs);
  29. }
  30. #endif /* __UM_X86_PTRACE_H */