From: Al Stone ahs3@redhat.com
These are mostly minor fixups to mab: -- report usage properly -- do not segfault if missing the -p <paddr> parameter -- if the XSDT did not have enough room for tables, it would not discover that or notify anyone unless it was being verbose; now it will always report that error if found -- and just because it wasn't verbose enough, add the final relocated address of the table to the output -- update the version number
Al Stone (5): mab: minor cleanup of usage output mab: if -p <paddr> is not given, we would segfault; die more gracefully now mab: update version number mab: report an XSDT error regardless of whether we're verbose or not mab: add final relocated address to verbose output
tools/mab/mab.c | 52 ++++++++++++++++++++++++++++++++++++---------------- tools/mab/mab.h | 4 +++- 2 files changed, 39 insertions(+), 17 deletions(-)
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org --- tools/mab/mab.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/mab/mab.c b/tools/mab/mab.c index 4208b9d..6c5857b 100644 --- a/tools/mab/mab.c +++ b/tools/mab/mab.c @@ -32,13 +32,13 @@ void usage(void) { printf("%s %s\n", PROGNAME, VERSION); printf("usage: %s -d <dir> -o <blob> -i <manifest> ", PROGNAME); - printf("[-c <iasl-cmd>] [-q]\n"); + printf("-p <paddr> [-c <iasl-cmd>] [-q]\n"); printf("\n"); printf(" -d <dir> => directory of ASL files\n"); printf(" -o <blob> => file name for resulting ACPI blob\n"); printf(" -i <manifest> => list of AML files needed\n"); printf(" -c <iasl-cmd> => iasl command to use (default: iasl -l)\n"); - printf(" -p <paddr> => physical address to relocate to.\n"); + printf(" -p <paddr> => physical address to relocate to\n"); printf(" -q => if given, supress output\n"); }
Ah yes, another obvious oversite on my part.
Acked-by: Graeme Gregory graeme.gregory@linaro.org
On 13/08/13 00:10, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org
tools/mab/mab.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/mab/mab.c b/tools/mab/mab.c index 4208b9d..6c5857b 100644 --- a/tools/mab/mab.c +++ b/tools/mab/mab.c @@ -32,13 +32,13 @@ void usage(void) { printf("%s %s\n", PROGNAME, VERSION); printf("usage: %s -d <dir> -o <blob> -i <manifest> ", PROGNAME);
- printf("[-c <iasl-cmd>] [-q]\n");
- printf("-p <paddr> [-c <iasl-cmd>] [-q]\n"); printf("\n"); printf(" -d <dir> => directory of ASL files\n"); printf(" -o <blob> => file name for resulting ACPI blob\n"); printf(" -i <manifest> => list of AML files needed\n"); printf(" -c <iasl-cmd> => iasl command to use (default: iasl -l)\n");
- printf(" -p <paddr> => physical address to relocate to.\n");
- printf(" -p <paddr> => physical address to relocate to\n"); printf(" -q => if given, supress output\n"); }
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org --- tools/mab/mab.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/tools/mab/mab.c b/tools/mab/mab.c index 6c5857b..f906efb 100644 --- a/tools/mab/mab.c +++ b/tools/mab/mab.c @@ -468,6 +468,7 @@ int main(int argc, char *argv[]) homedir = NULL; acpi_blob_name = NULL; iasl_cmd = NULL; + paddr_cmd = NULL; quiet = 0;
while ((opt = getopt(argc, argv, "d:o:i:c:p:q")) != EOF) { @@ -517,6 +518,10 @@ int main(int argc, char *argv[]) printf("relocating blob to 0x%llx\n", paddr); } paddr += BLOB_HEADER_SIZE; + } else { + printf("? missing required physical address parameter\n"); + usage(); + return 1; }
/* what tables do we need to do something about? */
Curses, sometimes I forget I'm not using a scripting language.
Acked-by: Graeme Gregory graeme.gregory@linaro.org
On 13/08/13 00:10, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org
tools/mab/mab.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/tools/mab/mab.c b/tools/mab/mab.c index 6c5857b..f906efb 100644 --- a/tools/mab/mab.c +++ b/tools/mab/mab.c @@ -468,6 +468,7 @@ int main(int argc, char *argv[]) homedir = NULL; acpi_blob_name = NULL; iasl_cmd = NULL;
- paddr_cmd = NULL; quiet = 0;
while ((opt = getopt(argc, argv, "d:o:i:c:p:q")) != EOF) { @@ -517,6 +518,10 @@ int main(int argc, char *argv[]) printf("relocating blob to 0x%llx\n", paddr); } paddr += BLOB_HEADER_SIZE;
- } else {
printf("? missing required physical address parameter\n");
usage();
}return 1;
/* what tables do we need to do something about? */
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org --- tools/mab/mab.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/mab/mab.h b/tools/mab/mab.h index 2af20a4..8b0a676 100644 --- a/tools/mab/mab.h +++ b/tools/mab/mab.h @@ -26,7 +26,8 @@ #define REQUIRED 1 #define SIG_LENGTH 4
-const char VERSION[] = { "0.27.2" }; +/* VERSION a.b.c = <public release>.<functionality changes>.<bug fixes> */ +const char VERSION[] = { "0.28.3" }; const char PROGNAME[] = { "mab" };
char *known_sigs[] = {
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org --- tools/mab/mab.c | 19 +++++++++++-------- tools/mab/mab.h | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/tools/mab/mab.c b/tools/mab/mab.c index f906efb..3107088 100644 --- a/tools/mab/mab.c +++ b/tools/mab/mab.c @@ -579,16 +579,19 @@ int main(int argc, char *argv[]) /* all done, so write out the blob */ write_blob(homedir, acpi_blob_name, blob, offset + BLOB_HEADER_SIZE);
+ /* make sure we had room for all of the tables */ + LIST_FOREACH(np, &thead, tables) { + if (np->offset < 0) { + for (jj = 0; jj < SIG_LENGTH; jj++) + sig[jj] = toupper(np->signature[jj]); + printf("? no room in XSDT for %s (%4s)\n", + basename(np->asl_name), sig); + err = 2; /* anything non-zero, really... */ + } + } + if (!quiet) { printf("%s %s\n", PROGNAME, VERSION); - LIST_FOREACH(np, &thead, tables) { - if (np->offset < 0) { - for (jj = 0; jj < SIG_LENGTH; jj++) - sig[jj] = toupper(np->signature[jj]); - printf("? no room in XSDT for %s (%4s)\n", - basename(np->asl_name), sig); - } - } ii = 0; LIST_FOREACH(np, &thead, tables) { printf("[%03d] %4s : %s (%d bytes @ 0x%08x)\n", ii, diff --git a/tools/mab/mab.h b/tools/mab/mab.h index 8b0a676..3db3d11 100644 --- a/tools/mab/mab.h +++ b/tools/mab/mab.h @@ -27,7 +27,7 @@ #define SIG_LENGTH 4
/* VERSION a.b.c = <public release>.<functionality changes>.<bug fixes> */ -const char VERSION[] = { "0.28.3" }; +const char VERSION[] = { "0.28.4" }; const char PROGNAME[] = { "mab" };
char *known_sigs[] = {
On 13/08/13 00:10, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org
tools/mab/mab.c | 19 +++++++++++-------- tools/mab/mab.h | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/tools/mab/mab.c b/tools/mab/mab.c index f906efb..3107088 100644 --- a/tools/mab/mab.c +++ b/tools/mab/mab.c @@ -579,16 +579,19 @@ int main(int argc, char *argv[]) /* all done, so write out the blob */ write_blob(homedir, acpi_blob_name, blob, offset + BLOB_HEADER_SIZE);
- /* make sure we had room for all of the tables */
- LIST_FOREACH(np, &thead, tables) {
if (np->offset < 0) {
for (jj = 0; jj < SIG_LENGTH; jj++)
sig[jj] = toupper(np->signature[jj]);
printf("? no room in XSDT for %s (%4s)\n",
basename(np->asl_name), sig);
err = 2; /* anything non-zero, really... */
}
- }
- if (!quiet) { printf("%s %s\n", PROGNAME, VERSION);
LIST_FOREACH(np, &thead, tables) {
if (np->offset < 0) {
for (jj = 0; jj < SIG_LENGTH; jj++)
sig[jj] = toupper(np->signature[jj]);
printf("? no room in XSDT for %s (%4s)\n",
basename(np->asl_name), sig);
}
ii = 0; LIST_FOREACH(np, &thead, tables) { printf("[%03d] %4s : %s (%d bytes @ 0x%08x)\n", ii,}
diff --git a/tools/mab/mab.h b/tools/mab/mab.h index 8b0a676..3db3d11 100644 --- a/tools/mab/mab.h +++ b/tools/mab/mab.h @@ -27,7 +27,7 @@ #define SIG_LENGTH 4 /* VERSION a.b.c = <public release>.<functionality changes>.<bug fixes> */ -const char VERSION[] = { "0.28.3" }; +const char VERSION[] = { "0.28.4" }; const char PROGNAME[] = { "mab" }; char *known_sigs[] = {
Is the version change here unintended?
Seems odd that previous patch was explicit in updating it.
Graeme
On 08/13/2013 08:04 AM, Graeme Gregory wrote:
On 13/08/13 00:10, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org
tools/mab/mab.c | 19 +++++++++++-------- tools/mab/mab.h | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/tools/mab/mab.c b/tools/mab/mab.c index f906efb..3107088 100644 --- a/tools/mab/mab.c +++ b/tools/mab/mab.c @@ -579,16 +579,19 @@ int main(int argc, char *argv[]) /* all done, so write out the blob */ write_blob(homedir, acpi_blob_name, blob, offset + BLOB_HEADER_SIZE);
- /* make sure we had room for all of the tables */
- LIST_FOREACH(np, &thead, tables) {
if (np->offset < 0) {
for (jj = 0; jj < SIG_LENGTH; jj++)
sig[jj] = toupper(np->signature[jj]);
printf("? no room in XSDT for %s (%4s)\n",
basename(np->asl_name), sig);
err = 2; /* anything non-zero, really... */
}
- }
if (!quiet) { printf("%s %s\n", PROGNAME, VERSION);
LIST_FOREACH(np, &thead, tables) {
if (np->offset < 0) {
for (jj = 0; jj < SIG_LENGTH; jj++)
sig[jj] = toupper(np->signature[jj]);
printf("? no room in XSDT for %s (%4s)\n",
basename(np->asl_name), sig);
}
} ii = 0; LIST_FOREACH(np, &thead, tables) { printf("[%03d] %4s : %s (%d bytes @ 0x%08x)\n", ii,
diff --git a/tools/mab/mab.h b/tools/mab/mab.h index 8b0a676..3db3d11 100644 --- a/tools/mab/mab.h +++ b/tools/mab/mab.h @@ -27,7 +27,7 @@ #define SIG_LENGTH 4 /* VERSION a.b.c = <public release>.<functionality changes>.<bug fixes> */ -const char VERSION[] = { "0.28.3" }; +const char VERSION[] = { "0.28.4" }; const char PROGNAME[] = { "mab" }; char *known_sigs[] = {
Is the version change here unintended?
Seems odd that previous patch was explicit in updating it.
Ah -- no, just sloppy on my part; I'm not being terribly consistent in how I do this :/... I can separate these out if it would make more sense.
On 13/08/13 15:51, Al Stone wrote:
On 08/13/2013 08:04 AM, Graeme Gregory wrote:
On 13/08/13 00:10, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org
tools/mab/mab.c | 19 +++++++++++-------- tools/mab/mab.h | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/tools/mab/mab.c b/tools/mab/mab.c index f906efb..3107088 100644 --- a/tools/mab/mab.c +++ b/tools/mab/mab.c @@ -579,16 +579,19 @@ int main(int argc, char *argv[]) /* all done, so write out the blob */ write_blob(homedir, acpi_blob_name, blob, offset + BLOB_HEADER_SIZE);
- /* make sure we had room for all of the tables */
- LIST_FOREACH(np, &thead, tables) {
if (np->offset < 0) {
for (jj = 0; jj < SIG_LENGTH; jj++)
sig[jj] = toupper(np->signature[jj]);
printf("? no room in XSDT for %s (%4s)\n",
basename(np->asl_name), sig);
err = 2; /* anything non-zero, really... */
}
- }
if (!quiet) { printf("%s %s\n", PROGNAME, VERSION);
LIST_FOREACH(np, &thead, tables) {
if (np->offset < 0) {
for (jj = 0; jj < SIG_LENGTH; jj++)
sig[jj] = toupper(np->signature[jj]);
printf("? no room in XSDT for %s (%4s)\n",
basename(np->asl_name), sig);
}
} ii = 0; LIST_FOREACH(np, &thead, tables) { printf("[%03d] %4s : %s (%d bytes @ 0x%08x)\n", ii,
diff --git a/tools/mab/mab.h b/tools/mab/mab.h index 8b0a676..3db3d11 100644 --- a/tools/mab/mab.h +++ b/tools/mab/mab.h @@ -27,7 +27,7 @@ #define SIG_LENGTH 4 /* VERSION a.b.c = <public release>.<functionality changes>.<bug fixes> */ -const char VERSION[] = { "0.28.3" }; +const char VERSION[] = { "0.28.4" }; const char PROGNAME[] = { "mab" }; char *known_sigs[] = {
Is the version change here unintended?
Seems odd that previous patch was explicit in updating it.
Ah -- no, just sloppy on my part; I'm not being terribly consistent in how I do this :/... I can separate these out if it would make more sense.
Probably best to just bump the revision at the end of a series I guess.
Graeme
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org --- tools/mab/mab.c | 24 ++++++++++++++++++------ tools/mab/mab.h | 3 ++- 2 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/tools/mab/mab.c b/tools/mab/mab.c index 3107088..0480f95 100644 --- a/tools/mab/mab.c +++ b/tools/mab/mab.c @@ -121,6 +121,7 @@ struct table *build_table_entry(char *dir, char *buf)
tmp->file_size = -1; /* need to build .aml file first */ tmp->offset = -1; + tmp->paddr = -1; }
return tmp; @@ -295,17 +296,20 @@ void fixup_rsdp(unsigned char *blob, uint64_t paddr) rsdpp->offset + RSDT_ADDR_OFFSET); ltmp = (uint64_t *)(blob + BLOB_HEADER_SIZE + rsdpp->offset + XSDT_ADDR_OFFSET); + rsdpp->paddr = rsdpp->offset + paddr - BLOB_HEADER_SIZE;
p = find_table("xsdt"); - if (p) + if (p) { *ltmp = p->offset + paddr; - else + p->paddr = p->offset + paddr - BLOB_HEADER_SIZE; + } else *ltmp = (uint64_t)0;
p = find_table("rsdt"); - if (p) + if (p) { *stmp = p->offset + paddr; - else + p->paddr = p->offset + paddr - BLOB_HEADER_SIZE; + } else *stmp = (uint64_t)0;
/* always reset the checksum, even if it is seldom used */ @@ -330,6 +334,7 @@ void fixup_facp(unsigned char *blob, int *offset, uint64_t paddr) uint8_t *pcksum;
facpp = find_table("facp"); + facpp->paddr = facpp->offset + paddr - BLOB_HEADER_SIZE;
/* add in the DSDT and X_DSDT addresses */ stmp = (uint32_t *)(blob + BLOB_HEADER_SIZE + @@ -340,6 +345,7 @@ void fixup_facp(unsigned char *blob, int *offset, uint64_t paddr) if (p) { *stmp = (uint32_t)p->offset + paddr; *ltmp = (uint64_t)p->offset + paddr; + p->paddr = p->offset + paddr - BLOB_HEADER_SIZE; } else { *stmp = (uint32_t)0; *ltmp = (uint64_t)0; @@ -355,6 +361,7 @@ void fixup_facp(unsigned char *blob, int *offset, uint64_t paddr) if (p) { *stmp = (uint32_t)p->offset + paddr; *ltmp = (uint64_t)p->offset + paddr; + p->paddr = p->offset + paddr - BLOB_HEADER_SIZE; } else { *stmp = (uint32_t)0; *ltmp = (uint64_t)0; @@ -382,14 +389,17 @@ void fixup_xsdt(unsigned char **blob, int *offset, uint64_t paddr) int allowed;
xsdtp = find_table("xsdt"); + xsdtp->paddr = xsdtp->offset + paddr - BLOB_HEADER_SIZE; tmp = (uint64_t *)(*blob + BLOB_HEADER_SIZE + xsdtp->offset + FACP_ADDR_OFFSET); allowed = (xsdtp->file_size - XSDT_HEADER_SIZE) / sizeof(uint64_t);
/* first table must be FACP (aka FADT) */ p = find_table("facp"); - if (p) + if (p) { *tmp = p->offset + paddr; + p->paddr = p->offset + paddr - BLOB_HEADER_SIZE; + } else { *tmp = (uint64_t)0; return; @@ -407,6 +417,7 @@ void fixup_xsdt(unsigned char **blob, int *offset, uint64_t paddr) *offset, NOT_REQUIRED); *offset += delta; *tmp++ = p->offset + paddr; + p->paddr = p->offset + paddr - BLOB_HEADER_SIZE; allowed--; if (allowed < 1) break; @@ -594,9 +605,10 @@ int main(int argc, char *argv[]) printf("%s %s\n", PROGNAME, VERSION); ii = 0; LIST_FOREACH(np, &thead, tables) { - printf("[%03d] %4s : %s (%d bytes @ 0x%08x)\n", ii, + printf("[%03d] %4s : %s (%d bytes @ 0x%08x)", ii, np->signature, basename(np->aml_name), np->file_size, np->offset); + printf(" [reloc: 0x%016llx]\n", np->paddr); ii++; } } diff --git a/tools/mab/mab.h b/tools/mab/mab.h index 3db3d11..99ef9e7 100644 --- a/tools/mab/mab.h +++ b/tools/mab/mab.h @@ -27,7 +27,7 @@ #define SIG_LENGTH 4
/* VERSION a.b.c = <public release>.<functionality changes>.<bug fixes> */ -const char VERSION[] = { "0.28.4" }; +const char VERSION[] = { "0.29.1" }; const char PROGNAME[] = { "mab" };
char *known_sigs[] = { @@ -70,6 +70,7 @@ struct table { char *aml_name; /* corresponding AML name */ int file_size; /* aka table size */ int offset; /* location in the blob */ + uint64_t paddr; /* physical address */ LIST_ENTRY(table) tables; };
[023] rsdp : rsdp.aml (36 bytes @ 0x00000000) [reloc: 0x0000000042010000]
This is certainly wrong, I suspect somewhere in here you missed a BLOB_HEADER_SIZE.
I guess all these addresses might be out by 8 bytes?
Graeme
On 13/08/13 00:10, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org
tools/mab/mab.c | 24 ++++++++++++++++++------ tools/mab/mab.h | 3 ++- 2 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/tools/mab/mab.c b/tools/mab/mab.c index 3107088..0480f95 100644 --- a/tools/mab/mab.c +++ b/tools/mab/mab.c @@ -121,6 +121,7 @@ struct table *build_table_entry(char *dir, char *buf) tmp->file_size = -1; /* need to build .aml file first */ tmp->offset = -1;
}tmp->paddr = -1;
return tmp; @@ -295,17 +296,20 @@ void fixup_rsdp(unsigned char *blob, uint64_t paddr) rsdpp->offset + RSDT_ADDR_OFFSET); ltmp = (uint64_t *)(blob + BLOB_HEADER_SIZE + rsdpp->offset + XSDT_ADDR_OFFSET);
- rsdpp->paddr = rsdpp->offset + paddr - BLOB_HEADER_SIZE;
p = find_table("xsdt");
- if (p)
- if (p) { *ltmp = p->offset + paddr;
- else
p->paddr = p->offset + paddr - BLOB_HEADER_SIZE;
- } else *ltmp = (uint64_t)0;
p = find_table("rsdt");
- if (p)
- if (p) { *stmp = p->offset + paddr;
- else
p->paddr = p->offset + paddr - BLOB_HEADER_SIZE;
- } else *stmp = (uint64_t)0;
/* always reset the checksum, even if it is seldom used */ @@ -330,6 +334,7 @@ void fixup_facp(unsigned char *blob, int *offset, uint64_t paddr) uint8_t *pcksum; facpp = find_table("facp");
- facpp->paddr = facpp->offset + paddr - BLOB_HEADER_SIZE;
/* add in the DSDT and X_DSDT addresses */ stmp = (uint32_t *)(blob + BLOB_HEADER_SIZE + @@ -340,6 +345,7 @@ void fixup_facp(unsigned char *blob, int *offset, uint64_t paddr) if (p) { *stmp = (uint32_t)p->offset + paddr; *ltmp = (uint64_t)p->offset + paddr;
} else { *stmp = (uint32_t)0; *ltmp = (uint64_t)0;p->paddr = p->offset + paddr - BLOB_HEADER_SIZE;
@@ -355,6 +361,7 @@ void fixup_facp(unsigned char *blob, int *offset, uint64_t paddr) if (p) { *stmp = (uint32_t)p->offset + paddr; *ltmp = (uint64_t)p->offset + paddr;
} else { *stmp = (uint32_t)0; *ltmp = (uint64_t)0;p->paddr = p->offset + paddr - BLOB_HEADER_SIZE;
@@ -382,14 +389,17 @@ void fixup_xsdt(unsigned char **blob, int *offset, uint64_t paddr) int allowed; xsdtp = find_table("xsdt");
- xsdtp->paddr = xsdtp->offset + paddr - BLOB_HEADER_SIZE; tmp = (uint64_t *)(*blob + BLOB_HEADER_SIZE + xsdtp->offset + FACP_ADDR_OFFSET); allowed = (xsdtp->file_size - XSDT_HEADER_SIZE) / sizeof(uint64_t);
/* first table must be FACP (aka FADT) */ p = find_table("facp");
- if (p)
- if (p) { *tmp = p->offset + paddr;
p->paddr = p->offset + paddr - BLOB_HEADER_SIZE;
- } else { *tmp = (uint64_t)0; return;
@@ -407,6 +417,7 @@ void fixup_xsdt(unsigned char **blob, int *offset, uint64_t paddr) *offset, NOT_REQUIRED); *offset += delta; *tmp++ = p->offset + paddr;
p->paddr = p->offset + paddr - BLOB_HEADER_SIZE; allowed--; if (allowed < 1) break;
@@ -594,9 +605,10 @@ int main(int argc, char *argv[]) printf("%s %s\n", PROGNAME, VERSION); ii = 0; LIST_FOREACH(np, &thead, tables) {
printf("[%03d] %4s : %s (%d bytes @ 0x%08x)\n", ii,
printf("[%03d] %4s : %s (%d bytes @ 0x%08x)", ii, np->signature, basename(np->aml_name), np->file_size, np->offset);
} }printf(" [reloc: 0x%016llx]\n", np->paddr); ii++;
diff --git a/tools/mab/mab.h b/tools/mab/mab.h index 3db3d11..99ef9e7 100644 --- a/tools/mab/mab.h +++ b/tools/mab/mab.h @@ -27,7 +27,7 @@ #define SIG_LENGTH 4 /* VERSION a.b.c = <public release>.<functionality changes>.<bug fixes> */ -const char VERSION[] = { "0.28.4" }; +const char VERSION[] = { "0.29.1" }; const char PROGNAME[] = { "mab" }; char *known_sigs[] = { @@ -70,6 +70,7 @@ struct table { char *aml_name; /* corresponding AML name */ int file_size; /* aka table size */ int offset; /* location in the blob */
- uint64_t paddr; /* physical address */ LIST_ENTRY(table) tables; };
On 08/13/2013 08:03 AM, Graeme Gregory wrote:
[023] rsdp : rsdp.aml (36 bytes @ 0x00000000) [reloc: 0x0000000042010000]
This is certainly wrong, I suspect somewhere in here you missed a BLOB_HEADER_SIZE.
I guess all these addresses might be out by 8 bytes?
Graeme
Oh, bugger. That's a really stupid thinko on my part.
I intentionally subtracted the BLOB_HEADER_SIZE from everything which is patently wrong. I'll redo this without subtracting that value.
On 13/08/13 00:10, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org
tools/mab/mab.c | 24 ++++++++++++++++++------ tools/mab/mab.h | 3 ++- 2 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/tools/mab/mab.c b/tools/mab/mab.c index 3107088..0480f95 100644 --- a/tools/mab/mab.c +++ b/tools/mab/mab.c @@ -121,6 +121,7 @@ struct table *build_table_entry(char *dir, char *buf) tmp->file_size = -1; /* need to build .aml file first */ tmp->offset = -1;
tmp->paddr = -1; } return tmp;
@@ -295,17 +296,20 @@ void fixup_rsdp(unsigned char *blob, uint64_t paddr) rsdpp->offset + RSDT_ADDR_OFFSET); ltmp = (uint64_t *)(blob + BLOB_HEADER_SIZE + rsdpp->offset + XSDT_ADDR_OFFSET);
- rsdpp->paddr = rsdpp->offset + paddr - BLOB_HEADER_SIZE; p = find_table("xsdt");
E.g., in the line above; the BLOB_HEADER_SIZE should _not_ be subtracted....
I applied patches 1 & 2, pending questions on 3 - 5
Thanks
Graeme
On 13/08/13 00:10, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
These are mostly minor fixups to mab: -- report usage properly -- do not segfault if missing the -p <paddr> parameter -- if the XSDT did not have enough room for tables, it would not discover that or notify anyone unless it was being verbose; now it will always report that error if found -- and just because it wasn't verbose enough, add the final relocated address of the table to the output -- update the version number
Al Stone (5): mab: minor cleanup of usage output mab: if -p <paddr> is not given, we would segfault; die more gracefully now mab: update version number mab: report an XSDT error regardless of whether we're verbose or not mab: add final relocated address to verbose output
tools/mab/mab.c | 52 ++++++++++++++++++++++++++++++++++++---------------- tools/mab/mab.h | 4 +++- 2 files changed, 39 insertions(+), 17 deletions(-)
On 08/13/2013 08:09 AM, Graeme Gregory wrote:
I applied patches 1 & 2, pending questions on 3 - 5
Thanks
Graeme
On 13/08/13 00:10, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
These are mostly minor fixups to mab: -- report usage properly -- do not segfault if missing the -p <paddr> parameter -- if the XSDT did not have enough room for tables, it would not discover that or notify anyone unless it was being verbose; now it will always report that error if found -- and just because it wasn't verbose enough, add the final relocated address of the table to the output -- update the version number
Al Stone (5): mab: minor cleanup of usage output mab: if -p <paddr> is not given, we would segfault; die more gracefully now mab: update version number mab: report an XSDT error regardless of whether we're verbose or not mab: add final relocated address to verbose output
tools/mab/mab.c | 52 ++++++++++++++++++++++++++++++++++++---------------- tools/mab/mab.h | 4 +++- 2 files changed, 39 insertions(+), 17 deletions(-)
Ack -- 3-5 need to be redone and resubmitted as a new patch series. I'm on it.