summaryrefslogtreecommitdiffstats
path: root/arch/um/sys-x86
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/sys-x86')
-rw-r--r--arch/um/sys-x86/shared/sysdep/sigcontext_32.h7
-rw-r--r--arch/um/sys-x86/shared/sysdep/sigcontext_64.h7
-rw-r--r--arch/um/sys-x86/stub_segv.c2
3 files changed, 15 insertions, 1 deletions
diff --git a/arch/um/sys-x86/shared/sysdep/sigcontext_32.h b/arch/um/sys-x86/shared/sysdep/sigcontext_32.h
index aebc2dd61f0d..548c3cdb743b 100644
--- a/arch/um/sys-x86/shared/sysdep/sigcontext_32.h
+++ b/arch/um/sys-x86/shared/sysdep/sigcontext_32.h
@@ -22,4 +22,11 @@
(fi).trap_no = SC_TRAPNO(sc); \
}
+#define GET_FAULTINFO_FROM_MC(fi, mc) \
+ { \
+ (fi).cr2 = (mc)->cr2; \
+ (fi).error_code = (mc)->gregs[REG_ERR]; \
+ (fi).trap_no = (mc)->gregs[REG_TRAPNO]; \
+ }
+
#endif
diff --git a/arch/um/sys-x86/shared/sysdep/sigcontext_64.h b/arch/um/sys-x86/shared/sysdep/sigcontext_64.h
index 60d89a2fba06..5c4a6a359141 100644
--- a/arch/um/sys-x86/shared/sysdep/sigcontext_64.h
+++ b/arch/um/sys-x86/shared/sysdep/sigcontext_64.h
@@ -22,4 +22,11 @@
(fi).trap_no = SC_TRAPNO(sc); \
}
+#define GET_FAULTINFO_FROM_MC(fi, mc) \
+ { \
+ (fi).cr2 = (mc)->gregs[REG_CR2]; \
+ (fi).error_code = (mc)->gregs[REG_ERR]; \
+ (fi).trap_no = (mc)->gregs[REG_TRAPNO]; \
+ }
+
#endif
diff --git a/arch/um/sys-x86/stub_segv.c b/arch/um/sys-x86/stub_segv.c
index f62771cf236e..bd2eaf69103f 100644
--- a/arch/um/sys-x86/stub_segv.c
+++ b/arch/um/sys-x86/stub_segv.c
@@ -12,7 +12,7 @@ stub_segv_handler(int sig, siginfo_t *info, void *p)
{
struct ucontext *uc = p;
- GET_FAULTINFO_FROM_SC(*((struct faultinfo *) STUB_DATA),
+ GET_FAULTINFO_FROM_MC(*((struct faultinfo *) STUB_DATA),
&uc->uc_mcontext);
trap_myself();
}
OpenPOWER on IntegriCloud