summaryrefslogblamecommitdiffstats
path: root/c/src/lib/libbsp/shared/bsplibc.c
blob: 8bdc68f40d90597b12cc7b166c36470ae95b34bc (plain) (tree)
1
2
3
4
5
6
7
8
9
  
                            
                                                    




                  
                        
                              
 

                         
                        


                      
                                                               


                                                                 
                                                              








                                                                            
                                                            


                                                                
 
/*
 *  COPYRIGHT (c) 1989-1999.
 *  On-Line Applications Research Corporation (OAR).
 *
 *  $Id$
 */

#include <rtems.h>
#include <rtems/libio.h>
#include <rtems/libcsupport.h>

void bsp_libc_init(
  void       *heap_start,
  uint32_t    heap_size,
  int         use_sbrk
)
{
    RTEMS_Malloc_Initialize( heap_start, heap_size, use_sbrk );

    /*
     *  Init the RTEMS libio facility to provide UNIX-like system
     *  calls for use by newlib (ie: provide open, close, etc)
     *  Uses malloc() to get area for the iops, so must be after malloc init
     */

    rtems_libio_init();

    /*
     * Set up for the libc handling.
     */

    if ( rtems_configuration_get_ticks_per_timeslice() > 0 )
        libc_init(1);                /* reentrant if possible */
    else
        libc_init(0);                /* non-reentrant */
}