Michael Grundy | 4ba069b | 2006-09-20 15:58:39 +0200 | [diff] [blame] | 1 | #ifndef _S390_KDEBUG_H |
| 2 | #define _S390_KDEBUG_H |
| 3 | |
| 4 | /* |
| 5 | * Feb 2006 Ported to s390 <grundym@us.ibm.com> |
| 6 | */ |
| 7 | #include <linux/notifier.h> |
| 8 | |
| 9 | struct pt_regs; |
| 10 | |
| 11 | struct die_args { |
| 12 | struct pt_regs *regs; |
| 13 | const char *str; |
| 14 | long err; |
| 15 | int trapnr; |
| 16 | int signr; |
| 17 | }; |
| 18 | |
| 19 | /* Note - you should never unregister because that can race with NMIs. |
| 20 | * If you really want to do it first unregister - then synchronize_sched |
| 21 | * - then free. |
| 22 | */ |
| 23 | extern int register_die_notifier(struct notifier_block *); |
| 24 | extern int unregister_die_notifier(struct notifier_block *); |
| 25 | extern int register_page_fault_notifier(struct notifier_block *); |
| 26 | extern int unregister_page_fault_notifier(struct notifier_block *); |
| 27 | extern struct atomic_notifier_head s390die_chain; |
| 28 | |
Michael Grundy | 4ba069b | 2006-09-20 15:58:39 +0200 | [diff] [blame] | 29 | enum die_val { |
| 30 | DIE_OOPS = 1, |
| 31 | DIE_BPT, |
| 32 | DIE_SSTEP, |
| 33 | DIE_PANIC, |
| 34 | DIE_NMI, |
| 35 | DIE_DIE, |
| 36 | DIE_NMIWATCHDOG, |
| 37 | DIE_KERNELDEBUG, |
| 38 | DIE_TRAP, |
| 39 | DIE_GPF, |
| 40 | DIE_CALL, |
| 41 | DIE_NMI_IPI, |
| 42 | DIE_PAGE_FAULT, |
| 43 | }; |
| 44 | |
| 45 | static inline int notify_die(enum die_val val, const char *str, |
| 46 | struct pt_regs *regs, long err, int trap, int sig) |
| 47 | { |
| 48 | struct die_args args = { |
| 49 | .regs = regs, |
| 50 | .str = str, |
| 51 | .err = err, |
| 52 | .trapnr = trap, |
| 53 | .signr = sig |
| 54 | }; |
| 55 | return atomic_notifier_call_chain(&s390die_chain, val, &args); |
| 56 | } |
| 57 | |
Heiko Carstens | 2b67fc4 | 2007-02-05 21:16:47 +0100 | [diff] [blame] | 58 | extern void die(const char *, struct pt_regs *, long); |
| 59 | |
Michael Grundy | 4ba069b | 2006-09-20 15:58:39 +0200 | [diff] [blame] | 60 | #endif |