promlib.c 991 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #include <asm/setup.h>
  13. /*
  14. * IP22 boardcache is not compatible with board caches. Thus we disable it
  15. * during romvec action. Since r4xx0.c is always compiled and linked with your
  16. * kernel, this shouldn't cause any harm regardless what MIPS processor you
  17. * have.
  18. *
  19. * The ARC write and read functions seem to interfere with the serial lines
  20. * in some way. You should be careful with them.
  21. */
  22. void prom_putchar(char c)
  23. {
  24. ULONG cnt;
  25. CHAR it = c;
  26. bc_disable();
  27. ArcWrite(1, &it, 1, &cnt);
  28. bc_enable();
  29. }
  30. char prom_getchar(void)
  31. {
  32. ULONG cnt;
  33. CHAR c;
  34. bc_disable();
  35. ArcRead(0, &c, 1, &cnt);
  36. bc_enable();
  37. return c;
  38. }