s.zalloc = zalloc;
s.zfree = zfree;
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
- s.outcb = (cb_func)WATCHDOG_RESET;
-#else
- s.outcb = Z_NULL;
-#endif /* CONFIG_HW_WATCHDOG */
r = inflateInit2(&s, -MAX_WBITS);
if (r != Z_OK) {
#include <common.h>
#include <compiler.h>
#include <asm/unaligned.h>
+#include <watchdog.h>
#include "u-boot/zlib.h"
#undef OFF /* avoid conflicts */
state->hold = 0;
state->bits = 0;
state->lencode = state->distcode = state->next = state->codes;
- if (strm->outcb != Z_NULL)
- (*strm->outcb)(Z_NULL, 0);
+ WATCHDOG_RESET();
Tracev((stderr, "inflate: reset\n"));
return Z_OK;
}
Tracev((stderr, "inflate: codes ok\n"));
state->mode = LEN;
case LEN:
- if (strm->outcb != Z_NULL) /* for watchdog (U-Boot) */
- (*strm->outcb)(Z_NULL, 0);
+ WATCHDOG_RESET();
if (have >= 6 && left >= 258) {
RESTORE();
inflate_fast(strm, out);
return Z_STREAM_ERROR;
state = (struct inflate_state FAR *)strm->state;
if (state->window != Z_NULL) {
- if (strm->outcb != Z_NULL)
- (*strm->outcb)(Z_NULL, 0);
+ WATCHDOG_RESET();
ZFREE(strm, state->window);
}
ZFREE(strm, strm->state);