aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/sysrq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/sysrq.c')
-rw-r--r--drivers/char/sysrq.c53
1 files changed, 26 insertions, 27 deletions
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c
index 878ac0c2cc6..ef31bb81e84 100644
--- a/drivers/char/sysrq.c
+++ b/drivers/char/sysrq.c
@@ -18,7 +18,6 @@
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/fs.h> 20#include <linux/fs.h>
21#include <linux/tty.h>
22#include <linux/mount.h> 21#include <linux/mount.h>
23#include <linux/kdev_t.h> 22#include <linux/kdev_t.h>
24#include <linux/major.h> 23#include <linux/major.h>
@@ -76,7 +75,7 @@ static int __init sysrq_always_enabled_setup(char *str)
76__setup("sysrq_always_enabled", sysrq_always_enabled_setup); 75__setup("sysrq_always_enabled", sysrq_always_enabled_setup);
77 76
78 77
79static void sysrq_handle_loglevel(int key, struct tty_struct *tty) 78static void sysrq_handle_loglevel(int key)
80{ 79{
81 int i; 80 int i;
82 81
@@ -93,7 +92,7 @@ static struct sysrq_key_op sysrq_loglevel_op = {
93}; 92};
94 93
95#ifdef CONFIG_VT 94#ifdef CONFIG_VT
96static void sysrq_handle_SAK(int key, struct tty_struct *tty) 95static void sysrq_handle_SAK(int key)
97{ 96{
98 struct work_struct *SAK_work = &vc_cons[fg_console].SAK_work; 97 struct work_struct *SAK_work = &vc_cons[fg_console].SAK_work;
99 schedule_work(SAK_work); 98 schedule_work(SAK_work);
@@ -109,7 +108,7 @@ static struct sysrq_key_op sysrq_SAK_op = {
109#endif 108#endif
110 109
111#ifdef CONFIG_VT 110#ifdef CONFIG_VT
112static void sysrq_handle_unraw(int key, struct tty_struct *tty) 111static void sysrq_handle_unraw(int key)
113{ 112{
114 struct kbd_struct *kbd = &kbd_table[fg_console]; 113 struct kbd_struct *kbd = &kbd_table[fg_console];
115 114
@@ -126,7 +125,7 @@ static struct sysrq_key_op sysrq_unraw_op = {
126#define sysrq_unraw_op (*(struct sysrq_key_op *)NULL) 125#define sysrq_unraw_op (*(struct sysrq_key_op *)NULL)
127#endif /* CONFIG_VT */ 126#endif /* CONFIG_VT */
128 127
129static void sysrq_handle_crash(int key, struct tty_struct *tty) 128static void sysrq_handle_crash(int key)
130{ 129{
131 char *killer = NULL; 130 char *killer = NULL;
132 131
@@ -141,7 +140,7 @@ static struct sysrq_key_op sysrq_crash_op = {
141 .enable_mask = SYSRQ_ENABLE_DUMP, 140 .enable_mask = SYSRQ_ENABLE_DUMP,
142}; 141};
143 142
144static void sysrq_handle_reboot(int key, struct tty_struct *tty) 143static void sysrq_handle_reboot(int key)
145{ 144{
146 lockdep_off(); 145 lockdep_off();
147 local_irq_enable(); 146 local_irq_enable();
@@ -154,7 +153,7 @@ static struct sysrq_key_op sysrq_reboot_op = {
154 .enable_mask = SYSRQ_ENABLE_BOOT, 153 .enable_mask = SYSRQ_ENABLE_BOOT,
155}; 154};
156 155
157static void sysrq_handle_sync(int key, struct tty_struct *tty) 156static void sysrq_handle_sync(int key)
158{ 157{
159 emergency_sync(); 158 emergency_sync();
160} 159}
@@ -165,7 +164,7 @@ static struct sysrq_key_op sysrq_sync_op = {
165 .enable_mask = SYSRQ_ENABLE_SYNC, 164 .enable_mask = SYSRQ_ENABLE_SYNC,
166}; 165};
167 166
168static void sysrq_handle_show_timers(int key, struct tty_struct *tty) 167static void sysrq_handle_show_timers(int key)
169{ 168{
170 sysrq_timer_list_show(); 169 sysrq_timer_list_show();
171} 170}
@@ -176,7 +175,7 @@ static struct sysrq_key_op sysrq_show_timers_op = {
176 .action_msg = "Show clockevent devices & pending hrtimers (no others)", 175 .action_msg = "Show clockevent devices & pending hrtimers (no others)",
177}; 176};
178 177
179static void sysrq_handle_mountro(int key, struct tty_struct *tty) 178static void sysrq_handle_mountro(int key)
180{ 179{
181 emergency_remount(); 180 emergency_remount();
182} 181}
@@ -188,7 +187,7 @@ static struct sysrq_key_op sysrq_mountro_op = {
188}; 187};
189 188
190#ifdef CONFIG_LOCKDEP 189#ifdef CONFIG_LOCKDEP
191static void sysrq_handle_showlocks(int key, struct tty_struct *tty) 190static void sysrq_handle_showlocks(int key)
192{ 191{
193 debug_show_all_locks(); 192 debug_show_all_locks();
194} 193}
@@ -226,7 +225,7 @@ static void sysrq_showregs_othercpus(struct work_struct *dummy)
226 225
227static DECLARE_WORK(sysrq_showallcpus, sysrq_showregs_othercpus); 226static DECLARE_WORK(sysrq_showallcpus, sysrq_showregs_othercpus);
228 227
229static void sysrq_handle_showallcpus(int key, struct tty_struct *tty) 228static void sysrq_handle_showallcpus(int key)
230{ 229{
231 /* 230 /*
232 * Fall back to the workqueue based printing if the 231 * Fall back to the workqueue based printing if the
@@ -252,7 +251,7 @@ static struct sysrq_key_op sysrq_showallcpus_op = {
252}; 251};
253#endif 252#endif
254 253
255static void sysrq_handle_showregs(int key, struct tty_struct *tty) 254static void sysrq_handle_showregs(int key)
256{ 255{
257 struct pt_regs *regs = get_irq_regs(); 256 struct pt_regs *regs = get_irq_regs();
258 if (regs) 257 if (regs)
@@ -266,7 +265,7 @@ static struct sysrq_key_op sysrq_showregs_op = {
266 .enable_mask = SYSRQ_ENABLE_DUMP, 265 .enable_mask = SYSRQ_ENABLE_DUMP,
267}; 266};
268 267
269static void sysrq_handle_showstate(int key, struct tty_struct *tty) 268static void sysrq_handle_showstate(int key)
270{ 269{
271 show_state(); 270 show_state();
272} 271}
@@ -277,7 +276,7 @@ static struct sysrq_key_op sysrq_showstate_op = {
277 .enable_mask = SYSRQ_ENABLE_DUMP, 276 .enable_mask = SYSRQ_ENABLE_DUMP,
278}; 277};
279 278
280static void sysrq_handle_showstate_blocked(int key, struct tty_struct *tty) 279static void sysrq_handle_showstate_blocked(int key)
281{ 280{
282 show_state_filter(TASK_UNINTERRUPTIBLE); 281 show_state_filter(TASK_UNINTERRUPTIBLE);
283} 282}
@@ -291,7 +290,7 @@ static struct sysrq_key_op sysrq_showstate_blocked_op = {
291#ifdef CONFIG_TRACING 290#ifdef CONFIG_TRACING
292#include <linux/ftrace.h> 291#include <linux/ftrace.h>
293 292
294static void sysrq_ftrace_dump(int key, struct tty_struct *tty) 293static void sysrq_ftrace_dump(int key)
295{ 294{
296 ftrace_dump(DUMP_ALL); 295 ftrace_dump(DUMP_ALL);
297} 296}
@@ -305,7 +304,7 @@ static struct sysrq_key_op sysrq_ftrace_dump_op = {
305#define sysrq_ftrace_dump_op (*(struct sysrq_key_op *)NULL) 304#define sysrq_ftrace_dump_op (*(struct sysrq_key_op *)NULL)
306#endif 305#endif
307 306
308static void sysrq_handle_showmem(int key, struct tty_struct *tty) 307static void sysrq_handle_showmem(int key)
309{ 308{
310 show_mem(); 309 show_mem();
311} 310}
@@ -330,7 +329,7 @@ static void send_sig_all(int sig)
330 } 329 }
331} 330}
332 331
333static void sysrq_handle_term(int key, struct tty_struct *tty) 332static void sysrq_handle_term(int key)
334{ 333{
335 send_sig_all(SIGTERM); 334 send_sig_all(SIGTERM);
336 console_loglevel = 8; 335 console_loglevel = 8;
@@ -349,7 +348,7 @@ static void moom_callback(struct work_struct *ignored)
349 348
350static DECLARE_WORK(moom_work, moom_callback); 349static DECLARE_WORK(moom_work, moom_callback);
351 350
352static void sysrq_handle_moom(int key, struct tty_struct *tty) 351static void sysrq_handle_moom(int key)
353{ 352{
354 schedule_work(&moom_work); 353 schedule_work(&moom_work);
355} 354}
@@ -361,7 +360,7 @@ static struct sysrq_key_op sysrq_moom_op = {
361}; 360};
362 361
363#ifdef CONFIG_BLOCK 362#ifdef CONFIG_BLOCK
364static void sysrq_handle_thaw(int key, struct tty_struct *tty) 363static void sysrq_handle_thaw(int key)
365{ 364{
366 emergency_thaw_all(); 365 emergency_thaw_all();
367} 366}
@@ -373,7 +372,7 @@ static struct sysrq_key_op sysrq_thaw_op = {
373}; 372};
374#endif 373#endif
375 374
376static void sysrq_handle_kill(int key, struct tty_struct *tty) 375static void sysrq_handle_kill(int key)
377{ 376{
378 send_sig_all(SIGKILL); 377 send_sig_all(SIGKILL);
379 console_loglevel = 8; 378 console_loglevel = 8;
@@ -385,7 +384,7 @@ static struct sysrq_key_op sysrq_kill_op = {
385 .enable_mask = SYSRQ_ENABLE_SIGNAL, 384 .enable_mask = SYSRQ_ENABLE_SIGNAL,
386}; 385};
387 386
388static void sysrq_handle_unrt(int key, struct tty_struct *tty) 387static void sysrq_handle_unrt(int key)
389{ 388{
390 normalize_rt_tasks(); 389 normalize_rt_tasks();
391} 390}
@@ -493,7 +492,7 @@ static void __sysrq_put_key_op(int key, struct sysrq_key_op *op_p)
493 sysrq_key_table[i] = op_p; 492 sysrq_key_table[i] = op_p;
494} 493}
495 494
496void __handle_sysrq(int key, struct tty_struct *tty, int check_mask) 495void __handle_sysrq(int key, bool check_mask)
497{ 496{
498 struct sysrq_key_op *op_p; 497 struct sysrq_key_op *op_p;
499 int orig_log_level; 498 int orig_log_level;
@@ -520,7 +519,7 @@ void __handle_sysrq(int key, struct tty_struct *tty, int check_mask)
520 if (!check_mask || sysrq_on_mask(op_p->enable_mask)) { 519 if (!check_mask || sysrq_on_mask(op_p->enable_mask)) {
521 printk("%s\n", op_p->action_msg); 520 printk("%s\n", op_p->action_msg);
522 console_loglevel = orig_log_level; 521 console_loglevel = orig_log_level;
523 op_p->handler(key, tty); 522 op_p->handler(key);
524 } else { 523 } else {
525 printk("This sysrq operation is disabled.\n"); 524 printk("This sysrq operation is disabled.\n");
526 } 525 }
@@ -545,10 +544,10 @@ void __handle_sysrq(int key, struct tty_struct *tty, int check_mask)
545 spin_unlock_irqrestore(&sysrq_key_table_lock, flags); 544 spin_unlock_irqrestore(&sysrq_key_table_lock, flags);
546} 545}
547 546
548void handle_sysrq(int key, struct tty_struct *tty) 547void handle_sysrq(int key)
549{ 548{
550 if (sysrq_on()) 549 if (sysrq_on())
551 __handle_sysrq(key, tty, 1); 550 __handle_sysrq(key, true);
552} 551}
553EXPORT_SYMBOL(handle_sysrq); 552EXPORT_SYMBOL(handle_sysrq);
554 553
@@ -597,7 +596,7 @@ static bool sysrq_filter(struct input_handle *handle, unsigned int type,
597 596
598 default: 597 default:
599 if (sysrq_down && value && value != 2) 598 if (sysrq_down && value && value != 2)
600 __handle_sysrq(sysrq_xlate[code], NULL, 1); 599 __handle_sysrq(sysrq_xlate[code], true);
601 break; 600 break;
602 } 601 }
603 602
@@ -765,7 +764,7 @@ static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf,
765 764
766 if (get_user(c, buf)) 765 if (get_user(c, buf))
767 return -EFAULT; 766 return -EFAULT;
768 __handle_sysrq(c, NULL, 0); 767 __handle_sysrq(c, false);
769 } 768 }
770 769
771 return count; 770 return count;