2 * Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
6 #ifndef __SYS_SIGCONTEXT_PPC_H
7 #define __SYS_SIGCONTEXT_PPC_H
9 #define DSISR_WRITE 0x02000000
11 #define SC_FAULT_ADDR(sc) ({ \
12 struct sigcontext *_sc = (sc); \
14 switch (_sc->regs->trap) { \
16 /* data exception */ \
17 retval = _sc->regs->dar; \
20 /* instruction exception */ \
21 retval = _sc->regs->nip; \
24 panic("SC_FAULT_ADDR: unhandled trap type\n"); \
29 #define SC_FAULT_WRITE(sc) ({ \
30 struct sigcontext *_sc = (sc); \
32 switch (_sc->regs->trap) { \
34 /* data exception */ \
35 retval = !!(_sc->regs->dsisr & DSISR_WRITE); \
38 /* instruction exception: not a write */ \
42 panic("SC_FAULT_ADDR: unhandled trap type\n"); \
47 #define SC_IP(sc) ((sc)->regs->nip)
48 #define SC_SP(sc) ((sc)->regs->gpr[1])
49 #define SEGV_IS_FIXABLE(sc) (1)
54 * Overrides for Emacs so that we follow Linus's tabbing style.
55 * Emacs will notice this stuff at the end of the file and automatically
56 * adjust the settings for this buffer only. This must remain at the end
58 * ---------------------------------------------------------------------------
60 * c-file-style: "linux"