early_printk.c 740 B

12345678910111213141516171819202122232425262728293031323334
  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. #include <linux/kernel.h>
  9. #include <linux/console.h>
  10. #include <linux/init.h>
  11. #include "os.h"
  12. static void early_console_write(struct console *con, const char *s, unsigned int n)
  13. {
  14. um_early_printk(s, n);
  15. }
  16. static struct console early_console = {
  17. .name = "earlycon",
  18. .write = early_console_write,
  19. .flags = CON_BOOT,
  20. .index = -1,
  21. };
  22. static int __init setup_early_printk(char *buf)
  23. {
  24. register_console(&early_console);
  25. return 0;
  26. }
  27. early_param("earlyprintk", setup_early_printk);