Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Apr 2006 23:43:27 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 95463 for review
Message-ID:  <200604172343.k3HNhRPK057583@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=95463

Change 95463 by imp@imp_hammer on 2006/04/17 23:42:43

	Switch to using printf instead of DebugPrint, et al.  Alas, this
	change costs us about 110 bytes.

Affected files ...

.. //depot/projects/arm/src/sys/boot/arm/at91/bootiic/Makefile#6 edit
.. //depot/projects/arm/src/sys/boot/arm/at91/bootiic/debug_io.c#7 delete
.. //depot/projects/arm/src/sys/boot/arm/at91/bootiic/debug_io.h#4 delete
.. //depot/projects/arm/src/sys/boot/arm/at91/bootiic/eeprom.c#6 edit
.. //depot/projects/arm/src/sys/boot/arm/at91/bootiic/emac.c#6 edit
.. //depot/projects/arm/src/sys/boot/arm/at91/bootiic/env_vars.c#6 edit
.. //depot/projects/arm/src/sys/boot/arm/at91/bootiic/loader_prompt.c#7 edit
.. //depot/projects/arm/src/sys/boot/arm/at91/bootiic/main.c#5 edit
.. //depot/projects/arm/src/sys/boot/arm/at91/libat91/putchar.c#3 edit

Differences ...

==== //depot/projects/arm/src/sys/boot/arm/at91/bootiic/Makefile#6 (text+ko) ====

@@ -3,7 +3,7 @@
 P=bootiic
 FILES=${P}
 SRCS=arm_init.s main.c eeprom.c \
-	env_vars.c debug_io.c loader_prompt.c p_string.c emac.c
+	env_vars.c loader_prompt.c p_string.c emac.c
 NO_MAN=
 LDFLAGS=-e 0 -T linker.cfg
 OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}

==== //depot/projects/arm/src/sys/boot/arm/at91/bootiic/eeprom.c#6 (text+ko) ====

@@ -22,7 +22,7 @@
 #include "at91rm9200_lowlevel.h"
 #include "eeprom.h"
 #include "at91rm9200.h"
-#include "debug_io.h"
+#include "lib.h"
 
 /* ****************************** GLOBALS *************************************/
 
@@ -136,7 +136,7 @@
 
 	while (size--) {
 		if (!(ee_addr & 0x3f))
-			DebugPrint(".");
+			putchar('.');
 
 		// Set the TWI Master Mode Register
 		twiPtr->TWI_MMR = ((TWSI_EEPROM_ADDRESS << 16) | AT91C_TWI_IADRSZ_2_BYTE ) & ~AT91C_TWI_MREAD;
@@ -164,5 +164,6 @@
 		ReadEEPROM(ee_addr, &test_data, 1);
 	}
 
-	DebugPrint("\n\r");
+	putchar('\r');
+	putchar('\n');
 }

==== //depot/projects/arm/src/sys/boot/arm/at91/bootiic/emac.c#6 (text+ko) ====

@@ -24,7 +24,7 @@
 #include "emac.h"
 #include "p_string.h"
 #include "at91rm9200_lowlevel.h"
-#include "debug_io.h"
+#include "lib.h"
 
 /* ****************************** GLOBALS *************************************/
 
@@ -550,12 +550,9 @@
 
 	if (!address) {
 		// report last transfer information
-		DebugPrint("\n\r -- Last tftp transfer info --\n\r");
-		DebugPrint("     address: ");
-		DebugPrintHex(8, lastAddress);
-		DebugPrint("\n\r     size: ");
-		DebugPrintHex(8, lastSize);
-		DebugPrint("\n\r");
+		printf("Last tftp transfer info --\r\n"
+		  "address: 0x%x\r\n"
+		  "   size: 0x%x\r\n", lastAddress, lastSize);
 		return ;
 	}
 

==== //depot/projects/arm/src/sys/boot/arm/at91/bootiic/env_vars.c#6 (text+ko) ====

@@ -21,7 +21,6 @@
 #include "env_vars.h"
 #include "loader_prompt.h"
 #include "p_string.h"
-#include "debug_io.h"
 #include "eeprom.h"
 #include "lib.h"
 
@@ -144,14 +143,13 @@
 	int	i, j;
 
 	for (i = 0; i < MAX_BOOT_COMMANDS; ++i) {
-		DebugPrintHex(2, i);
-		DebugPrint(" : ");
+		printf("0x%x : ", i);
 		for (j = 0; j < MAX_INPUT_SIZE; ++j) {
 			putchar(boot_commands[i][j]);
 			if (!(boot_commands[i][j]))
 				break;
 		}
-		DebugPrint("[E]\n\r");
+		printf("[E]\n\r");
 	}
 }
 

==== //depot/projects/arm/src/sys/boot/arm/at91/bootiic/loader_prompt.c#7 (text+ko) ====

@@ -20,7 +20,6 @@
  * END_BLOCK
  ******************************************************************************/
 
-#include "debug_io.h"
 #include "at91rm9200_lowlevel.h"
 #include "p_string.h"
 #include "eeprom.h"
@@ -259,7 +258,7 @@
 
 	case COMMAND_HELP:
 	// dump command info
-		DebugPrint("Commands:\n\r"
+		printf("Commands:\n\r"
 		"\tc\n\r"
 		"\td\n\r"
 		"\te\n\r"
@@ -374,7 +373,7 @@
 		break;
 	}
 
-	DebugPrint("\n\r");
+	printf("\n\r");
 }
 
 
@@ -406,16 +405,16 @@
 		/* handle backspace BS */
 		--buffCount;
 		inputBuffer[buffCount] = 0;
-		DebugPrint(backspaceString);
+		printf(backspaceString);
 		return ;
 	}
 
 	if (!p_char) {
-		DebugPrint("\n\r");
+		printf("\n\r");
 		ParseCommand(inputBuffer);
 		p_memset(inputBuffer, 0, MAX_INPUT_SIZE);
 		buffCount = 0;
-		DebugPrint("\n\r>");
+		printf("\n\r>");
 	}
 }
 
@@ -444,7 +443,7 @@
 		inputFunction = getc;
 	}
 
-	DebugPrint("\n\r>");
+	printf("\n\r>");
 
 	while (ch >= 0)
 		if ((ch = ((*inputFunction)(0))) > 0)

==== //depot/projects/arm/src/sys/boot/arm/at91/bootiic/main.c#5 (text+ko) ====

@@ -20,7 +20,6 @@
  * END_BLOCK
  ******************************************************************************/
 
-#include "debug_io.h"
 #include "env_vars.h"
 #include "at91rm9200_lowlevel.h"
 #include "loader_prompt.h"
@@ -45,8 +44,7 @@
 
 	LoadBootCommands();
 
-	DebugPrint("\n\rKB9202(www.kwikbyte.com)\n\r");
-	DebugPrint("\n\rAuto boot..\n\r");
+	printf("\n\rKB9202(www.kwikbyte.com)\n\rAuto boot..\n\r");
 
 	if (getc(1) == -1)
 		ExecuteEnvironmentFunctions();

==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/putchar.c#3 (text) ====




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604172343.k3HNhRPK057583>