From 2b7dc8dce549ad72ad437b254bf756d7ba4c2a5a Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 28 Nov 2007 10:21:12 -0600 Subject: Add an option to pad the blob that is generated There are times when we need extra space in the blob and just want to have it added on w/o know the exact size to make it. The padding and min size options are mutually exclusive. Signed-off-by: Kumar Gala --- dtc.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'dtc.c') diff --git a/dtc.c b/dtc.c index 5b16e5d..566c904 100644 --- a/dtc.c +++ b/dtc.c @@ -29,6 +29,7 @@ int quiet; /* Level of quietness */ int reservenum; /* Number of memory reservation slots */ int minsize; /* Minimum blob size */ +int padsize; /* Additional padding to blob */ char *join_path(char *path, char *name) { @@ -97,6 +98,8 @@ static void __attribute__ ((noreturn)) usage(void) fprintf(stderr, "\t\tMake space for reserve map entries (relevant for \n\t\tdtb and asm output only)\n"); fprintf(stderr, "\t-S \n"); fprintf(stderr, "\t\tMake the blob at least long (extra space)\n"); + fprintf(stderr, "\t-p \n"); + fprintf(stderr, "\t\tAdd padding to the blob of long (extra space)\n"); fprintf(stderr, "\t-b \n"); fprintf(stderr, "\t\tSet the physical boot cpu\n"); fprintf(stderr, "\t-f\n"); @@ -124,8 +127,9 @@ int main(int argc, char *argv[]) quiet = 0; reservenum = 0; minsize = 0; + padsize = 0; - while ((opt = getopt(argc, argv, "hI:O:o:V:R:S:fcqb:v")) != EOF) { + while ((opt = getopt(argc, argv, "hI:O:o:V:R:S:p:fcqb:v")) != EOF) { switch (opt) { case 'I': inform = optarg; @@ -145,6 +149,9 @@ int main(int argc, char *argv[]) case 'S': minsize = strtol(optarg, NULL, 0); break; + case 'p': + padsize = strtol(optarg, NULL, 0); + break; case 'f': force = 1; break; @@ -173,6 +180,11 @@ int main(int argc, char *argv[]) else arg = argv[optind]; + /* minsize and padsize are mutually exclusive */ + if ((minsize) && (padsize)) { + die("Can't set both -p and -S\n"); + } + fprintf(stderr, "DTC: %s->%s on file \"%s\"\n", inform, outform, arg); -- cgit v1.1