#include <xen/lib.h>
#include <xen/stdarg.h>
#include <xen/string.h>
+#include <xen/early_printk.h>
#include <asm/early_printk.h>
void early_putch(char c);
#include <asm/debugger.h>
#include <asm/div64.h>
#include <xen/hypercall.h> /* for do_console_io */
+#include <xen/early_printk.h>
/* console: comma-separated list of console outputs. */
static char __initdata opt_console[30] = OPT_CONSOLE_STR;
static char serial_rx_ring[SERIAL_RX_SIZE];
static unsigned int serial_rx_cons, serial_rx_prod;
-static void (*serial_steal_fn)(const char *);
+static void (*serial_steal_fn)(const char *) = early_puts;
int console_steal(int handle, void (*fn)(const char *))
{
else if ( !strncmp(p, "none", 4) )
continue;
else if ( (sh = serial_parse_handle(p)) >= 0 )
+ {
sercon_handle = sh;
+ serial_steal_fn = NULL;
+ }
else
{
char *q = strchr(p, ',');
#ifdef CONFIG_EARLY_PRINTK
-void early_puts(const char *s);
void early_printk(const char *fmt, ...)
__attribute__((format (printf, 1, 2)));
void noreturn early_panic(const char *fmt, ...)
#else
-static inline void early_puts(const char *) {}
-
static inline __attribute__((format (printf, 1, 2))) void
early_printk(const char *fmt, ...)
{}
--- /dev/null
+/*
+ * printk() for use before the console is initialized
+ */
+#ifndef __XEN_EARLY_PRINTK_H__
+#define __XEN_EARLY_PRINTK_H__
+
+#ifdef CONFIG_EARLY_PRINTK
+void early_puts(const char *s);
+#else
+#define early_puts NULL
+#endif
+
+#endif
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */