You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

serial_console.c 928B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include <ipxe/init.h>
  2. #include <ipxe/serial.h>
  3. #include <ipxe/console.h>
  4. #include <config/console.h>
  5. /** @file
  6. *
  7. * Serial console
  8. *
  9. */
  10. /* Set default console usage if applicable */
  11. #if ! ( defined ( CONSOLE_SERIAL ) && CONSOLE_EXPLICIT ( CONSOLE_SERIAL ) )
  12. #undef CONSOLE_SERIAL
  13. #define CONSOLE_SERIAL ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_LOG )
  14. #endif
  15. struct console_driver serial_console __console_driver;
  16. static void serial_console_init ( void ) {
  17. /* Serial driver initialization should already be done,
  18. * time to enable the serial console. */
  19. serial_console.disabled = 0;
  20. }
  21. struct console_driver serial_console __console_driver = {
  22. .putchar = serial_putc,
  23. .getchar = serial_getc,
  24. .iskey = serial_ischar,
  25. .disabled = 1,
  26. .usage = CONSOLE_SERIAL,
  27. };
  28. /**
  29. * Serial console initialisation function
  30. */
  31. struct init_fn serial_console_init_fn __init_fn ( INIT_CONSOLE ) = {
  32. .initialise = serial_console_init,
  33. };