comparison packages/redboot/current/src/flash.c @ 1679:b548ac5af76c

* src/flash.c (find_free): fix endless loop when removing a collapsed chunk from chunk table. Found by Laurent Gonzalez (fis_load): Fixed a compiler warning.
author asl
date Fri, 25 Jun 2004 15:49:43 +0000
parents 1bf3513602bc
children bbdd4a302a64
comparison
equal deleted inserted replaced
1678:446d9e7e1db7 1679:b548ac5af76c
545 chunks[idx].start += img->size; 545 chunks[idx].start += img->size;
546 if (chunks[idx].start >= chunks[idx].end) { 546 if (chunks[idx].start >= chunks[idx].end) {
547 // This free chunk has collapsed 547 // This free chunk has collapsed
548 while (idx < (num_chunks-1)) { 548 while (idx < (num_chunks-1)) {
549 chunks[idx] = chunks[idx+1]; 549 chunks[idx] = chunks[idx+1];
550 idx++;
550 } 551 }
551 num_chunks--; 552 num_chunks--;
552 } 553 }
553 } else if ((img->flash_base+img->size) == chunks[idx].end) { 554 } else if ((img->flash_base+img->size) == chunks[idx].end) {
554 chunks[idx].end = img->flash_base; 555 chunks[idx].end = img->flash_base;
1074 // When decompressing, leave CRC checking to decompressor 1075 // When decompressing, leave CRC checking to decompressor
1075 if (!decompress && img->file_cksum) { 1076 if (!decompress && img->file_cksum) {
1076 if (cksum != img->file_cksum) { 1077 if (cksum != img->file_cksum) {
1077 diag_printf("** Warning - checksum failure. stored: 0x%08lx, computed: 0x%08lx\n", 1078 diag_printf("** Warning - checksum failure. stored: 0x%08lx, computed: 0x%08lx\n",
1078 img->file_cksum, cksum); 1079 img->file_cksum, cksum);
1079 entry_address = NO_MEMORY; 1080 entry_address = (unsigned long)NO_MEMORY;
1080 } 1081 }
1081 } 1082 }
1082 #endif 1083 #endif
1083 } 1084 }
1084 #endif // CYGOPT_REDBOOT_FIS 1085 #endif // CYGOPT_REDBOOT_FIS