Commit 6e0cbcec authored by James Simmons's avatar James Simmons

Removed passing around struct kbd_struct for sysrq. Only two calls use it.

parent 2ffe5f2f
...@@ -923,7 +923,7 @@ static void apm_power_off(void) ...@@ -923,7 +923,7 @@ static void apm_power_off(void)
*/ */
static void handle_poweroff (int key, struct pt_regs *pt_regs, static void handle_poweroff (int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) struct tty_struct *tty)
{ {
apm_power_off(); apm_power_off();
} }
......
...@@ -98,7 +98,7 @@ static unsigned long chrp_find_phys_io_base(void) ...@@ -98,7 +98,7 @@ static unsigned long chrp_find_phys_io_base(void)
#ifdef CONFIG_MAGIC_SYSRQ #ifdef CONFIG_MAGIC_SYSRQ
static void sysrq_handle_xmon(int key, struct pt_regs *regs, static void sysrq_handle_xmon(int key, struct pt_regs *regs,
struct kbd_struct *kbd, struct tty_struct *tty) struct tty_struct *tty)
{ {
xmon(regs); xmon(regs);
} }
......
...@@ -52,7 +52,7 @@ void buf_access(void) ...@@ -52,7 +52,7 @@ void buf_access(void)
} }
#endif #endif
static void sysrq_handle_xmon(int key, struct pt_regs *pt_regs, struct kbd_struct *kbd, struct tty_struct *tty) static void sysrq_handle_xmon(int key, struct pt_regs *pt_regs, struct tty_struct *tty)
{ {
xmon(pt_regs); xmon(pt_regs);
} }
......
...@@ -1174,7 +1174,7 @@ acpi_system_remove_fs ( ...@@ -1174,7 +1174,7 @@ acpi_system_remove_fs (
/* Simple wrapper calling power down function. */ /* Simple wrapper calling power down function. */
static void acpi_sysrq_power_off(int key, struct pt_regs *pt_regs, static void acpi_sysrq_power_off(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) struct tty_struct *tty)
{ {
acpi_power_off(); acpi_power_off();
} }
......
...@@ -245,7 +245,7 @@ void handle_scancode(unsigned char scancode, int down) ...@@ -245,7 +245,7 @@ void handle_scancode(unsigned char scancode, int down)
goto out; goto out;
} else if (sysrq_pressed) { } else if (sysrq_pressed) {
if (!up_flag) { if (!up_flag) {
handle_sysrq(kbd_sysrq_xlate[keycode], kbd_pt_regs, kbd, tty); handle_sysrq(kbd_sysrq_xlate[keycode], kbd_pt_regs, tty);
goto out; goto out;
} }
} }
......
...@@ -45,7 +45,8 @@ void (*sysrq_power_off)(void); ...@@ -45,7 +45,8 @@ void (*sysrq_power_off)(void);
/* Loglevel sysrq handler */ /* Loglevel sysrq handler */
static void sysrq_handle_loglevel(int key, struct pt_regs *pt_regs, static void sysrq_handle_loglevel(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) { struct tty_struct *tty)
{
int i; int i;
i = key - '0'; i = key - '0';
console_loglevel = 7; console_loglevel = 7;
...@@ -62,7 +63,8 @@ static struct sysrq_key_op sysrq_loglevel_op = { ...@@ -62,7 +63,8 @@ static struct sysrq_key_op sysrq_loglevel_op = {
/* SAK sysrq handler */ /* SAK sysrq handler */
#ifdef CONFIG_VT #ifdef CONFIG_VT
static void sysrq_handle_SAK(int key, struct pt_regs *pt_regs, static void sysrq_handle_SAK(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) { struct tty_struct *tty)
{
if (tty) if (tty)
do_SAK(tty); do_SAK(tty);
reset_vc(fg_console); reset_vc(fg_console);
...@@ -77,7 +79,10 @@ static struct sysrq_key_op sysrq_SAK_op = { ...@@ -77,7 +79,10 @@ static struct sysrq_key_op sysrq_SAK_op = {
/* unraw sysrq handler */ /* unraw sysrq handler */
static void sysrq_handle_unraw(int key, struct pt_regs *pt_regs, static void sysrq_handle_unraw(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) { struct tty_struct *tty)
{
struct kbd_struct *kbd = &kbd_table[fg_console];
if (kbd) if (kbd)
kbd->kbdmode = VC_XLATE; kbd->kbdmode = VC_XLATE;
} }
...@@ -90,7 +95,8 @@ static struct sysrq_key_op sysrq_unraw_op = { ...@@ -90,7 +95,8 @@ static struct sysrq_key_op sysrq_unraw_op = {
/* reboot sysrq handler */ /* reboot sysrq handler */
static void sysrq_handle_reboot(int key, struct pt_regs *pt_regs, static void sysrq_handle_reboot(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) { struct tty_struct *tty)
{
machine_restart(NULL); machine_restart(NULL);
} }
static struct sysrq_key_op sysrq_reboot_op = { static struct sysrq_key_op sysrq_reboot_op = {
...@@ -218,7 +224,8 @@ void do_emergency_sync(void) { ...@@ -218,7 +224,8 @@ void do_emergency_sync(void) {
} }
static void sysrq_handle_sync(int key, struct pt_regs *pt_regs, static void sysrq_handle_sync(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) { struct tty_struct *tty)
{
emergency_sync_scheduled = EMERG_SYNC; emergency_sync_scheduled = EMERG_SYNC;
wakeup_bdflush(); wakeup_bdflush();
} }
...@@ -229,7 +236,8 @@ static struct sysrq_key_op sysrq_sync_op = { ...@@ -229,7 +236,8 @@ static struct sysrq_key_op sysrq_sync_op = {
}; };
static void sysrq_handle_mountro(int key, struct pt_regs *pt_regs, static void sysrq_handle_mountro(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) { struct tty_struct *tty)
{
emergency_sync_scheduled = EMERG_REMOUNT; emergency_sync_scheduled = EMERG_REMOUNT;
wakeup_bdflush(); wakeup_bdflush();
} }
...@@ -245,7 +253,8 @@ static struct sysrq_key_op sysrq_mountro_op = { ...@@ -245,7 +253,8 @@ static struct sysrq_key_op sysrq_mountro_op = {
/* SHOW SYSRQ HANDLERS BLOCK */ /* SHOW SYSRQ HANDLERS BLOCK */
static void sysrq_handle_showregs(int key, struct pt_regs *pt_regs, static void sysrq_handle_showregs(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) { struct tty_struct *tty)
{
if (pt_regs) if (pt_regs)
show_regs(pt_regs); show_regs(pt_regs);
} }
...@@ -257,7 +266,8 @@ static struct sysrq_key_op sysrq_showregs_op = { ...@@ -257,7 +266,8 @@ static struct sysrq_key_op sysrq_showregs_op = {
static void sysrq_handle_showstate(int key, struct pt_regs *pt_regs, static void sysrq_handle_showstate(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) { struct tty_struct *tty)
{
show_state(); show_state();
} }
static struct sysrq_key_op sysrq_showstate_op = { static struct sysrq_key_op sysrq_showstate_op = {
...@@ -268,7 +278,8 @@ static struct sysrq_key_op sysrq_showstate_op = { ...@@ -268,7 +278,8 @@ static struct sysrq_key_op sysrq_showstate_op = {
static void sysrq_handle_showmem(int key, struct pt_regs *pt_regs, static void sysrq_handle_showmem(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) { struct tty_struct *tty)
{
show_mem(); show_mem();
} }
static struct sysrq_key_op sysrq_showmem_op = { static struct sysrq_key_op sysrq_showmem_op = {
...@@ -296,7 +307,8 @@ static void send_sig_all(int sig) ...@@ -296,7 +307,8 @@ static void send_sig_all(int sig)
} }
static void sysrq_handle_term(int key, struct pt_regs *pt_regs, static void sysrq_handle_term(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) { struct tty_struct *tty)
{
send_sig_all(SIGTERM); send_sig_all(SIGTERM);
console_loglevel = 8; console_loglevel = 8;
} }
...@@ -307,7 +319,8 @@ static struct sysrq_key_op sysrq_term_op = { ...@@ -307,7 +319,8 @@ static struct sysrq_key_op sysrq_term_op = {
}; };
static void sysrq_handle_kill(int key, struct pt_regs *pt_regs, static void sysrq_handle_kill(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) { struct tty_struct *tty)
{
send_sig_all(SIGKILL); send_sig_all(SIGKILL);
console_loglevel = 8; console_loglevel = 8;
} }
...@@ -416,13 +429,13 @@ void __sysrq_put_key_op (int key, struct sysrq_key_op *op_p) { ...@@ -416,13 +429,13 @@ void __sysrq_put_key_op (int key, struct sysrq_key_op *op_p) {
* and any other keycode arrives. * and any other keycode arrives.
*/ */
void handle_sysrq(int key, struct pt_regs *pt_regs, void handle_sysrq(int key, struct pt_regs *pt_regs, struct tty_struct *tty)
struct kbd_struct *kbd, struct tty_struct *tty) { {
if (!sysrq_enabled) if (!sysrq_enabled)
return; return;
__sysrq_lock_table(); __sysrq_lock_table();
__handle_sysrq_nolock(key, pt_regs, kbd, tty); __handle_sysrq_nolock(key, pt_regs, tty);
__sysrq_unlock_table(); __sysrq_unlock_table();
} }
...@@ -433,7 +446,8 @@ void handle_sysrq(int key, struct pt_regs *pt_regs, ...@@ -433,7 +446,8 @@ void handle_sysrq(int key, struct pt_regs *pt_regs,
*/ */
void __handle_sysrq_nolock(int key, struct pt_regs *pt_regs, void __handle_sysrq_nolock(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) { struct tty_struct *tty)
{
struct sysrq_key_op *op_p; struct sysrq_key_op *op_p;
int orig_log_level; int orig_log_level;
int i, j; int i, j;
...@@ -449,7 +463,7 @@ void __handle_sysrq_nolock(int key, struct pt_regs *pt_regs, ...@@ -449,7 +463,7 @@ void __handle_sysrq_nolock(int key, struct pt_regs *pt_regs,
if (op_p) { if (op_p) {
printk ("%s\n", op_p->action_msg); printk ("%s\n", op_p->action_msg);
console_loglevel = orig_log_level; console_loglevel = orig_log_level;
op_p->handler(key, pt_regs, kbd, tty); op_p->handler(key, pt_regs, tty);
} else { } else {
printk("HELP : "); printk("HELP : ");
/* Only print the help msg once per handler */ /* Only print the help msg once per handler */
......
...@@ -14,12 +14,10 @@ ...@@ -14,12 +14,10 @@
#include <linux/config.h> #include <linux/config.h>
struct pt_regs; struct pt_regs;
struct kbd_struct;
struct tty_struct; struct tty_struct;
struct sysrq_key_op { struct sysrq_key_op {
void (*handler)(int, struct pt_regs *, void (*handler)(int, struct pt_regs *, struct tty_struct *);
struct kbd_struct *, struct tty_struct *);
char *help_msg; char *help_msg;
char *action_msg; char *action_msg;
}; };
...@@ -31,19 +29,14 @@ struct sysrq_key_op { ...@@ -31,19 +29,14 @@ struct sysrq_key_op {
* are available -- else NULL's). * are available -- else NULL's).
*/ */
void handle_sysrq(int, struct pt_regs *, void handle_sysrq(int, struct pt_regs *, struct tty_struct *);
struct kbd_struct *, struct tty_struct *);
/* /*
* Nonlocking version of handle sysrq, used by sysrq handlers that need to * Nonlocking version of handle sysrq, used by sysrq handlers that need to
* call sysrq handlers * call sysrq handlers
*/ */
void __handle_sysrq_nolock(int, struct pt_regs *, void __handle_sysrq_nolock(int, struct pt_regs *, struct tty_struct *);
struct kbd_struct *, struct tty_struct *);
/* /*
* Sysrq registration manipulation functions * Sysrq registration manipulation functions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment