Contributors: 15
Author Tokens Token Proportion Commits Commit Proportion
Linus Torvalds 40 17.47% 2 8.33%
Dmitry Torokhov 38 16.59% 3 12.50%
Jan Kara 37 16.16% 1 4.17%
Ingo Molnar 21 9.17% 1 4.17%
Emil Velikov 20 8.73% 3 12.50%
Dmitry Safonov 19 8.30% 1 4.17%
Linus Torvalds (pre-git) 16 6.99% 4 16.67%
Jiri Slaby (SUSE) 9 3.93% 2 8.33%
Thomas Petazzoni 9 3.93% 1 4.17%
Jason Wessel 8 3.49% 1 4.17%
Andrew Morton 3 1.31% 1 4.17%
Tobias Doerffel 3 1.31% 1 4.17%
Al Viro 3 1.31% 1 4.17%
Jason Baron 2 0.87% 1 4.17%
Greg Kroah-Hartman 1 0.44% 1 4.17%
Total 229 24


/* SPDX-License-Identifier: GPL-2.0 */
/* -*- 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>

/* 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 (* const handler)(u8);
	const char * const help_msg;
	const char * const action_msg;
	const 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(u8 key);
void __handle_sysrq(u8 key, bool check_mask);
int register_sysrq_key(u8 key, const struct sysrq_key_op *op);
int unregister_sysrq_key(u8 key, const struct sysrq_key_op *op);
extern const struct sysrq_key_op *__sysrq_reboot_op;

int sysrq_toggle_support(int enable_mask);
int sysrq_mask(void);

#else

static inline void handle_sysrq(u8 key)
{
}

static inline void __handle_sysrq(u8 key, bool check_mask)
{
}

static inline int register_sysrq_key(u8 key, const struct sysrq_key_op *op)
{
	return -EINVAL;
}

static inline int unregister_sysrq_key(u8 key, const struct sysrq_key_op *op)
{
	return -EINVAL;
}

static inline int sysrq_mask(void)
{
	/* Magic SysRq disabled mask */
	return 0;
}

#endif

#endif /* _LINUX_SYSRQ_H */