diff options
author | andrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-05 06:50:09 +0000 |
---|---|---|
committer | andrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-05 06:50:09 +0000 |
commit | f3198cba84f56f85281b87c4e9bf96e77a934f16 (patch) | |
tree | 4c36f2be7f83d05959813b5c051df01da3f1ed9f /BeagleBoardPkg/Tools/generate_image.c | |
parent | 3b9be4164b8714a4d866e822cfacb1ea6da6ef7b (diff) | |
download | edk2-platforms-f3198cba84f56f85281b87c4e9bf96e77a934f16.tar.xz |
Update input of disasmembler to support IfThen construct. Add prototype dos script to build BeagleBoard.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9936 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BeagleBoardPkg/Tools/generate_image.c')
-rw-r--r-- | BeagleBoardPkg/Tools/generate_image.c | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/BeagleBoardPkg/Tools/generate_image.c b/BeagleBoardPkg/Tools/generate_image.c index 9bcd67a187..c1aebfef57 100644 --- a/BeagleBoardPkg/Tools/generate_image.c +++ b/BeagleBoardPkg/Tools/generate_image.c @@ -11,14 +11,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ - #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> -#include <unistd.h> + + //TOC structure as defined by OMAP35XX TRM. typedef struct { @@ -353,53 +353,52 @@ ConstructImage ( fclose(OutputFile); } + int main ( int argc, char** argv ) { - char Ch; + char Ch; unsigned char *ptr; + int i; + int TwoArg; if (argc == 1) { PrintUsage (); exit(1); } - while ((Ch = getopt(argc, argv, "D:E:I:O:")) != -1) { - switch (Ch) { - case 'E': /* Image execution address */ - gImageExecutionAddress = strtoul (optarg, (char **)&ptr, 16); - break; - - case 'I': /* Input image file */ - gInputImageFile = optarg; - break; - - case 'O': /* Output image file */ - gOutputImageFile = optarg; - break; - - case 'D': /* Data file */ - gDataFile = optarg; - break; - - case '?': - if ((optopt == 'E') || (optopt == 'I') || (optopt == 'O')) { - fprintf (stderr, "Option -%c requires an argument.\n", optopt); - } else if (isprint (optopt)) { - fprintf (stderr, "Unknown option `-%c'.\n", optopt); - } else { - fprintf (stderr, "Unknown option character `\\x%x'.\n", optopt); - } - return 1; - - default: - abort (); + for (i=1; i < argc; i++) { + if (argv[i][0] == '-') { + // TwoArg TRUE -E 0x123, FALSE -E0x1234 + TwoArg = (argv[i][2] != ' '); + switch (argv[i][1]) { + case 'E': /* Image execution address */ + gImageExecutionAddress = strtoul (TwoArg ? argv[i+1] : &argv[i][2], (char **)&ptr, 16); + break; + + case 'I': /* Input image file */ + gInputImageFile = TwoArg ? argv[i+1] : &argv[i][2]; + break; + + case 'O': /* Output image file */ + gOutputImageFile = TwoArg ? argv[i+1] : &argv[i][2]; + break; + + case 'D': /* Data file */ + gDataFile = TwoArg ? argv[i+1] : &argv[i][2]; + break; + + default: + abort (); + } + printf ("\n%d(%x) - %s %s", i, TwoArg, argv[i], TwoArg ? argv[i+1] : &argv[i][2]); } } + //Prepare configuration header PrepareConfigurationHeader (); |