PERFORCE change 104722 for review

Warner Losh imp at FreeBSD.org
Mon Aug 21 20:58:29 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=104722

Change 104722 by imp at imp_lighthouse on 2006/08/21 20:58:02

	Init bss

Affected files ...

.. //depot/projects/arm/src/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c#8 edit

Differences ...

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

@@ -30,6 +30,9 @@
 #include "at91rm9200.h"
 #include "at91rm9200_lowlevel.h"
 
+extern void *__bss_start__;
+extern void *__bss_end__;
+
 #define BAUD	115200
 #define AT91C_US_ASYNC_MODE (AT91C_US_USMODE_NORMAL | AT91C_US_NBSTOP_1_BIT | \
 		AT91C_US_PAR_NONE | AT91C_US_CHRL_8_BITS | AT91C_US_CLKS_CLOCK)
@@ -42,6 +45,8 @@
 void
 _init(void)
 {
+	int *i;
+
 	AT91PS_USART pUSART = (AT91PS_USART)AT91C_BASE_DBGU;
 	AT91PS_PDC pPDC = (AT91PS_PDC)&(pUSART->US_RPR);
 
@@ -195,4 +200,9 @@
 	pUSART->US_MR = AT91C_US_ASYNC_MODE;
 	pUSART->US_CR = AT91C_US_TXEN;
 	pUSART->US_CR = AT91C_US_RXEN;
+
+	/* Zero BSS now that we have memory setup */
+	i = (int *)__bss_start__;
+	while (i < (int *)__bss_end__)
+		*i++ = 0;
 }


More information about the p4-projects mailing list