]> err.no Git - linux-2.6/blobdiff - arch/arm/boot/compressed/misc.c
[ARM] Fix decompressor serial IO to give CRLF not LFCR
[linux-2.6] / arch / arm / boot / compressed / misc.c
index 50f13eec6cd70cd4c2e0a93233af141027211529..28626ec2d289804646cf61a79a0c2c8f24e0120f 100644 (file)
@@ -20,24 +20,32 @@ unsigned int __machine_arch_type;
 
 #include <linux/string.h>
 
-#include <asm/arch/uncompress.h>
-
 #ifdef STANDALONE_DEBUG
 #define putstr printf
-#endif
+#else
 
-#ifdef CONFIG_DEBUG_ICEDCC
-#define putstr icedcc_putstr
-#define putc icedcc_putc
+static void putstr(const char *ptr);
+
+#include <linux/compiler.h>
+#include <asm/arch/uncompress.h>
 
+#ifdef CONFIG_DEBUG_ICEDCC
 extern void icedcc_putc(int ch);
+#define putc(ch)       icedcc_putc(ch)
+#define flush()        do { } while (0)
+#endif
 
-static void
-icedcc_putstr(const char *ptr)
+static void putstr(const char *ptr)
 {
-       for (; *ptr != '\0'; ptr++) {
-               icedcc_putc(*ptr);
+       char c;
+
+       while ((c = *ptr++) != '\0') {
+               if (c == '\n')
+                       putc('\r');
+               putc(c);
        }
+
+       flush();
 }
 
 #endif
@@ -283,8 +291,14 @@ void flush_window(void)
        putstr(".");
 }
 
+#ifndef arch_error
+#define arch_error(x)
+#endif
+
 static void error(char *x)
 {
+       arch_error(x);
+
        putstr("\n\n");
        putstr(x);
        putstr("\n\n -- System halted");