diff options
Diffstat (limited to 'arch/powerpc/kernel/traps.c')
-rw-r--r-- | arch/powerpc/kernel/traps.c | 51 |
1 files changed, 11 insertions, 40 deletions
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 98660aedeeb7..4cbde211eb69 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
@@ -74,19 +74,19 @@ EXPORT_SYMBOL(__debugger_dabr_match); | |||
74 | EXPORT_SYMBOL(__debugger_fault_handler); | 74 | EXPORT_SYMBOL(__debugger_fault_handler); |
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | struct notifier_block *powerpc_die_chain; | 77 | ATOMIC_NOTIFIER_HEAD(powerpc_die_chain); |
78 | static DEFINE_SPINLOCK(die_notifier_lock); | ||
79 | 78 | ||
80 | int register_die_notifier(struct notifier_block *nb) | 79 | int register_die_notifier(struct notifier_block *nb) |
81 | { | 80 | { |
82 | int err = 0; | 81 | return atomic_notifier_chain_register(&powerpc_die_chain, nb); |
83 | unsigned long flags; | 82 | } |
83 | EXPORT_SYMBOL(register_die_notifier); | ||
84 | 84 | ||
85 | spin_lock_irqsave(&die_notifier_lock, flags); | 85 | int unregister_die_notifier(struct notifier_block *nb) |
86 | err = notifier_chain_register(&powerpc_die_chain, nb); | 86 | { |
87 | spin_unlock_irqrestore(&die_notifier_lock, flags); | 87 | return atomic_notifier_chain_unregister(&powerpc_die_chain, nb); |
88 | return err; | ||
89 | } | 88 | } |
89 | EXPORT_SYMBOL(unregister_die_notifier); | ||
90 | 90 | ||
91 | /* | 91 | /* |
92 | * Trap & Exception support | 92 | * Trap & Exception support |
@@ -97,7 +97,6 @@ static DEFINE_SPINLOCK(die_lock); | |||
97 | int die(const char *str, struct pt_regs *regs, long err) | 97 | int die(const char *str, struct pt_regs *regs, long err) |
98 | { | 98 | { |
99 | static int die_counter, crash_dump_start = 0; | 99 | static int die_counter, crash_dump_start = 0; |
100 | int nl = 0; | ||
101 | 100 | ||
102 | if (debugger(regs)) | 101 | if (debugger(regs)) |
103 | return 1; | 102 | return 1; |
@@ -106,7 +105,7 @@ int die(const char *str, struct pt_regs *regs, long err) | |||
106 | spin_lock_irq(&die_lock); | 105 | spin_lock_irq(&die_lock); |
107 | bust_spinlocks(1); | 106 | bust_spinlocks(1); |
108 | #ifdef CONFIG_PMAC_BACKLIGHT | 107 | #ifdef CONFIG_PMAC_BACKLIGHT |
109 | if (_machine == _MACH_Pmac) { | 108 | if (machine_is(powermac)) { |
110 | set_backlight_enable(1); | 109 | set_backlight_enable(1); |
111 | set_backlight_level(BACKLIGHT_MAX); | 110 | set_backlight_level(BACKLIGHT_MAX); |
112 | } | 111 | } |
@@ -114,46 +113,18 @@ int die(const char *str, struct pt_regs *regs, long err) | |||
114 | printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); | 113 | printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); |
115 | #ifdef CONFIG_PREEMPT | 114 | #ifdef CONFIG_PREEMPT |
116 | printk("PREEMPT "); | 115 | printk("PREEMPT "); |
117 | nl = 1; | ||
118 | #endif | 116 | #endif |
119 | #ifdef CONFIG_SMP | 117 | #ifdef CONFIG_SMP |
120 | printk("SMP NR_CPUS=%d ", NR_CPUS); | 118 | printk("SMP NR_CPUS=%d ", NR_CPUS); |
121 | nl = 1; | ||
122 | #endif | 119 | #endif |
123 | #ifdef CONFIG_DEBUG_PAGEALLOC | 120 | #ifdef CONFIG_DEBUG_PAGEALLOC |
124 | printk("DEBUG_PAGEALLOC "); | 121 | printk("DEBUG_PAGEALLOC "); |
125 | nl = 1; | ||
126 | #endif | 122 | #endif |
127 | #ifdef CONFIG_NUMA | 123 | #ifdef CONFIG_NUMA |
128 | printk("NUMA "); | 124 | printk("NUMA "); |
129 | nl = 1; | ||
130 | #endif | 125 | #endif |
131 | #ifdef CONFIG_PPC64 | 126 | printk("%s\n", ppc_md.name ? "" : ppc_md.name); |
132 | switch (_machine) { | 127 | |
133 | case PLATFORM_PSERIES: | ||
134 | printk("PSERIES "); | ||
135 | nl = 1; | ||
136 | break; | ||
137 | case PLATFORM_PSERIES_LPAR: | ||
138 | printk("PSERIES LPAR "); | ||
139 | nl = 1; | ||
140 | break; | ||
141 | case PLATFORM_ISERIES_LPAR: | ||
142 | printk("ISERIES LPAR "); | ||
143 | nl = 1; | ||
144 | break; | ||
145 | case PLATFORM_POWERMAC: | ||
146 | printk("POWERMAC "); | ||
147 | nl = 1; | ||
148 | break; | ||
149 | case PLATFORM_CELL: | ||
150 | printk("CELL "); | ||
151 | nl = 1; | ||
152 | break; | ||
153 | } | ||
154 | #endif | ||
155 | if (nl) | ||
156 | printk("\n"); | ||
157 | print_modules(); | 128 | print_modules(); |
158 | show_regs(regs); | 129 | show_regs(regs); |
159 | bust_spinlocks(0); | 130 | bust_spinlocks(0); |