diff options
Diffstat (limited to 'arch/s390/kernel/setup.c')
| -rw-r--r-- | arch/s390/kernel/setup.c | 56 |
1 files changed, 52 insertions, 4 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index b282034452a4..1ca34f54ea8a 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
| @@ -28,7 +28,6 @@ | |||
| 28 | #include <linux/tty.h> | 28 | #include <linux/tty.h> |
| 29 | #include <linux/ioport.h> | 29 | #include <linux/ioport.h> |
| 30 | #include <linux/delay.h> | 30 | #include <linux/delay.h> |
| 31 | #include <linux/config.h> | ||
| 32 | #include <linux/init.h> | 31 | #include <linux/init.h> |
| 33 | #include <linux/initrd.h> | 32 | #include <linux/initrd.h> |
| 34 | #include <linux/bootmem.h> | 33 | #include <linux/bootmem.h> |
| @@ -37,6 +36,7 @@ | |||
| 37 | #include <linux/seq_file.h> | 36 | #include <linux/seq_file.h> |
| 38 | #include <linux/kernel_stat.h> | 37 | #include <linux/kernel_stat.h> |
| 39 | #include <linux/device.h> | 38 | #include <linux/device.h> |
| 39 | #include <linux/notifier.h> | ||
| 40 | 40 | ||
| 41 | #include <asm/uaccess.h> | 41 | #include <asm/uaccess.h> |
| 42 | #include <asm/system.h> | 42 | #include <asm/system.h> |
| @@ -115,6 +115,7 @@ void __devinit cpu_init (void) | |||
| 115 | */ | 115 | */ |
| 116 | char vmhalt_cmd[128] = ""; | 116 | char vmhalt_cmd[128] = ""; |
| 117 | char vmpoff_cmd[128] = ""; | 117 | char vmpoff_cmd[128] = ""; |
| 118 | char vmpanic_cmd[128] = ""; | ||
| 118 | 119 | ||
| 119 | static inline void strncpy_skip_quote(char *dst, char *src, int n) | 120 | static inline void strncpy_skip_quote(char *dst, char *src, int n) |
| 120 | { | 121 | { |
| @@ -146,6 +147,38 @@ static int __init vmpoff_setup(char *str) | |||
| 146 | 147 | ||
| 147 | __setup("vmpoff=", vmpoff_setup); | 148 | __setup("vmpoff=", vmpoff_setup); |
| 148 | 149 | ||
| 150 | static int vmpanic_notify(struct notifier_block *self, unsigned long event, | ||
| 151 | void *data) | ||
| 152 | { | ||
| 153 | if (MACHINE_IS_VM && strlen(vmpanic_cmd) > 0) | ||
| 154 | cpcmd(vmpanic_cmd, NULL, 0, NULL); | ||
| 155 | |||
| 156 | return NOTIFY_OK; | ||
| 157 | } | ||
| 158 | |||
| 159 | #define PANIC_PRI_VMPANIC 0 | ||
| 160 | |||
| 161 | static struct notifier_block vmpanic_nb = { | ||
| 162 | .notifier_call = vmpanic_notify, | ||
| 163 | .priority = PANIC_PRI_VMPANIC | ||
| 164 | }; | ||
| 165 | |||
| 166 | static int __init vmpanic_setup(char *str) | ||
| 167 | { | ||
| 168 | static int register_done __initdata = 0; | ||
| 169 | |||
| 170 | strncpy_skip_quote(vmpanic_cmd, str, 127); | ||
| 171 | vmpanic_cmd[127] = 0; | ||
| 172 | if (!register_done) { | ||
| 173 | register_done = 1; | ||
| 174 | atomic_notifier_chain_register(&panic_notifier_list, | ||
| 175 | &vmpanic_nb); | ||
| 176 | } | ||
| 177 | return 1; | ||
| 178 | } | ||
| 179 | |||
| 180 | __setup("vmpanic=", vmpanic_setup); | ||
| 181 | |||
| 149 | /* | 182 | /* |
| 150 | * condev= and conmode= setup parameter. | 183 | * condev= and conmode= setup parameter. |
| 151 | */ | 184 | */ |
| @@ -289,19 +322,34 @@ void (*_machine_power_off)(void) = do_machine_power_off_nonsmp; | |||
| 289 | 322 | ||
| 290 | void machine_restart(char *command) | 323 | void machine_restart(char *command) |
| 291 | { | 324 | { |
| 292 | console_unblank(); | 325 | if (!in_interrupt() || oops_in_progress) |
| 326 | /* | ||
| 327 | * Only unblank the console if we are called in enabled | ||
| 328 | * context or a bust_spinlocks cleared the way for us. | ||
| 329 | */ | ||
| 330 | console_unblank(); | ||
| 293 | _machine_restart(command); | 331 | _machine_restart(command); |
| 294 | } | 332 | } |
| 295 | 333 | ||
| 296 | void machine_halt(void) | 334 | void machine_halt(void) |
| 297 | { | 335 | { |
| 298 | console_unblank(); | 336 | if (!in_interrupt() || oops_in_progress) |
| 337 | /* | ||
| 338 | * Only unblank the console if we are called in enabled | ||
| 339 | * context or a bust_spinlocks cleared the way for us. | ||
| 340 | */ | ||
| 341 | console_unblank(); | ||
| 299 | _machine_halt(); | 342 | _machine_halt(); |
| 300 | } | 343 | } |
| 301 | 344 | ||
| 302 | void machine_power_off(void) | 345 | void machine_power_off(void) |
| 303 | { | 346 | { |
| 304 | console_unblank(); | 347 | if (!in_interrupt() || oops_in_progress) |
| 348 | /* | ||
| 349 | * Only unblank the console if we are called in enabled | ||
| 350 | * context or a bust_spinlocks cleared the way for us. | ||
| 351 | */ | ||
| 352 | console_unblank(); | ||
| 305 | _machine_power_off(); | 353 | _machine_power_off(); |
| 306 | } | 354 | } |
| 307 | 355 | ||
