blob: 94986652174832683bd5a6d3b5d0ae092d1fd3c0 [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, some loader will initialize .bss */
if (__cinit__ != -1) {
char *cp;
/* otherwise, we initialize all .bss to 0 before .cinit is processed */
for (cp = &__bss__; cp < &__end__; ) {
*cp++ = 0;
}
}
return (1);
}