iomux.h 950 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2008
  4. * Gary Jennejohn, DENX Software Engineering GmbH, garyj@denx.de.
  5. */
  6. #ifndef _IO_MUX_H
  7. #define _IO_MUX_H
  8. #include <stdio_dev.h>
  9. /*
  10. * Stuff required to support console multiplexing.
  11. */
  12. /*
  13. * Pointers to devices used for each file type. Defined in console.c
  14. * but storage is allocated in iomux.c.
  15. */
  16. extern struct stdio_dev **console_devices[MAX_FILES];
  17. /*
  18. * The count of devices assigned to each FILE. Defined in console.c
  19. * and populated in iomux.c.
  20. */
  21. extern int cd_count[MAX_FILES];
  22. #define for_each_console_dev(i, file, dev) \
  23. for (i = 0; \
  24. i < cd_count[file] && (dev = console_devices[file][i]); \
  25. i++)
  26. int iomux_match_device(struct stdio_dev **, const int, struct stdio_dev *);
  27. int iomux_doenv(const int, const char *);
  28. int iomux_replace_device(const int, const char *, const char *);
  29. void iomux_printdevs(const int);
  30. #endif /* _IO_MUX_H */