[coreboot-gerrit] Patch set updated for coreboot: c802052 console: Add hexdump32 function

Marc Jones (marc.jones@se-eng.com) gerrit at coreboot.org
Fri Nov 8 19:16:36 CET 2013


Marc Jones (marc.jones at se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4013

-gerrit

commit c8020523ca8caa603dfafa5970f003124abc6572
Author: Marc Jones <marc.jones at se-eng.com>
Date:   Wed Oct 30 16:25:23 2013 -0600

    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 at se-eng.com>
---
 src/console/console.c         | 20 ++++++++++++++++++++
 src/include/console/console.h |  1 +
 2 files changed, 21 insertions(+)

diff --git a/src/console/console.c b/src/console/console.c
index 8a1c969..39a30b5 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__ */
diff --git a/src/include/console/console.h b/src/include/console/console.h
index 4e9b988..9f347ad 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -76,6 +76,7 @@ void post_code(u8 value);
 void mainboard_post(u8 value);
 void __attribute__ ((noreturn)) die(const char *msg);
 int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
+void hexdump32(char LEVEL, const void *d, int len);
 
 #if defined(__BOOT_BLOCK__) && !CONFIG_BOOTBLOCK_CONSOLE || \
     (defined(__PRE_RAM__) && !defined(__BOOT_BLOCK__)) && !CONFIG_EARLY_CONSOLE



More information about the coreboot-gerrit mailing list