j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Don't trace the buffer length in place of the property size.
Signed-off-by: Andreas Färber andreas.faerber@web.de --- libopenbios/client.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libopenbios/client.c b/libopenbios/client.c index 16e4323..2b78dcc 100644 --- a/libopenbios/client.c +++ b/libopenbios/client.c @@ -170,7 +170,7 @@ static void dump_return(prom_args_t *pb) } else if (strcmp(pb->service, "getproplen") == 0) { printk("0x%08lx\n", pb->args[pb->nargs]); } else if (strcmp(pb->service, "getprop") == 0) { - printk("%ld\n", pb->args[3]); + printk("%ld\n", pb->args[pb->nargs]); memdump((char*)pb->args[2], pb->args[3]); } else if (strcmp(pb->service, "nextprop") == 0) { printk("%ld\n", pb->args[pb->nargs]);
Currently the whole buffer supplied by the client is traced. AIX uses buffer sizes such as 64, 256, 1024 on properties that might not exist or contain 1 or 8 bytes.
Limit the output to the amount of data actually written into the buffer.
Signed-off-by: Andreas Färber andreas.faerber@web.de --- libopenbios/client.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libopenbios/client.c b/libopenbios/client.c index 2b78dcc..a93d8a3 100644 --- a/libopenbios/client.c +++ b/libopenbios/client.c @@ -171,7 +171,8 @@ static void dump_return(prom_args_t *pb) printk("0x%08lx\n", pb->args[pb->nargs]); } else if (strcmp(pb->service, "getprop") == 0) { printk("%ld\n", pb->args[pb->nargs]); - memdump((char*)pb->args[2], pb->args[3]); + if ((long)pb->args[pb->nargs] != -1) + memdump((char*)pb->args[2], MIN(pb->args[3], pb->args[pb->nargs])); } else if (strcmp(pb->service, "nextprop") == 0) { printk("%ld\n", pb->args[pb->nargs]); memdump((char*)pb->args[2], pb->args[pb->nargs]);
According to IEEE 1275, "Size is either the actual size of the property, or –1 if name does not exist."
The property might be larger than the client's buffer, so don't dup the min used for writing into the buffer but the original proplen value. Insert a comment to show what's going on.
Signed-off-by: Andreas Färber andreas.faerber@web.de --- forth/system/ciface.fs | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/forth/system/ciface.fs b/forth/system/ciface.fs index 54fadc9..27a1deb 100644 --- a/forth/system/ciface.fs +++ b/forth/system/ciface.fs @@ -97,8 +97,9 @@ external over cstrlen swap ?phandle get-package-property if 2drop -1 exit then ( buflen buf prop proplen ) - >r swap rot r> min - dup >r move r> + >r swap rot r> + ( prop buf buflen proplen ) + dup >r min move r> ;
\ 1 OK, 0 no more prop, -1 prev invalid
Thanks, applied all.
On Fri, Oct 8, 2010 at 1:49 PM, Andreas Färber andreas.faerber@web.de wrote:
Don't trace the buffer length in place of the property size.
Signed-off-by: Andreas Färber andreas.faerber@web.de
libopenbios/client.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libopenbios/client.c b/libopenbios/client.c index 16e4323..2b78dcc 100644 --- a/libopenbios/client.c +++ b/libopenbios/client.c @@ -170,7 +170,7 @@ static void dump_return(prom_args_t *pb) } else if (strcmp(pb->service, "getproplen") == 0) { printk("0x%08lx\n", pb->args[pb->nargs]); } else if (strcmp(pb->service, "getprop") == 0) {
- printk("%ld\n", pb->args[3]);
- printk("%ld\n", pb->args[pb->nargs]);
memdump((char*)pb->args[2], pb->args[3]); } else if (strcmp(pb->service, "nextprop") == 0) { printk("%ld\n", pb->args[pb->nargs]); -- 1.7.3
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you