18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  Unified handling of special chars.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *    Copyright IBM Corp. 2001
68c2ecf20Sopenharmony_ci *    Author(s): Fritz Elfert <felfert@millenux.com> <elfert@de.ibm.com>
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#include <linux/tty.h>
118c2ecf20Sopenharmony_ci#include <linux/sysrq.h>
128c2ecf20Sopenharmony_ci#include <linux/workqueue.h>
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ciextern unsigned int
158c2ecf20Sopenharmony_cictrlchar_handle(const unsigned char *buf, int len, struct tty_struct *tty);
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#define CTRLCHAR_NONE  (1 << 8)
198c2ecf20Sopenharmony_ci#define CTRLCHAR_CTRL  (2 << 8)
208c2ecf20Sopenharmony_ci#define CTRLCHAR_SYSRQ (3 << 8)
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#define CTRLCHAR_MASK (~0xffu)
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#ifdef CONFIG_MAGIC_SYSRQ
268c2ecf20Sopenharmony_cistruct sysrq_work {
278c2ecf20Sopenharmony_ci	int key;
288c2ecf20Sopenharmony_ci	struct work_struct work;
298c2ecf20Sopenharmony_ci};
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_civoid schedule_sysrq_work(struct sysrq_work *sw);
328c2ecf20Sopenharmony_ci#endif
33