#include <stdint.h>
#endif
-#include "zlib.h"
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#include <watchdog.h>
+#endif
+#include "u-boot/zlib.h"
#define local static
#define ZEXPORT /* empty */
{
uint32_t c;
int n, k;
- uLong poly; /* polynomial exclusive-or pattern */
+ uLong poly; /* polynomial exclusive-or pattern */
/* terms of polynomial defining this crc (except x^32): */
static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
#define DO8(buf) DO4(buf); DO4(buf);
/* ========================================================================= */
-uint32_t ZEXPORT crc32(crc, buf, len)
- uint32_t crc;
- const Bytef *buf;
- uInt len;
+uint32_t ZEXPORT crc32 (uint32_t crc, const Bytef *buf, uInt len)
{
#ifdef DYNAMIC_CRC_TABLE
if (crc_table_empty)
#if defined(CONFIG_CMD_JFFS2) || \
(defined(CONFIG_CMD_NAND) \
- && !defined(CFG_NAND_LEGACY))
+ && !defined(CONFIG_NAND_LEGACY))
/* No ones complement version. JFFS2 (and other things ?)
* don't use ones compliment in their CRC calculations.
* Calculate the crc32 checksum triggering the watchdog every 'chunk_sz' bytes
* of input.
*/
-ulong crc32_wd (ulong crc, const unsigned char *buf, uint len, uint chunk_sz)
+uint32_t ZEXPORT crc32_wd (uint32_t crc,
+ const unsigned char *buf,
+ uInt len, uInt chunk_sz)
{
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
const unsigned char *end, *curr;
WATCHDOG_RESET ();
}
#else
- crc = crc32 (crc, buf, len);
+ crc = crc32 (crc, buf, len);
#endif
return crc;