Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Copyright (C) 2011 Richard Weinberger <richrd@nod.at>
0004  */
0005 
0006 #include <linux/kernel.h>
0007 #include <linux/console.h>
0008 #include <linux/init.h>
0009 #include <os.h>
0010 
0011 static void early_console_write(struct console *con, const char *s, unsigned int n)
0012 {
0013     um_early_printk(s, n);
0014 }
0015 
0016 static struct console early_console_dev = {
0017     .name = "earlycon",
0018     .write = early_console_write,
0019     .flags = CON_BOOT,
0020     .index = -1,
0021 };
0022 
0023 static int __init setup_early_printk(char *buf)
0024 {
0025     if (!early_console) {
0026         early_console = &early_console_dev;
0027         register_console(&early_console_dev);
0028     }
0029     return 0;
0030 }
0031 
0032 early_param("earlyprintk", setup_early_printk);