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 983B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. /*
  18. * Check if serial driver initialization is done.
  19. * If so, it's time to enable the serial console.
  20. */
  21. if ( serial_initialized )
  22. serial_console.disabled = 0;
  23. }
  24. struct console_driver serial_console __console_driver = {
  25. .putchar = serial_putc,
  26. .getchar = serial_getc,
  27. .iskey = serial_ischar,
  28. .disabled = CONSOLE_DISABLED,
  29. .usage = CONSOLE_SERIAL,
  30. };
  31. /**
  32. * Serial console initialisation function
  33. */
  34. struct init_fn serial_console_init_fn __init_fn ( INIT_CONSOLE ) = {
  35. .initialise = serial_console_init,
  36. };