stub_segv.c 504 B

1234567891011121314151617181920212223
  1. /*
  2. * Copyright (C) 2004 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  3. * Licensed under the GPL
  4. */
  5. #include <signal.h>
  6. #include "as-layout.h"
  7. #include "sysdep/stub.h"
  8. #include "sysdep/faultinfo.h"
  9. #include "sysdep/sigcontext.h"
  10. void __attribute__ ((__section__ (".__syscall_stub")))
  11. stub_segv_handler(int sig)
  12. {
  13. struct ucontext *uc;
  14. __asm__ __volatile__("movq %%rdx, %0" : "=g" (uc) :);
  15. GET_FAULTINFO_FROM_SC(*((struct faultinfo *) STUB_DATA),
  16. &uc->uc_mcontext);
  17. trap_myself();
  18. }