diff options
author | Marc Jones <marc.jones@se-eng.com> | 2013-10-30 16:25:23 -0600 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2013-11-10 14:12:31 +0100 |
commit | af0cd0921a277e0724d75e73271c8dd9ce70c0f9 (patch) | |
tree | 82d6328406e036032ff84dca68f3a49f3df8c5ab /src/console | |
parent | 12785d9601d8fdfe6f12289b4fd7001f304862f5 (diff) | |
download | coreboot-af0cd0921a277e0724d75e73271c8dd9ce70c0f9.tar.xz |
console: Add hexdump32 function
Add a function to display memory locations in the console
logfile.
Change-Id: Iddb8d2e7a24357075f32c2fdf7916ae7a732247d
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/4013
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/console')
-rw-r--r-- | src/console/console.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/console/console.c b/src/console/console.c index 8a1c969987..39a30b5280 100644 --- a/src/console/console.c +++ b/src/console/console.c @@ -135,3 +135,23 @@ void console_init(void) #endif /* CONFIG_EARLY_CONSOLE */ } #endif + +#ifndef __ROMCC__ +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"); +} +#endif /* !__ROMCC__ */ |