promlib.c 968 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1996 David S. Miller (dm@sgi.com)
  7. * Compatibility with board caches, Ulf Carlsson
  8. */
  9. #include <linux/kernel.h>
  10. #include <asm/sgialib.h>
  11. #include <asm/bcache.h>
  12. /*
  13. * IP22 boardcache is not compatible with board caches. Thus we disable it
  14. * during romvec action. Since r4xx0.c is always compiled and linked with your
  15. * kernel, this shouldn't cause any harm regardless what MIPS processor you
  16. * have.
  17. *
  18. * The ARC write and read functions seem to interfere with the serial lines
  19. * in some way. You should be careful with them.
  20. */
  21. void prom_putchar(char c)
  22. {
  23. ULONG cnt;
  24. CHAR it = c;
  25. bc_disable();
  26. ArcWrite(1, &it, 1, &cnt);
  27. bc_enable();
  28. }
  29. char prom_getchar(void)
  30. {
  31. ULONG cnt;
  32. CHAR c;
  33. bc_disable();
  34. ArcRead(0, &c, 1, &cnt);
  35. bc_enable();
  36. return c;
  37. }