arc_con.c 973 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Wrap-around code for a console using the
  3. * ARC io-routines.
  4. *
  5. * Copyright (c) 1998 Harald Koerfgen
  6. * Copyright (c) 2001 Ralf Baechle
  7. * Copyright (c) 2002 Thiemo Seufer
  8. */
  9. #include <linux/tty.h>
  10. #include <linux/major.h>
  11. #include <linux/init.h>
  12. #include <linux/console.h>
  13. #include <linux/fs.h>
  14. #include <asm/sgialib.h>
  15. static void prom_console_write(struct console *co, const char *s,
  16. unsigned count)
  17. {
  18. /* Do each character */
  19. while (count--) {
  20. if (*s == '\n')
  21. prom_putchar('\r');
  22. prom_putchar(*s++);
  23. }
  24. }
  25. static int prom_console_setup(struct console *co, char *options)
  26. {
  27. return !(prom_flags & PROM_FLAG_USE_AS_CONSOLE);
  28. }
  29. static struct console arc_cons = {
  30. .name = "arc",
  31. .write = prom_console_write,
  32. .setup = prom_console_setup,
  33. .flags = CON_PRINTBUFFER,
  34. .index = -1,
  35. };
  36. /*
  37. * Register console.
  38. */
  39. static int __init arc_console_init(void)
  40. {
  41. register_console(&arc_cons);
  42. return 0;
  43. }
  44. console_initcall(arc_console_init);