0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef _LINUX_SYSRQ_H
0016 #define _LINUX_SYSRQ_H
0017
0018 #include <linux/errno.h>
0019 #include <linux/types.h>
0020
0021
0022
0023 #define SYSRQ_ENABLE_LOG 0x0002
0024 #define SYSRQ_ENABLE_KEYBOARD 0x0004
0025 #define SYSRQ_ENABLE_DUMP 0x0008
0026 #define SYSRQ_ENABLE_SYNC 0x0010
0027 #define SYSRQ_ENABLE_REMOUNT 0x0020
0028 #define SYSRQ_ENABLE_SIGNAL 0x0040
0029 #define SYSRQ_ENABLE_BOOT 0x0080
0030 #define SYSRQ_ENABLE_RTNICE 0x0100
0031
0032 struct sysrq_key_op {
0033 void (* const handler)(int);
0034 const char * const help_msg;
0035 const char * const action_msg;
0036 const int enable_mask;
0037 };
0038
0039 #ifdef CONFIG_MAGIC_SYSRQ
0040
0041
0042
0043
0044
0045
0046 void handle_sysrq(int key);
0047 void __handle_sysrq(int key, bool check_mask);
0048 int register_sysrq_key(int key, const struct sysrq_key_op *op);
0049 int unregister_sysrq_key(int key, const struct sysrq_key_op *op);
0050 extern const struct sysrq_key_op *__sysrq_reboot_op;
0051
0052 int sysrq_toggle_support(int enable_mask);
0053 int sysrq_mask(void);
0054
0055 #else
0056
0057 static inline void handle_sysrq(int key)
0058 {
0059 }
0060
0061 static inline void __handle_sysrq(int key, bool check_mask)
0062 {
0063 }
0064
0065 static inline int register_sysrq_key(int key, const struct sysrq_key_op *op)
0066 {
0067 return -EINVAL;
0068 }
0069
0070 static inline int unregister_sysrq_key(int key, const struct sysrq_key_op *op)
0071 {
0072 return -EINVAL;
0073 }
0074
0075 static inline int sysrq_mask(void)
0076 {
0077
0078 return 0;
0079 }
0080
0081 #endif
0082
0083 #endif