From 972d5cf040aebbb8052767a4a88ad99a961ad2bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sun, 26 Jan 2014 14:44:18 +0200 Subject: Move hexdump32() to lib/hexdump. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Needs printk and is not a console core function. Change-Id: Id90a363eca133af4469663c1e8b504baa70471e0 Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/5155 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Alexandru Gagniuc --- src/lib/hexdump.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/lib') diff --git a/src/lib/hexdump.c b/src/lib/hexdump.c index 82b0a3b..6100920 100644 --- a/src/lib/hexdump.c +++ b/src/lib/hexdump.c @@ -62,4 +62,20 @@ void hexdump(const void* memory, size_t length) } } +void hexdump32(char LEVEL, const void *d, int len) +{ + int count=0; + + while (len > 0) { + if (count % 8 == 0) { + printk(LEVEL,"\n"); + printk(LEVEL, "%p:", d); + } + printk(LEVEL, " 0x%08lx", *(unsigned long*)d); + count++; + len--; + d += 4; + } + printk(LEVEL,"\n\n"); +} -- cgit v1.1