lkml.org 
[lkml]   [2015]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RFC PATCH 11/28] lkl: basic kernel console support
    Date
    Write operations are deferred to the host print operation.

    Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
    ---
    arch/lkl/kernel/console.c | 41 +++++++++++++++++++++++++++++++++++++++++
    1 file changed, 41 insertions(+)
    create mode 100644 arch/lkl/kernel/console.c

    diff --git a/arch/lkl/kernel/console.c b/arch/lkl/kernel/console.c
    new file mode 100644
    index 0000000..bd3a686
    --- /dev/null
    +++ b/arch/lkl/kernel/console.c
    @@ -0,0 +1,41 @@
    +#include <linux/init.h>
    +#include <linux/kernel.h>
    +#include <linux/console.h>
    +#include <asm/host_ops.h>
    +
    +static void console_write(struct console *con, const char *str, unsigned len)
    +{
    + if (lkl_ops->print)
    + lkl_ops->print(str, len);
    +}
    +
    +#ifdef CONFIG_LKL_EARLY_CONSOLE
    +static struct console lkl_boot_console = {
    + .name = "lkl_boot_console",
    + .write = console_write,
    + .flags = CON_PRINTBUFFER | CON_BOOT,
    + .index = -1,
    +};
    +
    +int __init lkl_boot_console_init(void)
    +{
    + register_console(&lkl_boot_console);
    + return 0;
    +}
    +early_initcall(lkl_boot_console_init);
    +#endif
    +
    +static struct console lkl_console = {
    + .name = "lkl_console",
    + .write = console_write,
    + .flags = CON_PRINTBUFFER,
    + .index = -1,
    +};
    +
    +int __init lkl_console_init(void)
    +{
    + register_console(&lkl_console);
    + return 0;
    +}
    +core_initcall(lkl_console_init);
    +
    --
    2.1.0


    \
     
     \ /
      Last update: 2015-11-03 21:41    [W:5.444 / U:0.160 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site