blob: 16868be346e18c796c27320b08a08cc72a53f32c [file] [log] [blame]
/* --COPYRIGHT--,EPL
* Copyright (c) 2008 Texas Instruments and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Texas Instruments - initial implementation
*
* --/COPYRIGHT--*/
extern int __cinit__; /* defined by TI linker == -1 if .cinit isn't loaded */
extern char __bss__; /* defined by the TI linker to be the start of .bss */
extern char __end__; /* defined by the TI linker to be the end of .bss */
/*
* ======== _system_pre_init ========
* Called by the reset code prior to .cinit processing (which
* initializes all explicitly initialized C static or global variables)
*/
int _system_pre_init(void)
{
/* if .cinit is not loaded, the loader has already initialized .bss */
if (&__cinit__ != (int *)-1) {
char *cp;
/* otherwise, we initialize all .bss to 0 before .cinit is processed */
for (cp = &__bss__; cp <= &__end__; ) {
*cp++ = 0;
}
}
return (1);
}