1 indent
: Standard input
:27: Warning
:old style assignment ambiguity in
"=*". Assuming
"= *"
4 static inline void ecc_off (void)
6 *(volatile int *) (INTERNAL_REG_BASE_ADDR
+ 0x4b4) &= ~0x00200000;
9 static inline void ecc_on (void)
11 *(volatile int *) (INTERNAL_REG_BASE_ADDR
+ 0x4b4) |= 0x00200000;
14 static int putshex (const char *buf
, int len
)
18 for (i
= 0; i
< len
; i
++) {
19 printf ("%02x", buf
[i
]);
24 static int char_memcpy (void *d
, const void *s
, int len
)
30 for (i
= 0; i
< len
; i
++) {
36 static int memory_test (char *buf
)
38 const char src
[][16] = {
39 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
40 {0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
41 0x01, 0x01, 0x01, 0x01, 0x01, 0x01},
42 {0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
43 0x02, 0x02, 0x02, 0x02, 0x02, 0x02},
44 {0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
45 0x04, 0x04, 0x04, 0x04, 0x04, 0x04},
46 {0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
47 0x08, 0x08, 0x08, 0x08, 0x08, 0x08},
48 {0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
49 0x10, 0x10, 0x10, 0x10, 0x10, 0x10},
50 {0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
51 0x20, 0x20, 0x20, 0x20, 0x20, 0x20},
52 {0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
53 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
54 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
55 0x80, 0x80, 0x80, 0x80, 0x80, 0x80},
56 {0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
57 0x55, 0x55, 0x55, 0x55, 0x55, 0x55},
58 {0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
59 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa},
60 {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
61 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
63 const int foo
[] = { 0 };
66 printf ("\ntest @ %d %p\n", foo
[0], buf
);
67 for (i
= 0; i
< 12; i
++) {
68 for (a
= 0; a
< 8; a
++) {
69 const char *s
= src
[i
] + a
;
70 int align
= (unsigned) (s
) & 0x7;
76 if (memcmp (buf
, s
, 8)) {
79 printf (" [FAIL] (%p) align=%d\n", s
, align
);
80 for (j
= 0; j
< 8; j
++) {
81 s
[j
] == buf
[j
] ? puts (" ") :
87 printf (" [PASS] (%p) align=%d\n", s
, align
);
90 char_memcpy (buf
, s
, 8);
93 if (memcmp (buf
, s
, 8)) {
96 printf (" [FAIL] (%p) align=%d\n", s
, align
);
97 for (j
= 0; j
< 8; j
++) {
98 s
[j
] == buf
[j
] ? puts (" ") :
104 printf (" [PASS] (%p) align=%d\n", s
, align
);