Move hexdump32() to lib/hexdump.
Needs printk and is not a console core function. Change-Id: Id90a363eca133af4469663c1e8b504baa70471e0 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/5155 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
This commit is contained in:
parent
4d77ed9d99
commit
972d5cf040
|
@ -137,23 +137,3 @@ void console_init(void)
|
||||||
#endif /* CONFIG_EARLY_CONSOLE */
|
#endif /* CONFIG_EARLY_CONSOLE */
|
||||||
}
|
}
|
||||||
#endif
|
#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__ */
|
|
||||||
|
|
|
@ -86,7 +86,6 @@ void post_log_clear(void);
|
||||||
void mainboard_post(u8 value);
|
void mainboard_post(u8 value);
|
||||||
void __attribute__ ((noreturn)) die(const char *msg);
|
void __attribute__ ((noreturn)) die(const char *msg);
|
||||||
int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
|
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 || \
|
#if defined(__BOOT_BLOCK__) && !CONFIG_BOOTBLOCK_CONSOLE || \
|
||||||
(defined(__PRE_RAM__) && !defined(__BOOT_BLOCK__)) && !CONFIG_EARLY_CONSOLE
|
(defined(__PRE_RAM__) && !defined(__BOOT_BLOCK__)) && !CONFIG_EARLY_CONSOLE
|
||||||
|
|
|
@ -60,5 +60,6 @@ void post_cache_as_ram(void);
|
||||||
|
|
||||||
/* Defined in src/lib/hexdump.c */
|
/* Defined in src/lib/hexdump.c */
|
||||||
void hexdump(const void *memory, size_t length);
|
void hexdump(const void *memory, size_t length);
|
||||||
|
void hexdump32(char LEVEL, const void *d, int len);
|
||||||
|
|
||||||
#endif /* __LIB_H__ */
|
#endif /* __LIB_H__ */
|
||||||
|
|
|
@ -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");
|
||||||
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <cpu/x86/stack.h>
|
#include <cpu/x86/stack.h>
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
|
#include <lib.h>
|
||||||
#include "fsp_util.h"
|
#include "fsp_util.h"
|
||||||
|
|
||||||
#if CONFIG_ENABLE_FAST_BOOT
|
#if CONFIG_ENABLE_FAST_BOOT
|
||||||
|
|
Loading…
Reference in New Issue