#include <linux/console.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/irq.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/list.h>
#include <linux/serial_core.h>
#include <asm/io.h>
#include <asm/xen/hypervisor.h>
#include <xen/xen.h>
#include <xen/interface/xen.h>
#include <xen/hvm.h>
#include <xen/grant_table.h>
#include <xen/page.h>
#include <xen/events.h>
#include <xen/interface/io/console.h>
#include <xen/interface/sched.h>
#include <xen/hvc-console.h>
#include <xen/xenbus.h>
#include "hvc_console.h"
#define HVC_COOKIE …
struct xencons_info { … };
static LIST_HEAD(xenconsoles);
static DEFINE_SPINLOCK(xencons_lock);
static struct xencons_info *vtermno_to_xencons(int vtermno)
{ … }
static inline int xenbus_devid_to_vtermno(int devid)
{ … }
static inline void notify_daemon(struct xencons_info *cons)
{ … }
static ssize_t __write_console(struct xencons_info *xencons,
const u8 *data, size_t len)
{ … }
static ssize_t domU_write_console(uint32_t vtermno, const u8 *data, size_t len)
{ … }
static ssize_t domU_read_console(uint32_t vtermno, u8 *buf, size_t len)
{ … }
static const struct hv_ops domU_hvc_ops = …;
static ssize_t dom0_read_console(uint32_t vtermno, u8 *buf, size_t len)
{ … }
static ssize_t dom0_write_console(uint32_t vtermno, const u8 *str, size_t len)
{ … }
static const struct hv_ops dom0_hvc_ops = …;
static int xen_hvm_console_init(void)
{ … }
static int xencons_info_pv_init(struct xencons_info *info, int vtermno)
{ … }
static int xen_pv_console_init(void)
{ … }
static int xen_initial_domain_console_init(void)
{ … }
static void xen_console_update_evtchn(struct xencons_info *info)
{ … }
void xen_console_resume(void)
{ … }
#ifdef CONFIG_HVC_XEN_FRONTEND
static void xencons_disconnect_backend(struct xencons_info *info)
{ … }
static void xencons_free(struct xencons_info *info)
{ … }
static int xen_console_remove(struct xencons_info *info)
{ … }
static void xencons_remove(struct xenbus_device *dev)
{ … }
static int xencons_connect_backend(struct xenbus_device *dev,
struct xencons_info *info)
{ … }
static int xencons_probe(struct xenbus_device *dev,
const struct xenbus_device_id *id)
{ … }
static int xencons_resume(struct xenbus_device *dev)
{ … }
static void xencons_backend_changed(struct xenbus_device *dev,
enum xenbus_state backend_state)
{ … }
static const struct xenbus_device_id xencons_ids[] = …;
static struct xenbus_driver xencons_driver = …;
#endif
static int __init xen_hvc_init(void)
{ … }
device_initcall(xen_hvc_init);
static int xen_cons_init(void)
{ … }
console_initcall(xen_cons_init);
#ifdef CONFIG_X86
static void xen_hvm_early_write(uint32_t vtermno, const char *str, int len)
{ … }
#else
static void xen_hvm_early_write(uint32_t vtermno, const char *str, int len) { }
#endif
#ifdef CONFIG_EARLY_PRINTK
static int __init xenboot_console_setup(struct console *console, char *string)
{ … }
static void xenboot_write_console(struct console *console, const char *string,
unsigned len)
{ … }
struct console xenboot_console = …;
#endif
void xen_raw_console_write(const char *str)
{ … }
void xen_raw_printk(const char *fmt, ...)
{ … }
static void xenboot_earlycon_write(struct console *console,
const char *string,
unsigned len)
{ … }
static int __init xenboot_earlycon_setup(struct earlycon_device *device,
const char *opt)
{ … }
EARLYCON_DECLARE(…);