Update of /cvsroot/blob/blob/src/blob
In directory usw-pr-cvs1:/tmp/cvs-serv13824
Modified Files:
memory.c
Log Message:
Convert SerialOutput*() functions to printf()
Index: memory.c
===================================================================
RCS file: /cvsroot/blob/blob/src/blob/memory.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- memory.c 3 Jan 2002 16:07:18 -0000 1.4
+++ memory.c 13 Feb 2002 00:09:51 -0000 1.5
@@ -26,8 +26,9 @@
#endif
#include <blob/arch.h>
+#include <blob/debug.h>
#include <blob/memory.h>
-#include <blob/serial.h>
+#include <blob/util.h>
/* test in 1MB chunks */
#define TEST_BLOCK_SIZE (1024 * 1024)
@@ -65,13 +66,10 @@
if(testram(addr) == 0) {
/* yes, memory */
if(* (u32 *)addr != 0) { /* alias? */
-#ifdef BLOB_DEBUG
- SerialOutputString("Detected alias at 0x");
- SerialOutputHex(addr);
- SerialOutputString(", aliased from 0x");
- SerialOutputHex(* (u32 *)addr);
- serial_write('\n');
-#endif
+ dprintf("detected alias at 0x%08x, "
+ "aliased from 0x%08x\n",
+ addr, * (u32 *)addr);
+
if(memory_map[i].used)
i++;
@@ -80,11 +78,9 @@
/* not an alias, write the current address */
* (u32 *)addr = addr;
-#ifdef BLOB_DEBUG
- SerialOutputString("Detected memory at 0x");
- SerialOutputHex(addr);
- serial_write('\n');
-#endif
+
+ dprintf("detected memory at 0x%08x\n", addr);
+
/* does this start a new block? */
if(memory_map[i].used == 0) {
memory_map[i].start = addr;
@@ -99,16 +95,13 @@
i++;
}
}
- SerialOutputString("Memory map:\n");
+ printf("Memory map:\n");
for(i = 0; i < NUM_MEM_AREAS; i++) {
if(memory_map[i].used) {
- SerialOutputString(" 0x");
- SerialOutputHex(memory_map[i].len);
- SerialOutputString(" @ 0x");
- SerialOutputHex(memory_map[i].start);
- SerialOutputString(" (");
- SerialOutputDec(memory_map[i].len / (1024 * 1024));
- SerialOutputString(" MB)\n");
+ printf(" 0x%08x @ 0x%08x (%d MB)\n",
+ memory_map[i].len,
+ memory_map[i].start,
+ memory_map[i].len / (1024 * 1024));
}
}
}
|