blob: ced051afc705c47ad29bcbacc78a0443a064267a [file] [log] [blame]
Jeff Diked67b5692005-07-07 17:56:49 -07001/*
Jeff Dikeee3d9bd2008-02-04 22:30:56 -08002 * Copyright (C) 2004 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
Jeff Diked67b5692005-07-07 17:56:49 -07003 * Licensed under the GPL
4 */
5
Jeff Dike17d46972005-11-21 21:32:09 -08006#include <signal.h>
Jeff Dike54ae36f2007-10-16 01:27:33 -07007#include "as-layout.h"
Jeff Dike17d46972005-11-21 21:32:09 -08008#include "sysdep/stub.h"
Jeff Dikeee3d9bd2008-02-04 22:30:56 -08009#include "sysdep/faultinfo.h"
10#include "sysdep/sigcontext.h"
Jeff Diked67b5692005-07-07 17:56:49 -070011
12void __attribute__ ((__section__ (".__syscall_stub")))
13stub_segv_handler(int sig)
14{
15 struct ucontext *uc;
16
Jeff Dikefb30d642006-04-18 22:21:44 -070017 __asm__ __volatile__("movq %%rdx, %0" : "=g" (uc) :);
Jeff Dike54ae36f2007-10-16 01:27:33 -070018 GET_FAULTINFO_FROM_SC(*((struct faultinfo *) STUB_DATA),
Jeff Dike50f72b52005-10-09 16:11:44 -040019 &uc->uc_mcontext);
Jeff Dikeee3d9bd2008-02-04 22:30:56 -080020 trap_myself();
Jeff Diked67b5692005-07-07 17:56:49 -070021}
Jeff Dikeee3d9bd2008-02-04 22:30:56 -080022