um: get rid of sysdep/sc.h
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / um / sys-x86_64 / shared / sysdep / sigcontext.h
blob9fb527713efbd8f3f06716e5716b025a869ff47a
1 /*
2 * Copyright 2003 PathScale, Inc.
4 * Licensed under the GPL
5 */
7 #ifndef __SYSDEP_X86_64_SIGCONTEXT_H
8 #define __SYSDEP_X86_64_SIGCONTEXT_H
10 #include <generated/user_constants.h>
12 #define SC_OFFSET(sc, field) \
13 *((unsigned long *) &(((char *) (sc))[HOST_##field]))
14 #define SC_CR2(sc) SC_OFFSET(sc, SC_CR2)
15 #define SC_ERR(sc) SC_OFFSET(sc, SC_ERR)
16 #define SC_TRAPNO(sc) SC_OFFSET(sc, SC_TRAPNO)
18 #define IP_RESTART_SYSCALL(ip) ((ip) -= 2)
20 #define GET_FAULTINFO_FROM_SC(fi, sc) \
21 { \
22 (fi).cr2 = SC_CR2(sc); \
23 (fi).error_code = SC_ERR(sc); \
24 (fi).trap_no = SC_TRAPNO(sc); \
27 /* This is Page Fault */
28 #define SEGV_IS_FIXABLE(fi) ((fi)->trap_no == 14)
30 /* No broken SKAS API, which doesn't pass trap_no, here. */
31 #define SEGV_MAYBE_FIXABLE(fi) 0
33 #endif