console.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2000-2009
  4. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  5. */
  6. #ifndef __CONSOLE_H
  7. #define __CONSOLE_H
  8. extern char console_buffer[];
  9. /* common/console.c */
  10. int console_init_f(void); /* Before relocation; uses the serial stuff */
  11. int console_init_r(void); /* After relocation; uses the console stuff */
  12. int console_assign(int file, const char *devname); /* Assign the console */
  13. int ctrlc(void);
  14. int had_ctrlc(void); /* have we had a Control-C since last clear? */
  15. void clear_ctrlc(void); /* clear the Control-C condition */
  16. int disable_ctrlc(int); /* 1 to disable, 0 to enable Control-C detect */
  17. int confirm_yesno(void); /* 1 if input is "y", "Y", "yes" or "YES" */
  18. /**
  19. * console_record_init() - set up the console recording buffers
  20. *
  21. * This should be called as soon as malloc() is available so that the maximum
  22. * amount of console output can be recorded.
  23. */
  24. int console_record_init(void);
  25. /**
  26. * console_record_reset() - reset the console recording buffers
  27. *
  28. * Removes any data in the buffers
  29. */
  30. void console_record_reset(void);
  31. /**
  32. * console_record_reset_enable() - reset and enable the console buffers
  33. *
  34. * This should be called to enable the console buffer.
  35. */
  36. void console_record_reset_enable(void);
  37. /**
  38. * console_announce_r() - print a U-Boot console on non-serial consoles
  39. *
  40. * When U-Boot starts up with a display it generally does not announce itself
  41. * on the display. The banner is instead emitted on the UART before relocation.
  42. * This function prints a banner on devices which (we assume) did not receive
  43. * it before relocation.
  44. *
  45. * @return 0 (meaning no errors)
  46. */
  47. int console_announce_r(void);
  48. /*
  49. * CONSOLE multiplexing.
  50. */
  51. #ifdef CONFIG_CONSOLE_MUX
  52. #include <iomux.h>
  53. #endif
  54. #endif