4 * For conditions of distribution and use, see copyright notice in zlib.h
7 -#ifndef USE_HOSTCC /* Shut down "ANSI does not permit..." warnings */
13 #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
15 @@ -136,7 +132,7 @@ local const uint32_t crc_table[256] = {
18 /* =========================================================================
19 - * This function can be used by asm versions of crc32()
20 + * This function can be used by asm versions of uboot_crc32()
22 const uint32_t * ZEXPORT get_crc_table()
24 @@ -154,7 +150,7 @@ const uint32_t * ZEXPORT get_crc_table()
25 #define DO8(buf) DO4(buf); DO4(buf);
27 /* ========================================================================= */
28 -uint32_t ZEXPORT crc32 (uint32_t crc, const Bytef *buf, uInt len)
29 +uint32_t ZEXPORT uboot_crc32 (uint32_t crc, const Bytef *buf, uInt len)
31 #ifdef DYNAMIC_CRC_TABLE
33 @@ -217,12 +213,12 @@ uint32_t ZEXPORT crc32_wd (uint32_t crc,
37 - crc = crc32 (crc, curr, chunk);
38 + crc = uboot_crc32 (crc, curr, chunk);
43 - crc = crc32 (crc, buf, len);
44 + crc = uboot_crc32 (crc, buf, len);
50 @@ -216,9 +216,9 @@ static int parse_config (void);
51 #if defined(CONFIG_FILE)
52 static int get_config (char *);
54 -static inline ulong getenvsize (void)
55 +static inline uint32_t getenvsize (void)
57 - ulong rc = CONFIG_ENV_SIZE - sizeof (long);
58 + uint32_t rc = CONFIG_ENV_SIZE - sizeof (uint32_t);
62 @@ -437,7 +437,7 @@ int fw_setenv (int argc, char *argv[])
66 - *environment.crc = crc32 (0, (uint8_t *) environment.data, ENV_SIZE);
67 + *environment.crc = uboot_crc32 (0, (uint8_t *) environment.data, ENV_SIZE);
69 /* write environment back to flash */
70 if (flash_io (O_RDWR)) {
71 @@ -627,7 +627,7 @@ static int flash_write_buf (int dev, int
72 data = malloc (erase_len);
75 - "Cannot malloc %u bytes: %s\n",
76 + "Cannot malloc %zu bytes: %s\n",
77 erase_len, strerror (errno));
80 @@ -883,11 +883,11 @@ static char *envmatch (char * s1, char *
81 static int env_init (void)
85 + unsigned char flag0;
90 + unsigned char flag1;
93 struct env_image_single *single;
94 @@ -923,7 +923,7 @@ static int env_init (void)
95 if (flash_io (O_RDONLY))
98 - crc0 = crc32 (0, (uint8_t *) environment.data, ENV_SIZE);
99 + crc0 = uboot_crc32 (0, (uint8_t *) environment.data, ENV_SIZE);
100 crc0_ok = (crc0 == *environment.crc);
101 if (!HaveRedundEnv) {
103 @@ -964,7 +964,7 @@ static int env_init (void)
107 - crc1 = crc32 (0, (uint8_t *) redundant->data, ENV_SIZE);
108 + crc1 = uboot_crc32 (0, (uint8_t *) redundant->data, ENV_SIZE);
109 crc1_ok = (crc1 == redundant->crc);
110 flag1 = redundant->flags;
115 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; " \
118 +# include <stdint.h>
120 extern int fw_printenv(int argc, char *argv[]);
121 extern char *fw_getenv (char *name);
122 extern int fw_setenv (int argc, char *argv[]);
124 -extern unsigned long crc32 (unsigned long, const unsigned char *, unsigned);
125 +extern uint32_t uboot_crc32 (uint32_t, const unsigned char *, unsigned);