x86/boot: Extract error reporting functions
[cascardo/linux.git] / arch / x86 / boot / compressed / misc.c
index bee6238..9536d77 100644 (file)
@@ -12,6 +12,7 @@
  */
 
 #include "misc.h"
+#include "error.h"
 #include "../string.h"
 #include "../voffset.h"
 
@@ -36,7 +37,6 @@
 #define memmove                memmove
 
 /* Functions used by the included decompressor code below. */
-static void error(char *m);
 void *memmove(void *dest, const void *src, size_t n);
 
 /*
@@ -169,29 +169,13 @@ void __puthex(unsigned long value)
        }
 }
 
-void warn(char *m)
-{
-       error_putstr("\n\n");
-       error_putstr(m);
-       error_putstr("\n\n");
-}
-
-static void error(char *m)
-{
-       warn(m);
-       error_putstr(" -- System halted");
-
-       while (1)
-               asm("hlt");
-}
-
 #if CONFIG_X86_NEED_RELOCS
 static void handle_relocations(void *output, unsigned long output_len)
 {
        int *reloc;
        unsigned long delta, map, ptr;
        unsigned long min_addr = (unsigned long)output;
-       unsigned long max_addr = min_addr + output_len;
+       unsigned long max_addr = min_addr + (VO___bss_start - VO__text);
 
        /*
         * Calculate the delta between where vmlinux was linked to load