faultinfo_64.h 983 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (C) 2004 Fujitsu Siemens Computers GmbH
  3. * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
  4. * Licensed under the GPL
  5. */
  6. #ifndef __FAULTINFO_X86_64_H
  7. #define __FAULTINFO_X86_64_H
  8. /* this structure contains the full arch-specific faultinfo
  9. * from the traps.
  10. * On i386, ptrace_faultinfo unfortunately doesn't provide
  11. * all the info, since trap_no is missing.
  12. * All common elements are defined at the same position in
  13. * both structures, thus making it easy to copy the
  14. * contents without knowledge about the structure elements.
  15. */
  16. struct faultinfo {
  17. int error_code; /* in ptrace_faultinfo misleadingly called is_write */
  18. unsigned long cr2; /* in ptrace_faultinfo called addr */
  19. int trap_no; /* missing in ptrace_faultinfo */
  20. };
  21. #define FAULT_WRITE(fi) ((fi).error_code & 2)
  22. #define FAULT_ADDRESS(fi) ((fi).cr2)
  23. /* This is Page Fault */
  24. #define SEGV_IS_FIXABLE(fi) ((fi)->trap_no == 14)
  25. #define PTRACE_FULL_FAULTINFO 1
  26. #endif