xpedite1k: Add support for optional flashes
[pandora-u-boot.git] / lib_generic / bzlib.c
index 8a64b79..5844e18 100644 (file)
@@ -1,5 +1,6 @@
 #include <config.h>
-#ifdef CONFIG_BZIP2
+#include <common.h>
+#include <watchdog.h>
 
 /*
  * This file is a modified version of bzlib.c from the bzip2-1.0.2
@@ -841,6 +842,9 @@ int BZ_API(BZ2_bzDecompress) ( bz_stream *strm )
    if (s->strm != strm) return BZ_PARAM_ERROR;
 
    while (True) {
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+       WATCHDOG_RESET();
+#endif
       if (s->state == BZ_X_IDLE) return BZ_SEQUENCE_ERROR;
       if (s->state == BZ_X_OUTPUT) {
         if (s->smallDecompress)
@@ -1587,9 +1591,11 @@ const char * BZ_API(BZ2_bzerror) (BZFILE *b, int *errnum)
 }
 #endif
 
+void bz_internal_error(int errcode)
+{
+       printf ("BZIP2 internal error %d\n", errcode);
+}
 
 /*-------------------------------------------------------------*/
 /*--- end                                           bzlib.c ---*/
 /*-------------------------------------------------------------*/
-
-#endif /* CONFIG_BZIP2 */