#include <linux/kernel.h>
#include <linux/major.h>
#include <linux/errno.h>
#include <linux/export.h>
#include <linux/tty.h>
#include <linux/interrupt.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/vt_kern.h>
#include <linux/selection.h>
#include <linux/kbd_kern.h>
#include <linux/console.h>
#include <linux/device.h>
#include <linux/sched.h>
#include <linux/fs.h>
#include <linux/poll.h>
#include <linux/signal.h>
#include <linux/slab.h>
#include <linux/notifier.h>
#include <linux/uaccess.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>
#define HEADER_SIZE …
#define CON_BUF_SIZE …
#if MAX_NR_CONSOLES > 63
#warning "/dev/vcs* devices may not accommodate more than 63 consoles"
#endif
#define console(inode) …
#define use_unicode(inode) …
#define use_attributes(inode) …
struct vcs_poll_data { … };
static int
vcs_notifier(struct notifier_block *nb, unsigned long code, void *_param)
{ … }
static void
vcs_poll_data_free(struct vcs_poll_data *poll)
{ … }
static struct vcs_poll_data *
vcs_poll_data_get(struct file *file)
{ … }
static struct vc_data *vcs_vc(struct inode *inode, bool *viewed)
{ … }
static int vcs_size(const struct vc_data *vc, bool attr, bool unicode)
{ … }
static loff_t vcs_lseek(struct file *file, loff_t offset, int orig)
{ … }
static int vcs_read_buf_uni(struct vc_data *vc, char *con_buf,
unsigned int pos, unsigned int count, bool viewed)
{ … }
static void vcs_read_buf_noattr(const struct vc_data *vc, char *con_buf,
unsigned int pos, unsigned int count, bool viewed)
{ … }
static unsigned int vcs_read_buf(const struct vc_data *vc, char *con_buf,
unsigned int pos, unsigned int count, bool viewed,
unsigned int *skip)
{ … }
static ssize_t
vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
{ … }
static u16 *vcs_write_buf_noattr(struct vc_data *vc, const char *con_buf,
unsigned int pos, unsigned int count, bool viewed, u16 **org0)
{ … }
static inline u16 vc_compile_le16(u8 hi, u8 lo)
{ … }
static u16 *vcs_write_buf(struct vc_data *vc, const char *con_buf,
unsigned int pos, unsigned int count, bool viewed, u16 **org0)
{ … }
static ssize_t
vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{ … }
static __poll_t
vcs_poll(struct file *file, poll_table *wait)
{ … }
static int
vcs_fasync(int fd, struct file *file, int on)
{ … }
static int
vcs_open(struct inode *inode, struct file *filp)
{ … }
static int vcs_release(struct inode *inode, struct file *file)
{ … }
static const struct file_operations vcs_fops = …;
static const struct class vc_class = …;
void vcs_make_sysfs(int index)
{ … }
void vcs_remove_sysfs(int index)
{ … }
int __init vcs_init(void)
{ … }