diff options
author | Christoph Hellwig <hch@lst.de> | 2007-05-08 00:27:03 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 11:15:04 -0700 |
commit | 1eeb66a1bb973534dc3d064920a5ca683823372e (patch) | |
tree | 19c22d611e6adefb352dbc107b859e4d13ba38c1 /include | |
parent | e3869792990f708c97be5877499cada70d469bd3 (diff) | |
download | linux-1eeb66a1bb973534dc3d064920a5ca683823372e.tar.bz2 |
move die notifier handling to common code
This patch moves the die notifier handling to common code. Previous
various architectures had exactly the same code for it. Note that the new
code is compiled unconditionally, this should be understood as an appel to
the other architecture maintainer to implement support for it aswell (aka
sprinkling a notify_die or two in the proper place)
arm had a notifiy_die that did something totally different, I renamed it to
arm_notify_die as part of the patch and made it static to the file it's
declared and used at. avr32 used to pass slightly less information through
this interface and I brought it into line with the other architectures.
[akpm@linux-foundation.org: build fix]
[akpm@linux-foundation.org: fix vmalloc_sync_all bustage]
[bryan.wu@analog.com: fix vmalloc_sync_all in nommu]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: <linux-arch@vger.kernel.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
31 files changed, 53 insertions, 173 deletions
diff --git a/include/asm-alpha/kdebug.h b/include/asm-alpha/kdebug.h new file mode 100644 index 000000000000..6ece1b037665 --- /dev/null +++ b/include/asm-alpha/kdebug.h @@ -0,0 +1 @@ +#include <asm-generic/kdebug.h> diff --git a/include/asm-arm/kdebug.h b/include/asm-arm/kdebug.h new file mode 100644 index 000000000000..6ece1b037665 --- /dev/null +++ b/include/asm-arm/kdebug.h @@ -0,0 +1 @@ +#include <asm-generic/kdebug.h> diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h index 63b3080bdac4..25f84da4a97e 100644 --- a/include/asm-arm/system.h +++ b/include/asm-arm/system.h @@ -93,7 +93,7 @@ void die(const char *msg, struct pt_regs *regs, int err) __attribute__((noreturn)); struct siginfo; -void notify_die(const char *str, struct pt_regs *regs, struct siginfo *info, +void arm_notify_die(const char *str, struct pt_regs *regs, struct siginfo *info, unsigned long err, unsigned long trap); void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, diff --git a/include/asm-arm26/kdebug.h b/include/asm-arm26/kdebug.h new file mode 100644 index 000000000000..6ece1b037665 --- /dev/null +++ b/include/asm-arm26/kdebug.h @@ -0,0 +1 @@ +#include <asm-generic/kdebug.h> diff --git a/include/asm-avr32/kdebug.h b/include/asm-avr32/kdebug.h index f583b643ffb2..de419278fc39 100644 --- a/include/asm-avr32/kdebug.h +++ b/include/asm-avr32/kdebug.h @@ -3,19 +3,6 @@ #include <linux/notifier.h> -struct pt_regs; - -struct die_args { - struct pt_regs *regs; - int trapnr; -}; - -int register_die_notifier(struct notifier_block *nb); -int unregister_die_notifier(struct notifier_block *nb); -int register_page_fault_notifier(struct notifier_block *nb); -int unregister_page_fault_notifier(struct notifier_block *nb); -extern struct atomic_notifier_head avr32_die_chain; - /* Grossly misnamed. */ enum die_val { DIE_FAULT, @@ -24,15 +11,7 @@ enum die_val { DIE_PAGE_FAULT, }; -static inline int notify_die(enum die_val val, struct pt_regs *regs, - int trap, int sig) -{ - struct die_args args = { - .regs = regs, - .trapnr = trap, - }; - - return atomic_notifier_call_chain(&avr32_die_chain, val, &args); -} +int register_page_fault_notifier(struct notifier_block *nb); +int unregister_page_fault_notifier(struct notifier_block *nb); #endif /* __ASM_AVR32_KDEBUG_H */ diff --git a/include/asm-cris/kdebug.h b/include/asm-cris/kdebug.h new file mode 100644 index 000000000000..6ece1b037665 --- /dev/null +++ b/include/asm-cris/kdebug.h @@ -0,0 +1 @@ +#include <asm-generic/kdebug.h> diff --git a/include/asm-frv/kdebug.h b/include/asm-frv/kdebug.h new file mode 100644 index 000000000000..6ece1b037665 --- /dev/null +++ b/include/asm-frv/kdebug.h @@ -0,0 +1 @@ +#include <asm-generic/kdebug.h> diff --git a/include/asm-generic/kdebug.h b/include/asm-generic/kdebug.h new file mode 100644 index 000000000000..2b799c90b2d4 --- /dev/null +++ b/include/asm-generic/kdebug.h @@ -0,0 +1,8 @@ +#ifndef _ASM_GENERIC_KDEBUG_H +#define _ASM_GENERIC_KDEBUG_H + +enum die_val { + DIE_UNUSED, +}; + +#endif /* _ASM_GENERIC_KDEBUG_H */ diff --git a/include/asm-h8300/kdebug.h b/include/asm-h8300/kdebug.h new file mode 100644 index 000000000000..6ece1b037665 --- /dev/null +++ b/include/asm-h8300/kdebug.h @@ -0,0 +1 @@ +#include <asm-generic/kdebug.h> diff --git a/include/asm-i386/kdebug.h b/include/asm-i386/kdebug.h index 6e1c8e1b5e2b..05c3117788b9 100644 --- a/include/asm-i386/kdebug.h +++ b/include/asm-i386/kdebug.h @@ -9,19 +9,8 @@ struct pt_regs; -struct die_args { - struct pt_regs *regs; - const char *str; - long err; - int trapnr; - int signr; -}; - -extern int register_die_notifier(struct notifier_block *); -extern int unregister_die_notifier(struct notifier_block *); extern int register_page_fault_notifier(struct notifier_block *); extern int unregister_page_fault_notifier(struct notifier_block *); -extern struct atomic_notifier_head i386die_chain; /* Grossly misnamed. */ @@ -42,17 +31,4 @@ enum die_val { DIE_PAGE_FAULT, }; -static inline int notify_die(enum die_val val, const char *str, - struct pt_regs *regs, long err, int trap, int sig) -{ - struct die_args args = { - .regs = regs, - .str = str, - .err = err, - .trapnr = trap, - .signr = sig - }; - return atomic_notifier_call_chain(&i386die_chain, val, &args); -} - #endif diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index e16359f81a40..61fbf8578ff1 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h @@ -243,8 +243,6 @@ static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte_low |= _PAGE_ACCESSED; re static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte_low |= _PAGE_RW; return pte; } static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= _PAGE_PSE; return pte; } -extern void vmalloc_sync_all(void); - #ifdef CONFIG_X86_PAE # include <asm/pgtable-3level.h> #else diff --git a/include/asm-ia64/kdebug.h b/include/asm-ia64/kdebug.h index aed7142f9e4a..ba211e011a1d 100644 --- a/include/asm-ia64/kdebug.h +++ b/include/asm-ia64/kdebug.h @@ -28,21 +28,8 @@ */ #include <linux/notifier.h> -struct pt_regs; - -struct die_args { - struct pt_regs *regs; - const char *str; - long err; - int trapnr; - int signr; -}; - -extern int register_die_notifier(struct notifier_block *); -extern int unregister_die_notifier(struct notifier_block *); extern int register_page_fault_notifier(struct notifier_block *); extern int unregister_page_fault_notifier(struct notifier_block *); -extern struct atomic_notifier_head ia64die_chain; enum die_val { DIE_BREAK = 1, @@ -74,18 +61,4 @@ enum die_val { DIE_KDUMP_LEAVE, }; -static inline int notify_die(enum die_val val, char *str, struct pt_regs *regs, - long err, int trap, int sig) -{ - struct die_args args = { - .regs = regs, - .str = str, - .err = err, - .trapnr = trap, - .signr = sig - }; - - return atomic_notifier_call_chain(&ia64die_chain, val, &args); -} - #endif diff --git a/include/asm-m32r/kdebug.h b/include/asm-m32r/kdebug.h new file mode 100644 index 000000000000..6ece1b037665 --- /dev/null +++ b/include/asm-m32r/kdebug.h @@ -0,0 +1 @@ +#include <asm-generic/kdebug.h> diff --git a/include/asm-m68k/kdebug.h b/include/asm-m68k/kdebug.h new file mode 100644 index 000000000000..6ece1b037665 --- /dev/null +++ b/include/asm-m68k/kdebug.h @@ -0,0 +1 @@ +#include <asm-generic/kdebug.h> diff --git a/include/asm-m68knommu/kdebug.h b/include/asm-m68knommu/kdebug.h new file mode 100644 index 000000000000..6ece1b037665 --- /dev/null +++ b/include/asm-m68knommu/kdebug.h @@ -0,0 +1 @@ +#include <asm-generic/kdebug.h> diff --git a/include/asm-mips/kdebug.h b/include/asm-mips/kdebug.h new file mode 100644 index 000000000000..6ece1b037665 --- /dev/null +++ b/include/asm-mips/kdebug.h @@ -0,0 +1 @@ +#include <asm-generic/kdebug.h> diff --git a/include/asm-parisc/kdebug.h b/include/asm-parisc/kdebug.h new file mode 100644 index 000000000000..6ece1b037665 --- /dev/null +++ b/include/asm-parisc/kdebug.h @@ -0,0 +1 @@ +#include <asm-generic/kdebug.h> diff --git a/include/asm-powerpc/kdebug.h b/include/asm-powerpc/kdebug.h index 532bfee934f4..1c73d2ec9b59 100644 --- a/include/asm-powerpc/kdebug.h +++ b/include/asm-powerpc/kdebug.h @@ -6,18 +6,6 @@ #include <linux/notifier.h> -struct pt_regs; - -struct die_args { - struct pt_regs *regs; - const char *str; - long err; - int trapnr; - int signr; -}; - -extern int register_die_notifier(struct notifier_block *); -extern int unregister_die_notifier(struct notifier_block *); extern int register_page_fault_notifier(struct notifier_block *); extern int unregister_page_fault_notifier(struct notifier_block *); extern struct atomic_notifier_head powerpc_die_chain; @@ -32,11 +20,5 @@ enum die_val { DIE_PAGE_FAULT, }; -static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig) -{ - struct die_args args = { .regs=regs, .str=str, .err=err, .trapnr=trap,.signr=sig }; - return atomic_notifier_call_chain(&powerpc_die_chain, val, &args); -} - #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_KDEBUG_H */ diff --git a/include/asm-ppc/kdebug.h b/include/asm-ppc/kdebug.h new file mode 100644 index 000000000000..6ece1b037665 --- /dev/null +++ b/include/asm-ppc/kdebug.h @@ -0,0 +1 @@ +#include <asm-generic/kdebug.h> diff --git a/include/asm-s390/kdebug.h b/include/asm-s390/kdebug.h index d2d7ad276148..04418af08f85 100644 --- a/include/asm-s390/kdebug.h +++ b/include/asm-s390/kdebug.h @@ -8,21 +8,6 @@ struct pt_regs; -struct die_args { - struct pt_regs *regs; - const char *str; - long err; - int trapnr; - int signr; -}; - -/* Note - you should never unregister because that can race with NMIs. - * If you really want to do it first unregister - then synchronize_sched - * - then free. - */ -extern int register_die_notifier(struct notifier_block *); -extern int unregister_die_notifier(struct notifier_block *); - /* * These are only here because kprobes.c wants them to implement a * blatant layering violation. Will hopefully go away soon once all @@ -37,8 +22,6 @@ static inline int unregister_page_fault_notifier(struct notifier_block *nb) return 0; } -extern struct atomic_notifier_head s390die_chain; - enum die_val { DIE_OOPS = 1, DIE_BPT, @@ -54,19 +37,6 @@ enum die_val { DIE_NMI_IPI, }; -static inline int notify_die(enum die_val val, const char *str, - struct pt_regs *regs, long err, int trap, int sig) -{ - struct die_args args = { - .regs = regs, - .str = str, - .err = err, - .trapnr = trap, - .signr = sig - }; - return atomic_notifier_call_chain(&s390die_chain, val, &args); -} - extern void die(const char *, struct pt_regs *, long); #endif diff --git a/include/asm-sh/kdebug.h b/include/asm-sh/kdebug.h index ef009baf5a11..493c20629747 100644 --- a/include/asm-sh/kdebug.h +++ b/include/asm-sh/kdebug.h @@ -2,6 +2,7 @@ #define __ASM_SH_KDEBUG_H #include <linux/notifier.h> +#include <asm-generic/kdebug.h> struct pt_regs; diff --git a/include/asm-sh64/kdebug.h b/include/asm-sh64/kdebug.h new file mode 100644 index 000000000000..6ece1b037665 --- /dev/null +++ b/include/asm-sh64/kdebug.h @@ -0,0 +1 @@ +#include <asm-generic/kdebug.h> diff --git a/include/asm-sparc/kdebug.h b/include/asm-sparc/kdebug.h index fba92485fdba..404d80767323 100644 --- a/include/asm-sparc/kdebug.h +++ b/include/asm-sparc/kdebug.h @@ -66,4 +66,8 @@ static inline void sp_enter_debugger(void) #define KDEBUG_DUNNO2_OFF 0x8 #define KDEBUG_TEACH_OFF 0xc +enum die_val { + DIE_UNUSED, +}; + #endif /* !(_SPARC_KDEBUG_H) */ diff --git a/include/asm-sparc64/kdebug.h b/include/asm-sparc64/kdebug.h index 11251bdd00cb..f8032e73f384 100644 --- a/include/asm-sparc64/kdebug.h +++ b/include/asm-sparc64/kdebug.h @@ -7,19 +7,8 @@ struct pt_regs; -struct die_args { - struct pt_regs *regs; - const char *str; - long err; - int trapnr; - int signr; -}; - -extern int register_die_notifier(struct notifier_block *); -extern int unregister_die_notifier(struct notifier_block *); extern int register_page_fault_notifier(struct notifier_block *); extern int unregister_page_fault_notifier(struct notifier_block *); -extern struct atomic_notifier_head sparc64die_chain; extern void bad_trap(struct pt_regs *, long); @@ -36,16 +25,4 @@ enum die_val { DIE_PAGE_FAULT, }; -static inline int notify_die(enum die_val val,char *str, struct pt_regs *regs, - long err, int trap, int sig) -{ - struct die_args args = { .regs = regs, - .str = str, - .err = err, - .trapnr = trap, - .signr = sig }; - - return atomic_notifier_call_chain(&sparc64die_chain, val, &args); -} - #endif diff --git a/include/asm-um/kdebug.h b/include/asm-um/kdebug.h new file mode 100644 index 000000000000..6ece1b037665 --- /dev/null +++ b/include/asm-um/kdebug.h @@ -0,0 +1 @@ +#include <asm-generic/kdebug.h> diff --git a/include/asm-v850/kdebug.h b/include/asm-v850/kdebug.h new file mode 100644 index 000000000000..6ece1b037665 --- /dev/null +++ b/include/asm-v850/kdebug.h @@ -0,0 +1 @@ +#include <asm-generic/kdebug.h> diff --git a/include/asm-x86_64/kdebug.h b/include/asm-x86_64/kdebug.h index e9ce163b1550..74feae945a26 100644 --- a/include/asm-x86_64/kdebug.h +++ b/include/asm-x86_64/kdebug.h @@ -5,19 +5,8 @@ struct pt_regs; -struct die_args { - struct pt_regs *regs; - const char *str; - long err; - int trapnr; - int signr; -}; - -extern int register_die_notifier(struct notifier_block *); -extern int unregister_die_notifier(struct notifier_block *); extern int register_page_fault_notifier(struct notifier_block *); extern int unregister_page_fault_notifier(struct notifier_block *); -extern struct atomic_notifier_head die_chain; /* Grossly misnamed. */ enum die_val { @@ -37,19 +26,6 @@ enum die_val { DIE_PAGE_FAULT, }; -static inline int notify_die(enum die_val val, const char *str, - struct pt_regs *regs, long err, int trap, int sig) -{ - struct die_args args = { - .regs = regs, - .str = str, - .err = err, - .trapnr = trap, - .signr = sig - }; - return atomic_notifier_call_chain(&die_chain, val, &args); -} - extern void printk_address(unsigned long address); extern void die(const char *,struct pt_regs *,long); extern void __die(const char *,struct pt_regs *,long); diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index da3390faaea6..5f75ee5379a7 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h @@ -411,7 +411,6 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) extern spinlock_t pgd_lock; extern struct list_head pgd_list; -void vmalloc_sync_all(void); extern int kern_addr_valid(unsigned long addr); diff --git a/include/asm-xtensa/kdebug.h b/include/asm-xtensa/kdebug.h new file mode 100644 index 000000000000..6ece1b037665 --- /dev/null +++ b/include/asm-xtensa/kdebug.h @@ -0,0 +1 @@ +#include <asm-generic/kdebug.h> diff --git a/include/linux/kdebug.h b/include/linux/kdebug.h new file mode 100644 index 000000000000..5db38d6d8b92 --- /dev/null +++ b/include/linux/kdebug.h @@ -0,0 +1,20 @@ +#ifndef _LINUX_KDEBUG_H +#define _LINUX_KDEBUG_H + +#include <asm/kdebug.h> + +struct die_args { + struct pt_regs *regs; + const char *str; + long err; + int trapnr; + int signr; +}; + +int register_die_notifier(struct notifier_block *nb); +int unregister_die_notifier(struct notifier_block *nb); + +int notify_die(enum die_val val, const char *str, + struct pt_regs *regs, long err, int trap, int sig); + +#endif /* _LINUX_KDEBUG_H */ diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 924e502905d4..4b7ee83787c1 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -53,6 +53,7 @@ extern void vunmap(void *addr); extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr, unsigned long pgoff); +void vmalloc_sync_all(void); /* * Lowlevel-APIs (not for driver use!) |