are not defined in the OMAP35x manual and you have to use the OMAP34xx manual
to find the data.
- Copyright (c) 2008-2010, Apple Inc. All rights reserved.
+ Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
- All rights reserved. This program and the accompanying materials
+ This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
FILE *InputFile;
FILE *OutputFile;
unsigned int InputImageFileSize;
- unsigned int NewImageFileSize;
struct stat FileStat;
char Ch;
unsigned int i;
exit(0);
}
- //Get the size of the input image.
+ // Get the size of the input image.
fstat(fileno(InputFile), &FileStat);
InputImageFileSize = FileStat.st_size;
- //Calculate new file size
- NewImageFileSize = InputImageFileSize - 520;
-
OutputFile = fopen(gOutputImageFile, "wb");
if (OutputFile == NULL) {
fprintf(stderr, "Can't open output file %s.\n", gOutputImageFile);
exit(0);
}
- //Write Configuration header
+ // Write Configuration header
fwrite(gConfigurationHeader, 1, sizeof(gConfigurationHeader), OutputFile);
- //Write image header (Input image size, execution address)
- fwrite(&NewImageFileSize, 1, 4, OutputFile);
+ // Write image header (Input image size, execution address)
+ fwrite(&InputImageFileSize, 1, 4, OutputFile);
fwrite(&gImageExecutionAddress, 1, 4, OutputFile);
- //Skip first 0x207 bytes
- fseek(InputFile, 520, SEEK_SET);
-
- //Copy input image to the output file.
- for (i = 0; i < NewImageFileSize; i++) {
+ // Copy input image to the output file.
+ for (i = 0; i < InputImageFileSize; i++) {
fread(&Ch, 1, 1, InputFile);
fwrite(&Ch, 1, 1, OutputFile);
}