diff options
author | Srikant Patnaik | 2015-01-13 15:08:24 +0530 |
---|---|---|
committer | Srikant Patnaik | 2015-01-13 15:08:24 +0530 |
commit | 97327692361306d1e6259021bc425e32832fdb50 (patch) | |
tree | fe9088f3248ec61e24f404f21b9793cb644b7f01 /include/linux/sysrq.h | |
parent | 2d05a8f663478a44e088d122e0d62109bbc801d0 (diff) | |
parent | a3a8b90b61e21be3dde9101c4e86c881e0f06210 (diff) | |
download | FOSSEE-netbook-kernel-source-97327692361306d1e6259021bc425e32832fdb50.tar.gz FOSSEE-netbook-kernel-source-97327692361306d1e6259021bc425e32832fdb50.tar.bz2 FOSSEE-netbook-kernel-source-97327692361306d1e6259021bc425e32832fdb50.zip |
dirty fix to merging
Diffstat (limited to 'include/linux/sysrq.h')
-rw-r--r-- | include/linux/sysrq.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h new file mode 100644 index 00000000..7faf933c --- /dev/null +++ b/include/linux/sysrq.h @@ -0,0 +1,78 @@ +/* -*- linux-c -*- + * + * $Id: sysrq.h,v 1.3 1997/07/17 11:54:33 mj Exp $ + * + * Linux Magic System Request Key Hacks + * + * (c) 1997 Martin Mares <mj@atrey.karlin.mff.cuni.cz> + * + * (c) 2000 Crutcher Dunnavant <crutcher+kernel@datastacks.com> + * overhauled to use key registration + * based upon discusions in irc://irc.openprojects.net/#kernelnewbies + */ + +#ifndef _LINUX_SYSRQ_H +#define _LINUX_SYSRQ_H + +#include <linux/errno.h> +#include <linux/types.h> + +/* Enable/disable SYSRQ support by default (0==no, 1==yes). */ +#define SYSRQ_DEFAULT_ENABLE 1 + +/* Possible values of bitmask for enabling sysrq functions */ +/* 0x0001 is reserved for enable everything */ +#define SYSRQ_ENABLE_LOG 0x0002 +#define SYSRQ_ENABLE_KEYBOARD 0x0004 +#define SYSRQ_ENABLE_DUMP 0x0008 +#define SYSRQ_ENABLE_SYNC 0x0010 +#define SYSRQ_ENABLE_REMOUNT 0x0020 +#define SYSRQ_ENABLE_SIGNAL 0x0040 +#define SYSRQ_ENABLE_BOOT 0x0080 +#define SYSRQ_ENABLE_RTNICE 0x0100 + +struct sysrq_key_op { + void (*handler)(int); + char *help_msg; + char *action_msg; + int enable_mask; +}; + +#ifdef CONFIG_MAGIC_SYSRQ + +/* Generic SysRq interface -- you may call it from any device driver, supplying + * ASCII code of the key, pointer to registers and kbd/tty structs (if they + * are available -- else NULL's). + */ + +void handle_sysrq(int key); +void __handle_sysrq(int key, bool check_mask); +int register_sysrq_key(int key, struct sysrq_key_op *op); +int unregister_sysrq_key(int key, struct sysrq_key_op *op); +struct sysrq_key_op *__sysrq_get_key_op(int key); + +int sysrq_toggle_support(int enable_mask); + +#else + +static inline void handle_sysrq(int key) +{ +} + +static inline void __handle_sysrq(int key, bool check_mask) +{ +} + +static inline int register_sysrq_key(int key, struct sysrq_key_op *op) +{ + return -EINVAL; +} + +static inline int unregister_sysrq_key(int key, struct sysrq_key_op *op) +{ + return -EINVAL; +} + +#endif + +#endif /* _LINUX_SYSRQ_H */ |