1da177e4c3
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
62 lines
1.4 KiB
C
62 lines
1.4 KiB
C
/*
|
|
* 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:
|
|
*/
|