#include <linux/string.h>
+#include <asm/arch/uncompress.h>
+
#ifdef STANDALONE_DEBUG
#define putstr printf
-#else
-
-static void putstr(const char *ptr);
-
-#include <linux/compiler.h>
-#include <asm/arch/uncompress.h>
+#endif
#ifdef CONFIG_DEBUG_ICEDCC
-static void icedcc_putc(int ch)
-{
- int status, i = 0x4000000;
+#define putstr icedcc_putstr
+#define putc icedcc_putc
- do {
- if (--i < 0)
- return;
+extern void icedcc_putc(int ch);
- asm volatile ("mrc p14, 0, %0, c0, c0, 0" : "=r" (status));
- } while (status & 2);
-
- asm("mcr p14, 0, %0, c1, c0, 0" : : "r" (ch));
-}
-
-#define putc(ch) icedcc_putc(ch)
-#define flush() do { } while (0)
-#endif
-
-static void putstr(const char *ptr)
+static void
+icedcc_putstr(const char *ptr)
{
- char c;
-
- while ((c = *ptr++) != '\0') {
- if (c == '\n')
- putc('\r');
- putc(c);
+ for (; *ptr != '\0'; ptr++) {
+ icedcc_putc(*ptr);
}
-
- flush();
}
#endif