Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
6e0cbcec
Commit
6e0cbcec
authored
Jun 27, 2002
by
James Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed passing around struct kbd_struct for sysrq. Only two calls use it.
parent
2ffe5f2f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
31 deletions
+38
-31
arch/i386/kernel/apm.c
arch/i386/kernel/apm.c
+1
-1
arch/ppc/xmon/start.c
arch/ppc/xmon/start.c
+1
-1
arch/ppc64/xmon/start.c
arch/ppc64/xmon/start.c
+1
-1
drivers/acpi/system.c
drivers/acpi/system.c
+1
-1
drivers/char/keyboard.c
drivers/char/keyboard.c
+1
-1
drivers/char/sysrq.c
drivers/char/sysrq.c
+30
-16
include/linux/sysrq.h
include/linux/sysrq.h
+3
-10
No files found.
arch/i386/kernel/apm.c
View file @
6e0cbcec
...
@@ -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
();
}
}
...
...
arch/ppc/xmon/start.c
View file @
6e0cbcec
...
@@ -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
);
}
}
...
...
arch/ppc64/xmon/start.c
View file @
6e0cbcec
...
@@ -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
);
}
}
...
...
drivers/acpi/system.c
View file @
6e0cbcec
...
@@ -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
();
}
}
...
...
drivers/char/keyboard.c
View file @
6e0cbcec
...
@@ -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
;
}
}
}
}
...
...
drivers/char/sysrq.c
View file @
6e0cbcec
...
@@ -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 */
...
...
include/linux/sysrq.h
View file @
6e0cbcec
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment