Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Apr 2006 03:30:25 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 94888 for review
Message-ID:  <200604100330.k3A3UPtm089621@repoman.freebsd.org>

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

Change 94888 by imp@imp_hammer on 2006/04/10 03:29:42

	bum a few more bytes by making GetSeconds() inline.  We're down to 1236
	bytes.  This should allow us to grow a bit for automatic Master Clock
	detection.

Affected files ...

.. //depot/projects/arm/src/sys/boot/arm/kb920x/boot0/at91rm9200_lowlevel.c#3 edit
.. //depot/projects/arm/src/sys/boot/arm/kb920x/boot0/at91rm9200_lowlevel.h#2 edit
.. //depot/projects/arm/src/sys/boot/arm/kb920x/boot0/debug_io.c#3 edit

Differences ...

==== //depot/projects/arm/src/sys/boot/arm/kb920x/boot0/at91rm9200_lowlevel.c#3 (text+ko) ====

@@ -38,18 +38,6 @@
 
 /*
  * .KB_C_FN_DEFINITION_START
- * unsigned GetSeconds(void)
- *  Returns a value read from the RTC for use as a rough seconds counter.
- * .KB_C_FN_DEFINITION_END
- */
-unsigned GetSeconds(void)
-{
-	return (AT91C_BASE_RTC->RTC_TIMR & AT91C_RTC_SEC);
-}
-
-
-/*
- * .KB_C_FN_DEFINITION_START
  * void DefaultSystemInit(void)
  *  If no system config info is found, config the board for default parameters.
  * .KB_C_FN_DEFINITION_END

==== //depot/projects/arm/src/sys/boot/arm/kb920x/boot0/at91rm9200_lowlevel.h#2 (text+ko) ====

@@ -42,8 +42,8 @@
 #endif
 
 
+#define GetSeconds() (AT91C_BASE_RTC->RTC_TIMR & AT91C_RTC_SEC)
 
-extern unsigned GetSeconds(void);
 extern void DefaultSystemInit(void);
 
 #endif /* _AT91RM9200_LOWLEVEL_H_ */

==== //depot/projects/arm/src/sys/boot/arm/kb920x/boot0/debug_io.c#3 (text+ko) ====

@@ -19,6 +19,7 @@
  ******************************************************************************/
 
 #include "AT91RM9200.h"
+#include "at91rm9200_lowlevel.h"
 
 /*
  * .KB_C_FN_DEFINITION_START
@@ -27,11 +28,14 @@
  * as it is ready to send another character.
  * .KB_C_FN_DEFINITION_END
  */
-void DebugPutc(char cValue) {
+void
+DebugPutc(char cValue)
+{
 
 	AT91PS_USART pUSART = (AT91PS_USART)AT91C_BASE_DBGU;
 
-	while (!(pUSART->US_CSR & AT91C_US_TXRDY)) ;
+	while (!(pUSART->US_CSR & AT91C_US_TXRDY))
+		continue;
 
 	pUSART->US_THR = (cValue & 0x1FF);
 }
@@ -44,8 +48,9 @@
  * the function returns 0 if not character was available.
  * .KB_C_FN_DEFINITION_END
  */
-int DebugGetchar(char *retChar) {
-
+int
+DebugGetchar(char *retChar)
+{
 	AT91PS_USART pUSART = (AT91PS_USART)AT91C_BASE_DBGU;
 
 	if ((pUSART->US_CSR & AT91C_US_RXRDY)) {
@@ -64,17 +69,17 @@
  * the pointer.  Otherwise, the function returns 0.
  * .KB_C_FN_DEFINITION_END
  */
-int WaitForChar(char *cPtr, int seconds) {
-
+int
+WaitForChar(char *cPtr, int seconds)
+{
 	unsigned	thisSecond;
 
 	++seconds;
 	thisSecond = GetSeconds();
 
 	while (seconds) {
-		if (DebugGetchar(cPtr)) {
+		if (DebugGetchar(cPtr))
 			return (1);
-		}
 
 		if (GetSeconds() != thisSecond) {
 			--seconds;



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