source: svn/trunk/newcon3bcm2_21bu/toolchain/mipsel-linux-uclibc/include/linux/sysrq.h @ 2

Last change on this file since 2 was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1/* -*- linux-c -*-
2 *
3 *
4 *      Linux Magic System Request Key Hacks
5 *
6 *      (c) 1997 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
7 *
8 *      (c) 2000 Crutcher Dunnavant <crutcher+kernel@datastacks.com>
9 *      overhauled to use key registration
10 *      based upon discusions in irc://irc.openprojects.net/#kernelnewbies
11 */
12
13
14struct pt_regs;
15struct tty_struct;
16
17/* Possible values of bitmask for enabling sysrq functions */
18/* 0x0001 is reserved for enable everything */
19#define SYSRQ_ENABLE_LOG        0x0002
20#define SYSRQ_ENABLE_KEYBOARD   0x0004
21#define SYSRQ_ENABLE_DUMP       0x0008
22#define SYSRQ_ENABLE_SYNC       0x0010
23#define SYSRQ_ENABLE_REMOUNT    0x0020
24#define SYSRQ_ENABLE_SIGNAL     0x0040
25#define SYSRQ_ENABLE_BOOT       0x0080
26#define SYSRQ_ENABLE_RTNICE     0x0100
27
28struct sysrq_key_op {
29        void (*handler)(int, struct pt_regs *, struct tty_struct *);
30        char *help_msg;
31        char *action_msg;
32        int enable_mask;
33};
34
35#ifdef CONFIG_MAGIC_SYSRQ
36
37/* Generic SysRq interface -- you may call it from any device driver, supplying
38 * ASCII code of the key, pointer to registers and kbd/tty structs (if they
39 * are available -- else NULL's).
40 */
41
42void handle_sysrq(int, struct pt_regs *, struct tty_struct *);
43void __handle_sysrq(int, struct pt_regs *, struct tty_struct *, int check_mask);
44int register_sysrq_key(int, struct sysrq_key_op *);
45int unregister_sysrq_key(int, struct sysrq_key_op *);
46struct sysrq_key_op *__sysrq_get_key_op(int key);
47
48#else
49
50static inline int __reterr(void)
51{
52        return -EINVAL;
53}
54
55#define register_sysrq_key(ig,nore) __reterr()
56#define unregister_sysrq_key(ig,nore) __reterr()
57
58#endif
Note: See TracBrowser for help on using the repository browser.