diff --git a/arch/x86/stage1.c b/arch/x86/stage1.c index b768227152..2354a3dda6 100644 --- a/arch/x86/stage1.c +++ b/arch/x86/stage1.c @@ -66,6 +66,19 @@ void init_archive(struct mem_file *archive) // FIXME check integrity } + +void dump_mem_range(int msg_level, unsigned char *buf, int size) +{ + int i; + printk(msg_level, "dumping memrange %p size %i:\n", buf, size); + for (i = 0; i < size; i++) { + printk(msg_level, "%02x ", buf[i]); + if (i % 16 == 15) + printk(msg_level, "\n"); + } + return; +} + /* until we get rid of elf */ int legacy(struct mem_file *archive, char *name, void *where, struct lb_memory *mem) { diff --git a/include/console.h b/include/console.h index 0505ec9806..c3644132e2 100644 --- a/include/console.h +++ b/include/console.h @@ -49,5 +49,6 @@ struct console_driver { SHARED_WITH_ATTRIBUTES(printk, int, __attribute__((format (printf, 2, 3))), int msg_level, const char *fmt, ...); SHARED(banner, void, int msg_level, const char *msg); +SHARED(dump_mem_range, void, int msg_level, unsigned char *buf, int size); #endif /* CONSOLE_H */