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>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@893 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Andreas Färber
2010-10-09 10:16:29 +00:00
committed by Blue Swirl
parent 1061a98f8d
commit b3d98a9189

View File

@@ -171,7 +171,8 @@ static void dump_return(prom_args_t *pb)
printk("0x%08lx\n", pb->args[pb->nargs]); printk("0x%08lx\n", pb->args[pb->nargs]);
} else if (strcmp(pb->service, "getprop") == 0) { } else if (strcmp(pb->service, "getprop") == 0) {
printk("%ld\n", pb->args[pb->nargs]); 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) { } else if (strcmp(pb->service, "nextprop") == 0) {
printk("%ld\n", pb->args[pb->nargs]); printk("%ld\n", pb->args[pb->nargs]);
memdump((char*)pb->args[2], pb->args[pb->nargs]); memdump((char*)pb->args[2], pb->args[pb->nargs]);