summaryrefslogtreecommitdiff
path: root/arch/um/sys-x86
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2011-08-18 20:05:09 +0100
committerRichard Weinberger <richard@nod.at>2011-11-02 14:14:59 +0100
commit248b74c79ebb9fb55e146797a808836d90418c4b (patch)
tree2d043bee58d2d8995ca4ccedf9d00513a13297cb /arch/um/sys-x86
parent05c46db4d7d51af969e09f9f1adbff66ee2e84b4 (diff)
um: start switching the references to host mcontext_t to its userland type
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Richard Weinberger <richard@nod.at>
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();
}