#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/compiler.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/atomic.h>
#include <linux/console.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
#include <linux/serial_core.h>
#include <linux/interrupt.h>
#include <linux/hrtimer.h>
#include <linux/tick.h>
#include <linux/kfifo.h>
#include <linux/kgdb.h>
#include <linux/kdb.h>
static int kgdb_nmi_knock = …;
module_param_named(knock, kgdb_nmi_knock, int, 0600);
MODULE_PARM_DESC(…) …;
static char *kgdb_nmi_magic = …;
module_param_named(magic, kgdb_nmi_magic, charp, 0600);
MODULE_PARM_DESC(…) …;
static atomic_t kgdb_nmi_num_readers = …;
static int kgdb_nmi_console_setup(struct console *co, char *options)
{ … }
static void kgdb_nmi_console_write(struct console *co, const char *s, uint c)
{ … }
static struct tty_driver *kgdb_nmi_tty_driver;
static struct tty_driver *kgdb_nmi_console_device(struct console *co, int *idx)
{ … }
static struct console kgdb_nmi_console = …;
#define KGDB_NMI_BAUD …
#define KGDB_NMI_FIFO_SIZE …
struct kgdb_nmi_tty_priv { … };
static struct tty_port *kgdb_nmi_port;
static void kgdb_tty_recv(int ch)
{ … }
static int kgdb_nmi_poll_one_knock(void)
{ … }
bool kgdb_nmi_poll_knock(void)
{ … }
static void kgdb_nmi_tty_receiver(struct timer_list *t)
{ … }
static int kgdb_nmi_tty_activate(struct tty_port *port, struct tty_struct *tty)
{ … }
static void kgdb_nmi_tty_shutdown(struct tty_port *port)
{ … }
static const struct tty_port_operations kgdb_nmi_tty_port_ops = …;
static int kgdb_nmi_tty_install(struct tty_driver *drv, struct tty_struct *tty)
{ … }
static void kgdb_nmi_tty_cleanup(struct tty_struct *tty)
{ … }
static int kgdb_nmi_tty_open(struct tty_struct *tty, struct file *file)
{ … }
static void kgdb_nmi_tty_close(struct tty_struct *tty, struct file *file)
{ … }
static void kgdb_nmi_tty_hangup(struct tty_struct *tty)
{ … }
static unsigned int kgdb_nmi_tty_write_room(struct tty_struct *tty)
{ … }
static ssize_t kgdb_nmi_tty_write(struct tty_struct *tty, const u8 *buf,
size_t c)
{ … }
static const struct tty_operations kgdb_nmi_tty_ops = …;
int kgdb_register_nmi_console(void)
{ … }
EXPORT_SYMBOL_GPL(…);
int kgdb_unregister_nmi_console(void)
{ … }
EXPORT_SYMBOL_GPL(…);