blob: 532bfee934f43328912e5d88045197feba350da7 [file] [log] [blame]
Stephen Rothwellbbeb3f42005-09-27 13:51:59 +10001#ifndef _ASM_POWERPC_KDEBUG_H
2#define _ASM_POWERPC_KDEBUG_H
Arnd Bergmann88ced032005-12-16 22:43:46 +01003#ifdef __KERNEL__
Paul Mackerras14cf11a2005-09-26 16:04:21 +10004
5/* nearly identical to x86_64/i386 code */
6
7#include <linux/notifier.h>
8
9struct pt_regs;
10
11struct die_args {
12 struct pt_regs *regs;
13 const char *str;
14 long err;
15 int trapnr;
16 int signr;
17};
18
Alan Sterne041c682006-03-27 01:16:30 -080019extern int register_die_notifier(struct notifier_block *);
20extern int unregister_die_notifier(struct notifier_block *);
Anil S Keshavamurthy4f9e87c2006-06-26 00:25:27 -070021extern int register_page_fault_notifier(struct notifier_block *);
22extern int unregister_page_fault_notifier(struct notifier_block *);
Alan Sterne041c682006-03-27 01:16:30 -080023extern struct atomic_notifier_head powerpc_die_chain;
Paul Mackerras14cf11a2005-09-26 16:04:21 +100024
25/* Grossly misnamed. */
26enum die_val {
27 DIE_OOPS = 1,
28 DIE_IABR_MATCH,
29 DIE_DABR_MATCH,
30 DIE_BPT,
31 DIE_SSTEP,
32 DIE_PAGE_FAULT,
33};
34
35static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig)
36{
37 struct die_args args = { .regs=regs, .str=str, .err=err, .trapnr=trap,.signr=sig };
Alan Sterne041c682006-03-27 01:16:30 -080038 return atomic_notifier_call_chain(&powerpc_die_chain, val, &args);
Paul Mackerras14cf11a2005-09-26 16:04:21 +100039}
40
Arnd Bergmann88ced032005-12-16 22:43:46 +010041#endif /* __KERNEL__ */
Stephen Rothwellbbeb3f42005-09-27 13:51:59 +100042#endif /* _ASM_POWERPC_KDEBUG_H */