From 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 16 Apr 2005 15:20:36 -0700 Subject: Linux-2.6.12-rc2 Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip! --- include/linux/sysrq.h | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 include/linux/sysrq.h (limited to 'include/linux/sysrq.h') diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h new file mode 100644 index 000000000000..ea819b89c235 --- /dev/null +++ b/include/linux/sysrq.h @@ -0,0 +1,60 @@ +/* -*- 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 + * + * (c) 2000 Crutcher Dunnavant + * overhauled to use key registration + * based upon discusions in irc://irc.openprojects.net/#kernelnewbies + */ + +#include + +struct pt_regs; +struct tty_struct; + +/* 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, struct pt_regs *, struct tty_struct *); + 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, struct pt_regs *, struct tty_struct *); +void __handle_sysrq(int, struct pt_regs *, struct tty_struct *, int check_mask); +int register_sysrq_key(int, struct sysrq_key_op *); +int unregister_sysrq_key(int, struct sysrq_key_op *); +struct sysrq_key_op *__sysrq_get_key_op(int key); + +#else + +static inline int __reterr(void) +{ + return -EINVAL; +} + +#define register_sysrq_key(ig,nore) __reterr() +#define unregister_sysrq_key(ig,nore) __reterr() + +#endif -- cgit v1.2.3