diff options
Diffstat (limited to 'arch/s390/kernel/setup.c')
| -rw-r--r-- | arch/s390/kernel/setup.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 813444aac7d7..2b2551e3510b 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | #include <linux/seq_file.h> | 37 | #include <linux/seq_file.h> |
| 38 | #include <linux/kernel_stat.h> | 38 | #include <linux/kernel_stat.h> |
| 39 | #include <linux/device.h> | 39 | #include <linux/device.h> |
| 40 | #include <linux/notifier.h> | ||
| 40 | 41 | ||
| 41 | #include <asm/uaccess.h> | 42 | #include <asm/uaccess.h> |
| 42 | #include <asm/system.h> | 43 | #include <asm/system.h> |
| @@ -115,6 +116,7 @@ void __devinit cpu_init (void) | |||
| 115 | */ | 116 | */ |
| 116 | char vmhalt_cmd[128] = ""; | 117 | char vmhalt_cmd[128] = ""; |
| 117 | char vmpoff_cmd[128] = ""; | 118 | char vmpoff_cmd[128] = ""; |
| 119 | char vmpanic_cmd[128] = ""; | ||
| 118 | 120 | ||
| 119 | static inline void strncpy_skip_quote(char *dst, char *src, int n) | 121 | static inline void strncpy_skip_quote(char *dst, char *src, int n) |
| 120 | { | 122 | { |
| @@ -146,6 +148,38 @@ static int __init vmpoff_setup(char *str) | |||
| 146 | 148 | ||
| 147 | __setup("vmpoff=", vmpoff_setup); | 149 | __setup("vmpoff=", vmpoff_setup); |
| 148 | 150 | ||
| 151 | static int vmpanic_notify(struct notifier_block *self, unsigned long event, | ||
| 152 | void *data) | ||
| 153 | { | ||
| 154 | if (MACHINE_IS_VM && strlen(vmpanic_cmd) > 0) | ||
| 155 | cpcmd(vmpanic_cmd, NULL, 0, NULL); | ||
| 156 | |||
| 157 | return NOTIFY_OK; | ||
| 158 | } | ||
| 159 | |||
| 160 | #define PANIC_PRI_VMPANIC 0 | ||
| 161 | |||
| 162 | static struct notifier_block vmpanic_nb = { | ||
| 163 | .notifier_call = vmpanic_notify, | ||
| 164 | .priority = PANIC_PRI_VMPANIC | ||
| 165 | }; | ||
| 166 | |||
| 167 | static int __init vmpanic_setup(char *str) | ||
| 168 | { | ||
| 169 | static int register_done __initdata = 0; | ||
| 170 | |||
| 171 | strncpy_skip_quote(vmpanic_cmd, str, 127); | ||
| 172 | vmpanic_cmd[127] = 0; | ||
| 173 | if (!register_done) { | ||
| 174 | register_done = 1; | ||
| 175 | atomic_notifier_chain_register(&panic_notifier_list, | ||
| 176 | &vmpanic_nb); | ||
| 177 | } | ||
| 178 | return 1; | ||
| 179 | } | ||
| 180 | |||
| 181 | __setup("vmpanic=", vmpanic_setup); | ||
| 182 | |||
| 149 | /* | 183 | /* |
| 150 | * condev= and conmode= setup parameter. | 184 | * condev= and conmode= setup parameter. |
| 151 | */ | 185 | */ |
