aboutsummaryrefslogtreecommitdiff
path: root/arch/um/sys-ppc/shared/sysdep/sigcontext.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2008-08-23 17:28:20 -0400
committerH. Peter Anvin <hpa@zytor.com>2008-10-22 22:55:22 -0700
commitaa7bd942498512d6b77d1d0da846a8ecdd5d6186 (patch)
tree9a420b59a1e862ea47a4c5f89601ffbdf3366922 /arch/um/sys-ppc/shared/sysdep/sigcontext.h
parent4198426af37e7122f2fda2538fa9dcaa19c5e397 (diff)
x86, um: get rid of header symlinks
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/um/sys-ppc/shared/sysdep/sigcontext.h')
-rw-r--r--arch/um/sys-ppc/shared/sysdep/sigcontext.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/arch/um/sys-ppc/shared/sysdep/sigcontext.h b/arch/um/sys-ppc/shared/sysdep/sigcontext.h
new file mode 100644
index 00000000000..f20d965de9c
--- /dev/null
+++ b/arch/um/sys-ppc/shared/sysdep/sigcontext.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
+ * Licensed under the GPL
+ */
+
+#ifndef __SYS_SIGCONTEXT_PPC_H
+#define __SYS_SIGCONTEXT_PPC_H
+
+#define DSISR_WRITE 0x02000000
+
+#define SC_FAULT_ADDR(sc) ({ \
+ struct sigcontext *_sc = (sc); \
+ long retval = -1; \
+ switch (_sc->regs->trap) { \
+ case 0x300: \
+ /* data exception */ \
+ retval = _sc->regs->dar; \
+ break; \
+ case 0x400: \
+ /* instruction exception */ \
+ retval = _sc->regs->nip; \
+ break; \
+ default: \
+ panic("SC_FAULT_ADDR: unhandled trap type\n"); \
+ } \
+ retval; \
+ })
+
+#define SC_FAULT_WRITE(sc) ({ \
+ struct sigcontext *_sc = (sc); \
+ long retval = -1; \
+ switch (_sc->regs->trap) { \
+ case 0x300: \
+ /* data exception */ \
+ retval = !!(_sc->regs->dsisr & DSISR_WRITE); \
+ break; \
+ case 0x400: \
+ /* instruction exception: not a write */ \
+ retval = 0; \
+ break; \
+ default: \
+ panic("SC_FAULT_ADDR: unhandled trap type\n"); \
+ } \
+ retval; \
+ })
+
+#define SC_IP(sc) ((sc)->regs->nip)
+#define SC_SP(sc) ((sc)->regs->gpr[1])
+#define SEGV_IS_FIXABLE(sc) (1)
+
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only. This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-file-style: "linux"
+ * End:
+ */