Linux Audio

Check our new training course

Real-Time Linux with PREEMPT_RT training

Feb 18-20, 2025
Register
Loading...
v3.5.6
 
 1/*
 2 * Copyright (C) 2011 Richard Weinberger <richrd@nod.at>
 3 *
 4 * This program is free software; you can redistribute it and/or modify
 5 * it under the terms of the GNU General Public License version 2 as
 6 * published by the Free Software Foundation.
 7 */
 8
 9#include <linux/kernel.h>
10#include <linux/console.h>
11#include <linux/init.h>
12#include "os.h"
13
14static void early_console_write(struct console *con, const char *s, unsigned int n)
15{
16	um_early_printk(s, n);
17}
18
19static struct console early_console = {
20	.name = "earlycon",
21	.write = early_console_write,
22	.flags = CON_BOOT,
23	.index = -1,
24};
25
26static int __init setup_early_printk(char *buf)
27{
28	register_console(&early_console);
29
 
 
30	return 0;
31}
32
33early_param("earlyprintk", setup_early_printk);
v6.8
 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);