PageRenderTime 18ms CodeModel.GetById 13ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/arch/um/kernel/early_printk.c

http://github.com/mirrors/linux
C | 32 lines | 23 code | 5 blank | 4 comment | 1 complexity | 55403069c5229b4298e8771d991b3117 MD5 | raw file
 1// SPDX-License-Identifier: GPL-2.0-only
 2/*
 3 * Copyright (C) 2011 Richard Weinberger <richrd@nod.at>
 4 */
 5
 6#include <linux/kernel.h>
 7#include <linux/console.h>
 8#include <linux/init.h>
 9#include <os.h>
10
11static void early_console_write(struct console *con, const char *s, unsigned int n)
12{
13	um_early_printk(s, n);
14}
15
16static struct console early_console_dev = {
17	.name = "earlycon",
18	.write = early_console_write,
19	.flags = CON_BOOT,
20	.index = -1,
21};
22
23static int __init setup_early_printk(char *buf)
24{
25	if (!early_console) {
26		early_console = &early_console_dev;
27		register_console(&early_console_dev);
28	}
29	return 0;
30}
31
32early_param("earlyprintk", setup_early_printk);