mcontext.h 614 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  3. * Licensed under the GPL
  4. */
  5. #ifndef __SYS_SIGCONTEXT_X86_H
  6. #define __SYS_SIGCONTEXT_X86_H
  7. extern void get_regs_from_mc(struct uml_pt_regs *, mcontext_t *);
  8. #ifdef __i386__
  9. #define GET_FAULTINFO_FROM_MC(fi, mc) \
  10. { \
  11. (fi).cr2 = (mc)->cr2; \
  12. (fi).error_code = (mc)->gregs[REG_ERR]; \
  13. (fi).trap_no = (mc)->gregs[REG_TRAPNO]; \
  14. }
  15. #else
  16. #define GET_FAULTINFO_FROM_MC(fi, mc) \
  17. { \
  18. (fi).cr2 = (mc)->gregs[REG_CR2]; \
  19. (fi).error_code = (mc)->gregs[REG_ERR]; \
  20. (fi).trap_no = (mc)->gregs[REG_TRAPNO]; \
  21. }
  22. #endif
  23. #endif