diff options
Diffstat (limited to 'arch/x86/um/shared/sysdep/mcontext.h')
-rw-r--r-- | arch/x86/um/shared/sysdep/mcontext.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/x86/um/shared/sysdep/mcontext.h b/arch/x86/um/shared/sysdep/mcontext.h new file mode 100644 index 00000000000..b724c54da31 --- /dev/null +++ b/arch/x86/um/shared/sysdep/mcontext.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __SYS_SIGCONTEXT_X86_H | ||
7 | #define __SYS_SIGCONTEXT_X86_H | ||
8 | |||
9 | extern void get_regs_from_mc(struct uml_pt_regs *, mcontext_t *); | ||
10 | |||
11 | #ifdef __i386__ | ||
12 | |||
13 | #define GET_FAULTINFO_FROM_MC(fi, mc) \ | ||
14 | { \ | ||
15 | (fi).cr2 = (mc)->cr2; \ | ||
16 | (fi).error_code = (mc)->gregs[REG_ERR]; \ | ||
17 | (fi).trap_no = (mc)->gregs[REG_TRAPNO]; \ | ||
18 | } | ||
19 | |||
20 | #else | ||
21 | |||
22 | #define GET_FAULTINFO_FROM_MC(fi, mc) \ | ||
23 | { \ | ||
24 | (fi).cr2 = (mc)->gregs[REG_CR2]; \ | ||
25 | (fi).error_code = (mc)->gregs[REG_ERR]; \ | ||
26 | (fi).trap_no = (mc)->gregs[REG_TRAPNO]; \ | ||
27 | } | ||
28 | |||
29 | #endif | ||
30 | |||
31 | #endif | ||