summaryrefslogtreecommitdiff
path: root/tools/envcrc.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2005-08-05 11:22:28 +0200
committerWolfgang Denk <wd@pollux.denx.de>2005-08-05 11:22:28 +0200
commitcbf9c117282b8729bdb86071997b58fcab58c444 (patch)
treeff9175f1d987c49ef8b3b334bffae4f35ca8b759 /tools/envcrc.c
parenta99a0a98b9fcf78ee2ceda893e8d4bd9b11e427a (diff)
parent2c61f14c60ccc5a1c90205991bf555872887a831 (diff)
downloadu-boot-imx-cbf9c117282b8729bdb86071997b58fcab58c444.zip
u-boot-imx-cbf9c117282b8729bdb86071997b58fcab58c444.tar.gz
u-boot-imx-cbf9c117282b8729bdb86071997b58fcab58c444.tar.bz2
Merge with /home/wd/git/u-boot/master
Diffstat (limited to 'tools/envcrc.c')
-rw-r--r--tools/envcrc.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/tools/envcrc.c b/tools/envcrc.c
index 5f13a63..7b77183 100644
--- a/tools/envcrc.c
+++ b/tools/envcrc.c
@@ -25,7 +25,10 @@
#include <stdlib.h>
#include <unistd.h>
-#define __ASSEMBLY__ /* Dirty trick to get only #defines */
+#ifndef __ASSEMBLY__
+#define __ASSEMBLY__ /* Dirty trick to get only #defines */
+#endif
+#define __ASM_STUB_PROCESSOR_H__ /* don't include asm/processor. */
#include <config.h>
#undef __ASSEMBLY__
@@ -73,24 +76,24 @@ extern unsigned char environment;
int main (int argc, char **argv)
{
#ifdef ENV_IS_EMBEDDED
- int crc ;
- unsigned char *envptr = &environment,
- *dataptr = envptr + ENV_HEADER_SIZE;
- unsigned int datasize = ENV_SIZE;
+ int crc;
+ unsigned char *envptr = &environment,
+ *dataptr = envptr + ENV_HEADER_SIZE;
+ unsigned int datasize = ENV_SIZE;
- crc = crc32(0, dataptr, datasize) ;
+ crc = crc32 (0, dataptr, datasize);
- /* Check if verbose mode is activated passing a parameter to the program */
- if (argc > 1) {
- printf("CRC32 from offset %08X to %08X of environment = %08X\n",
- (unsigned int)(dataptr - envptr),
- (unsigned int)(dataptr - envptr) + datasize,
- crc);
- } else {
- printf("0x%08X\n", crc);
- }
+ /* Check if verbose mode is activated passing a parameter to the program */
+ if (argc > 1) {
+ printf ("CRC32 from offset %08X to %08X of environment = %08X\n",
+ (unsigned int) (dataptr - envptr),
+ (unsigned int) (dataptr - envptr) + datasize,
+ crc);
+ } else {
+ printf ("0x%08X\n", crc);
+ }
#else
- printf("0\n");
+ printf ("0\n");
#endif
- return EXIT_SUCCESS;
+ return EXIT_SUCCESS;
}