Author: blueswirl Date: Sat Oct 9 12:16:29 2010 New Revision: 893 URL: http://tracker.coreboot.org/trac/openbios/changeset/893
Log: Improve getprop mem dump
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 Signed-off-by: Blue Swirl blauwirbel@gmail.com
Modified: trunk/openbios-devel/libopenbios/client.c
Modified: trunk/openbios-devel/libopenbios/client.c ============================================================================== --- trunk/openbios-devel/libopenbios/client.c Sat Oct 9 12:16:26 2010 (r892) +++ trunk/openbios-devel/libopenbios/client.c Sat Oct 9 12:16:29 2010 (r893) @@ -171,7 +171,8 @@ 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]);