Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:58

0001 /*
0002  *  zero the various bss areas.
0003  */
0004 
0005 /*
0006  *  COPYRIGHT (c) 1989-2014.
0007  *  On-Line Applications Research Corporation (OAR).
0008  *
0009  *  The license and distribution terms for this file may be
0010  *  found in the file LICENSE in this distribution or at
0011  *  http://www.rtems.org/license/LICENSE.
0012  *
0013  *  Modified to support the MCP750.
0014  *  Modifications Copyright (C) 1999 Eric Valette. valette@crf.canon.fr
0015  */
0016 
0017 #include <string.h>
0018 #include <bsp.h>
0019 
0020 /* prevent these from being accessed in the short data areas */
0021 extern unsigned long __bss_start[], __SBSS_START__[], __SBSS_END__[];
0022 extern unsigned long __SBSS2_START__[], __SBSS2_END__[];
0023 extern unsigned long __bss_end[];
0024 
0025 void zero_bss(void)
0026 {
0027   memset(
0028     __SBSS_START__,
0029     0,
0030     ((unsigned) __SBSS_END__) - ((unsigned)__SBSS_START__)
0031   );
0032   memset(
0033     __SBSS2_START__,
0034     0,
0035     ((unsigned) __SBSS2_END__) - ((unsigned)__SBSS2_START__)
0036   );
0037   memset(
0038     __bss_start,
0039     0,
0040     ((unsigned) __bss_end) - ((unsigned)__bss_start)
0041   );
0042 }