1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef CONFIG_COREBOOT_V2
15#include <cpu.h>
16#endif
17
18#include "debug.h"
19
20u32 debug_flags = 0;
21
22void
23dump(u8 * addr, u32 len)
24{
25 printf("\n%s(%p, %x):\n", __func__, addr, len);
26 while (len) {
27 unsigned int tmpCnt = len;
28 unsigned char x;
29 if (tmpCnt > 8)
30 tmpCnt = 8;
31 printf("\n%p: ", addr);
32
33 while (tmpCnt--) {
34 set_ci();
35 x = *addr++;
36 clr_ci();
37 printf("%02x ", x);
38 }
39 tmpCnt = len;
40 if (tmpCnt > 8)
41 tmpCnt = 8;
42 len -= tmpCnt;
43
44 addr = addr - tmpCnt;
45
46 while (tmpCnt--) {
47 set_ci();
48 x = *addr++;
49 clr_ci();
50 if ((x < 32) || (x >= 127)) {
51
52 x = '.';
53 }
54 printf("%c", x);
55 }
56 }
57 printf("\n");
58}
59