/arch/unicore32/include/mach/ocd.h

http://github.com/mirrors/linux · C Header · 33 lines · 18 code · 7 blank · 8 comment · 2 complexity · d2a1f2507b42cb0c13dd3fc41236f6b1 MD5 · raw file

  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * linux/arch/unicore32/include/mach/ocd.h
  4. *
  5. * Code specific to PKUnity SoC and UniCore ISA
  6. *
  7. * Copyright (C) 2001-2010 GUAN Xue-tao
  8. */
  9. #ifndef __MACH_PUV3_OCD_H__
  10. #define __MACH_PUV3_OCD_H__
  11. #if defined(CONFIG_DEBUG_OCD)
  12. static inline void ocd_putc(unsigned int c)
  13. {
  14. int status, i = 0x2000000;
  15. do {
  16. if (--i < 0)
  17. return;
  18. asm volatile ("movc %0, p1.c0, #0" : "=r" (status));
  19. } while (status & 2);
  20. asm("movc p1.c1, %0, #1" : : "r" (c));
  21. }
  22. #define putc(ch) ocd_putc(ch)
  23. #else
  24. #define putc(ch)
  25. #endif
  26. #endif