Changeset b6394ae in rtems


Ignore:
Timestamp:
Apr 15, 1998, 3:13:01 PM (23 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
bd9c3d1
Parents:
b3d3a34e
Message:

Transitioned to shared bsp_libc_init() and cleaned up comments.

Location:
c/src/lib/libbsp
Files:
63 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/a29k/portsw/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bspclean bsppost bspstart main sbrk setvec iface
     14C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec iface
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/a29k/portsw/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
    54 *  The generic CPU dependent initialization has been performed
    65 *  before this routine is invoked.
    7  *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    116 *
    127 *  COPYRIGHT (c) 1989-1998.
     
    5449rtems_unsigned32        heap_start;
    5550
    56 void bsp_libc_init()
    57 {
    58     heap_size = 2 * 1024 * 1024; /* allocate a maximum of 2 megabytes for the heap */
    59 
    60     /* allocate all remaining memory to the heap */
    61     do {
    62        heap_size -= HEAP_BLOCK_SIZE;
    63        heap_start = _sysalloc( heap_size );
    64     } while ( !heap_start );
    65 
    66     if (!heap_start)
    67        rtems_fatal_error_occurred( heap_size );
    68 
    69     if (heap_start & (CPU_ALIGNMENT-1))
    70         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    71 
    72     /*
    73      *  The last parameter to RTEMS_Malloc_Initialize is the "chunk"
    74      *  size which a multiple of will be requested on each sbrk()
    75      *  call by malloc().  A value of 0 indicates that sbrk() should
    76      *  not be called to extend the heap.
    77      */
    78 
    79     RTEMS_Malloc_Initialize((void *) heap_start, heap_size, 0);
    80 
    81     /*
    82      *  Init the RTEMS libio facility to provide UNIX-like system
    83      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    84      *  Uses malloc() to get area for the iops, so must be after malloc init
    85      */
    86 
    87     rtems_libio_init();
    88 
    89     /*
    90      * Set up for the libc handling.
    91      */
    92 
    93     if (BSP_Configuration.ticks_per_timeslice > 0)
    94         libc_init(1);                /* reentrant if possible */
    95     else
    96         libc_init(0);                /* non-reentrant */
    97 
    98 }
     51/*
     52 *  Use the shared implementations of the following routines
     53 */
     54 
     55void bsp_postdriver_hook(void);
     56void bsp_libc_init( void *, unsigned32, int );
    9957
    10058/*
     
    11270 */
    11371 
    114 void
    115 bsp_pretasking_hook(void)
     72void bsp_pretasking_hook(void)
    11673{
    117     bsp_libc_init();
     74   /* allocate a maximum of 2 megabytes for the heap */
     75    heap_size = 2 * 1024 * 1024;
     76
     77    /* allocate all remaining memory to the heap */
     78    do {
     79       heap_size -= HEAP_BLOCK_SIZE;
     80       heap_start = _sysalloc( heap_size );
     81    } while ( !heap_start );
     82
     83    if (!heap_start)
     84       rtems_fatal_error_occurred( heap_size );
     85
     86    if (heap_start & (CPU_ALIGNMENT-1))
     87        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     88
     89
     90    bsp_libc_init((void *) heap_start, heap_size, 0);
     91
    11892
    11993#ifdef RTEMS_DEBUG
     
    12296}
    12397 
    124 
    12598/*
    126  *  Use the shared bsp_postdriver_hook() implementation
     99 *  bsp_start
     100 *
     101 *  This routine does the bulk of the system initialization.
    127102 */
    128  
    129 void bsp_postdriver_hook(void);
    130103
    131104int bsp_start(
  • c/src/lib/libbsp/hppa1.1/simhppa/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bspclean bsppost bspstart main sbrk setvec
     14C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
     
    65 *  before this routine is invoked.
    76 *
    8  *  Called by RTEMS::RTEMS constructor in startup-ctor.cc
    9  *
    10  *  INPUT:  NONE
    11  *
    12  *  OUTPUT: NONE
    13  *
    147 *  COPYRIGHT (c) 1989-1998.
    158 *  On-Line Applications Research Corporation (OAR).
     
    5750 */
    5851
    59 rtems_extension
    60 fast_idle_switch_hook(rtems_tcb *current_task,
    61                       rtems_tcb *heir_task)
     52rtems_extension fast_idle_switch_hook(
     53  rtems_tcb *current_task,
     54  rtems_tcb *heir_task
     55)
    6256{
    6357    static rtems_unsigned32 normal_clock = ~0;
     
    8781
    8882/*
    89  *  Function:   bsp_libc_init
    90  *  Created:    94/12/6
     83 *  Use the shared implementations of the following routines
     84 */
     85 
     86void bsp_postdriver_hook(void);
     87void bsp_libc_init( void *, unsigned32, int );
     88
     89/*
     90 *  Function:   bsp_pretasking_hook
     91 *  Created:    95/03/10
    9192 *
    9293 *  Description:
    93  *      Initialize whatever libc we are using
    94  *      called from bsp_postdriver_hook
    95  *
    96  *
    97  *  Parameters:
    98  *      none
    99  *
    100  *  Returns:
    101  *      none.
    102  *
    103  *  Side Effects:
    104  *
     94 *      BSP pretasking hook.  Called just before drivers are initialized.
     95 *      Used to setup libc and install any BSP extensions.
    10596 *
    10697 *  Notes:
    107  *
    108  *  Deficiencies/ToDo:
    109  *
    110  *
    111  */
    112 
    113 void
    114 bsp_libc_init(void)
     98 *      Must not use libc (to do io) from here, since drivers are
     99 *      not yet initialized.
     100 */
     101
     102void bsp_pretasking_hook(void)
    115103{
    116104    extern int end;
     
    121109        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    122110
    123     RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0);
    124 
    125     /*
    126      *  Init the RTEMS libio facility to provide UNIX-like system
    127      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    128      *  Uses malloc() to get area for the iops, so must be after malloc init
    129      */
    130 
    131     rtems_libio_init();
    132 
    133     /*
    134      * Set up for the libc handling.
    135      * XXX; this should allow for case of some other non-clock interrupts
    136      */
    137 
    138     if (BSP_Configuration.ticks_per_timeslice > 0)
    139         libc_init(1);                /* reentrant if possible */
    140     else
    141         libc_init(0);                /* non-reentrant */
     111    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
    142112
    143113    /*
     
    152122    use_print_buffer = 1;
    153123#endif
    154 }
    155 
    156 
    157 /*
    158  *  Function:   bsp_pretasking_hook
    159  *  Created:    95/03/10
    160  *
    161  *  Description:
    162  *      BSP pretasking hook.  Called just before drivers are initialized.
    163  *      Used to setup libc and install any BSP extensions.
    164  *
    165  *  Parameters:
    166  *      none
    167  *
    168  *  Returns:
    169  *      nada
    170  *
    171  *  Side Effects:
    172  *      installs a few extensions
    173  *
    174  *  Notes:
    175  *      Must not use libc (to do io) from here, since drivers are
    176  *      not yet initialized.
    177  *
    178  *  Deficiencies/ToDo:
    179  *
    180  *
    181  */
    182 
    183 void
    184 bsp_pretasking_hook(void)
    185 {
    186     bsp_libc_init();
    187124
    188125#if SIMHPPA_FAST_IDLE
     
    213150#endif
    214151}
    215 
    216 /*
    217  *  Use the shared bsp_postdriver_hook() implementation
    218  */
    219  
    220 void bsp_postdriver_hook(void);
    221 
    222 /*
    223  *  Function:   bsp_start
    224  *  Created:    94/12/6
    225  *
    226  *  Description:
    227  *      called by crt0 as our "main" equivalent
    228  *
    229  *
    230  *
    231  *  Parameters:
    232  *
    233  *
    234  *  Returns:
    235  *
    236  *
    237  *  Side Effects:
    238  *
    239  *
    240  *  Notes:
    241  *
    242  *
    243  *  Deficiencies/ToDo:
    244  *
    245  *
    246  */
    247152
    248153void bsp_start(void)
  • c/src/lib/libbsp/i386/force386/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bspclean bsppost bspstart main sbrk setvec
     14C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/i386/force386/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
    54 *  The generic CPU dependent initialization has been performed
    65 *  before this routine is invoked.
    7  *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    116 *
    127 *  COPYRIGHT (c) 1989-1998.
     
    3833char *rtems_progname;
    3934
    40 /*      Initialize whatever libc we are using
    41  *      called from postdriver hook
     35/*
     36 *  Use the shared implementations of the following routines
    4237 */
    43 
    44 void bsp_libc_init()
    45 {
    46     extern int end;
    47     rtems_unsigned32        heap_start;
    48 
    49     heap_start = (rtems_unsigned32) &end;
    50     if (heap_start & (CPU_ALIGNMENT-1))
    51         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    52 
    53     RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0);
    54 
    55     /*
    56      *  Init the RTEMS libio facility to provide UNIX-like system
    57      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    58      *  Uses malloc() to get area for the iops, so must be after malloc init
    59      */
    60 
    61     rtems_libio_init();
    62 
    63     /*
    64      * Set up for the libc handling.
    65      */
    66 
    67     if (BSP_Configuration.ticks_per_timeslice > 0)
    68         libc_init(1);                /* reentrant if possible */
    69     else
    70         libc_init(0);                /* non-reentrant */
    71 }
     38 
     39void bsp_postdriver_hook(void);
     40void bsp_libc_init( void *, unsigned32, int );
    7241
    7342/*
     
    8554 */
    8655 
    87 void
    88 bsp_pretasking_hook(void)
     56void bsp_pretasking_hook(void)
    8957{
    90     bsp_libc_init();
     58    extern int end;
     59    rtems_unsigned32        heap_start;
     60
     61    heap_start = (rtems_unsigned32) &end;
     62    if (heap_start & (CPU_ALIGNMENT-1))
     63        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     64
     65    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
     66
    9167 
    9268#ifdef RTEMS_DEBUG
     
    9571}
    9672 
    97 
    9873/*
    99  *  Use the shared bsp_postdriver_hook() implementation
     74 *  bsp_start
     75 *
     76 *  This routine does the bulk of the system initialization.
    10077 */
    101  
    102 void bsp_postdriver_hook(void);
    10378
    10479void bsp_start( void )
  • c/src/lib/libbsp/i386/go32/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bsppost bspstart sbrk setvec
     14C_PIECES=bsplibc bsppost bspstart sbrk setvec
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/i386/go32/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
     
    65 *  before this routine is invoked.
    76 *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    11  *
    127 *  COPYRIGHT (c) 1989-1998.
    138 *  On-Line Applications Research Corporation (OAR).
     
    4136char *rtems_progname;
    4237
    43 /*      Initialize whatever libc we are using
    44  *      called from postdriver hook
     38/*
     39 *  Use the shared implementations of the following routines
    4540 */
     41 
     42void bsp_postdriver_hook(void);
     43void bsp_libc_init( void *, unsigned32, int );
    4644
    47 void bsp_libc_init()
    48 {
    49     rtems_unsigned32        heap_start;
    50 
    51 #if 0
    52     extern int end;
    53     heap_start = (rtems_unsigned32) &end;
    54 #else
    55     void * sbrk( int );
    56     heap_start = (rtems_unsigned32) sbrk( 64 * 1024 + CPU_ALIGNMENT );
    57 #endif
    58     if (heap_start & (CPU_ALIGNMENT-1))
    59         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    60 
    61     RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0);
    62 
    63     /*
    64      *  Init the RTEMS libio facility to provide UNIX-like system
    65      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    66      *  Uses malloc() to get area for the iops, so must be after malloc init
    67      */
    68 
    69     rtems_libio_init();
    70 
    71     /*
    72      * Set up for the libc handling.
    73      */
    74 
    75     if (BSP_Configuration.ticks_per_timeslice > 0)
    76         libc_init(1);                /* reentrant if possible */
    77     else
    78         libc_init(0);                /* non-reentrant */
    79 }
    80  
    8145/*
    8246 *  Function:   bsp_pretasking_hook
     
    9357 */
    9458 
    95 void
    96 bsp_pretasking_hook(void)
     59void bsp_pretasking_hook(void)
    9760{
    98     bsp_libc_init();
     61    rtems_unsigned32        heap_start;
     62
     63#if 0
     64    extern int end;
     65    heap_start = (rtems_unsigned32) &end;
     66#else
     67    void * sbrk( int );
     68    heap_start = (rtems_unsigned32) sbrk( 64 * 1024 + CPU_ALIGNMENT );
     69#endif
     70    if (heap_start & (CPU_ALIGNMENT-1))
     71        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     72
     73    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
     74
    9975 
    10076#ifdef RTEMS_DEBUG
     
    10379}
    10480 
    105 
    10681/*
    107  *  Use the shared bsp_postdriver_hook() implementation
     82 *  main/bsp_start
     83 *
     84 *  This routine does the bulk of the system initialization.
    10885 */
    109  
    110 void bsp_postdriver_hook(void);
    11186
    11287/* This is the original command line passed from DOS */
  • c/src/lib/libbsp/i386/i386ex/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bspclean bsppost bspstart main sbrk setvec
     14C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/i386/i386ex/startup/bspstart.c

    rb3d3a34e rb6394ae  
    4444
    4545/*
    46  *  bsp_libc_init
    47  *
    48  *  Initialize whatever libc we are using called from bsp_postdriver_hook.
     46 *  Use the shared implementations of the following routines
    4947 */
    50 
    5148 
    52 void bsp_libc_init()
    53 {
    54     extern int heap_bottom;
    55     rtems_unsigned32 heap_start;
    56     rtems_unsigned32 heap_size;
    57 
    58     heap_start = (rtems_unsigned32) &heap_bottom;
    59     if (heap_start & (CPU_ALIGNMENT-1))
    60       heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    61 
    62     heap_size = BSP_Configuration.work_space_start -(void *) heap_start ;
    63     heap_size &= 0xfffffff0;  /* keep it as a multiple of 16 bytes */
    64 
    65     heap_size &= 0xfffffff0;  /* keep it as a multiple of 16 bytes */
    66     RTEMS_Malloc_Initialize((void *) heap_start, heap_size, 0);
    67 
    68     /*
    69      *  Init the RTEMS libio facility to provide UNIX-like system
    70      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    71      *  Uses malloc() to get area for the iops, so must be after malloc init
    72      */
    73  
    74     rtems_libio_init();
    75  
    76     /*
    77      * Set up for the libc handling.
    78      */
    79  
    80     if (BSP_Configuration.ticks_per_timeslice > 0)
    81         libc_init(1);                /* reentrant if possible */
    82     else
    83         libc_init(0);                /* non-reentrant */
    84 }
     49void bsp_postdriver_hook(void);
     50void bsp_libc_init( void *, unsigned32, int );
    8551
    8652/*
     
    9864 */
    9965 
    100 void
    101 bsp_pretasking_hook(void)
     66void bsp_pretasking_hook(void)
    10267{
    103     bsp_libc_init();
    104  
     68    extern int heap_bottom;
     69    rtems_unsigned32 heap_start;
     70    rtems_unsigned32 heap_size;
     71
     72    heap_start = (rtems_unsigned32) &heap_bottom;
     73    if (heap_start & (CPU_ALIGNMENT-1))
     74      heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     75
     76    heap_size = BSP_Configuration.work_space_start -(void *) heap_start ;
     77    heap_size &= 0xfffffff0;  /* keep it as a multiple of 16 bytes */
     78
     79    heap_size &= 0xfffffff0;  /* keep it as a multiple of 16 bytes */
     80    bsp_libc_init((void *) heap_start, heap_size, 0);
     81
    10582#ifdef RTEMS_DEBUG
    10683    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
     
    10885}
    10986
    110 
    11187/*
    112  *  Use the shared bsp_postdriver_hook() implementation
     88 *  bsp_start
     89 *
     90 *  This routine does the bulk of the system initialization.
    11391 */
    114  
    115 void bsp_postdriver_hook(void);
    11692
    11793void bsp_start( void )
  • c/src/lib/libbsp/i386/pc386/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bspclean bsppost bspstart exit irq main sbrk
     14C_PIECES=bspclean bsplibc bsppost bspstart exit irq main sbrk
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/i386/pc386/startup/bspstart.c

    rb3d3a34e rb6394ae  
    6767+--------------------------------------------------------------------------*/
    6868extern void _exit(int);  /* define in exit.c */
    69 
    70 /*-------------------------------------------------------------------------+
    71 |         Function: bsp_libc_init
    72 |      Description: Initialize whatever libc we are using. Called from
    73 |                   pretasking hook.
    74 | Global Variables: rtemsFreeMemStart.
    75 |        Arguments: None.
    76 |          Returns: Nothing.
    77 +--------------------------------------------------------------------------*/
    78 static void
    79 bsp_libc_init(void)
    80 {
    81   if (rtemsFreeMemStart & (CPU_ALIGNMENT - 1))  /* not aligned => align it */
    82     rtemsFreeMemStart = (rtemsFreeMemStart+CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    83 
    84   RTEMS_Malloc_Initialize((void *)rtemsFreeMemStart, HEAP_SIZE << 10, 0);
    85   rtemsFreeMemStart += HEAP_SIZE << 10;           /* HEAP_SIZE is in KBytes */
    86 
    87   /* Init the RTEMS libio facility to provide UNIX-like system calls for use by
    88      newlib (ie: provide __rtems_open, __rtems_close, etc). Uses malloc()
    89      to get area for the iops, so must be after malloc initialization. */
    90 
    91   rtems_libio_init();
    92 
    93   /* Set up for the libc handling. */
    94 
    95   if (BSP_Configuration.ticks_per_timeslice > 0)
    96     libc_init(1); /* reentrant if possible */
    97   else
    98     libc_init(0); /* non-reentrant         */
    99 } /* bsp_libc_init */
    100 
     69void bsp_libc_init( void *, unsigned32, int );
     70void bsp_postdriver_hook(void);
    10171 
    10272/*-------------------------------------------------------------------------+
     
    11080|          Returns: Nothing.
    11181+--------------------------------------------------------------------------*/
    112 void
    113 bsp_pretasking_hook(void)
     82void bsp_pretasking_hook(void)
    11483{
    115   bsp_libc_init();
     84  if (rtemsFreeMemStart & (CPU_ALIGNMENT - 1))  /* not aligned => align it */
     85    rtemsFreeMemStart = (rtemsFreeMemStart+CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     86
     87  bsp_libc_init((void *)rtemsFreeMemStart, HEAP_SIZE << 10, 0);
     88  rtemsFreeMemStart += HEAP_SIZE << 10;           /* HEAP_SIZE is in KBytes */
     89
    11690
    11791#ifdef RTEMS_DEBUG
     
    12296} /* bsp_pretasking_hook */
    12397 
    124 
    125 /*
    126  *  Use the shared bsp_postdriver_hook() implementation
    127  */
    128  
    129 void bsp_postdriver_hook(void);
    130 
    13198
    13299/*-------------------------------------------------------------------------+
  • c/src/lib/libbsp/i960/cvme961/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bspclean bsppost bspstart main sbrk setvec
     14C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/i960/cvme961/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
    54 *  The generic CPU dependent initialization has been performed
    65 *  before this routine is invoked.
    7  *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    116 *
    127 *  COPYRIGHT (c) 1989-1998.
     
    4136char *rtems_progname;
    4237
    43 /*      Initialize whatever libc we are using
    44  *      called from postdriver hook
     38/*
     39 *  Use the shared implementations of the following routines
    4540 */
    46 
    47 void bsp_libc_init()
    48 {
    49     extern int end;
    50     rtems_unsigned32        heap_start;
    51 
    52     heap_start = (rtems_unsigned32) &end;
    53     if (heap_start & (CPU_ALIGNMENT-1))
    54         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    55 
    56     RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0);
    57 
    58     /*
    59      *  Init the RTEMS libio facility to provide UNIX-like system
    60      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    61      *  Uses malloc() to get area for the iops, so must be after malloc init
    62      */
    63 
    64     rtems_libio_init();
    65 
    66     /*
    67      * Set up for the libc handling.
    68      */
    69 
    70     if (BSP_Configuration.ticks_per_timeslice > 0)
    71         libc_init(1);                /* reentrant if possible */
    72     else
    73         libc_init(0);                /* non-reentrant */
    74 }
     41 
     42void bsp_postdriver_hook(void);
     43void bsp_libc_init( void *, unsigned32, int );
    7544
    7645/*
     
    8857 */
    8958 
    90 void
    91 bsp_pretasking_hook(void)
     59void bsp_pretasking_hook(void)
    9260{
    93     bsp_libc_init();
     61    extern int end;
     62    rtems_unsigned32        heap_start;
     63
     64    heap_start = (rtems_unsigned32) &end;
     65    if (heap_start & (CPU_ALIGNMENT-1))
     66        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     67
     68    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
    9469 
    9570#ifdef RTEMS_DEBUG
     
    9873}
    9974 
    100 
    10175/*
    102  *  Use the shared bsp_postdriver_hook() implementation
     76 *  bsp_start
     77 *
     78 *  This routine does the bulk of the system initialization.
    10379 */
    104  
    105 void bsp_postdriver_hook(void);
    10680
    10781void bsp_start( void )
  • c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bspclean bsppost bspstart main sbrk setvec vmeintr
     14C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec vmeintr
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
    54 *  The generic CPU dependent initialization has been performed
    65 *  before this routine is invoked.
    7  *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    116 *
    127 *  COPYRIGHT (c) 1989-1998.
     
    4035char *rtems_progname;
    4136
    42 /*      Initialize whatever libc we are using
    43  *      called from postdriver hook
     37/*
     38 *  Use the shared implementations of the following routines
    4439 */
    45 
    46 void bsp_libc_init()
    47 {
    48     extern int end;
    49     rtems_unsigned32        heap_start;
    50 
    51     heap_start = (rtems_unsigned32) &end;
    52     if (heap_start & (CPU_ALIGNMENT-1))
    53         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    54 
    55     RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0);
    56 
    57     /*
    58      *  Init the RTEMS libio facility to provide UNIX-like system
    59      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    60      *  Uses malloc() to get area for the iops, so must be after malloc init
    61      */
    62 
    63     rtems_libio_init();
    64 
    65     /*
    66      * Set up for the libc handling.
    67      */
    68 
    69     if (BSP_Configuration.ticks_per_timeslice > 0)
    70         libc_init(1);                /* reentrant if possible */
    71     else
    72         libc_init(0);                /* non-reentrant */
    73 }
     40 
     41void bsp_postdriver_hook(void);
     42void bsp_libc_init( void *, unsigned32, int );
    7443
    7544/*
     
    8756 */
    8857 
    89 void
    90 bsp_pretasking_hook(void)
     58void bsp_pretasking_hook(void)
    9159{
    92     bsp_libc_init();
     60    extern int end;
     61    rtems_unsigned32        heap_start;
     62
     63    heap_start = (rtems_unsigned32) &end;
     64    if (heap_start & (CPU_ALIGNMENT-1))
     65        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     66
     67    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
    9368 
    9469#ifdef RTEMS_DEBUG
     
    9772}
    9873 
    99 
    10074/*
    101  *  Use the shared bsp_postdriver_hook() implementation
     75 *  bsp_start
     76 *
     77 *  This routine does the bulk of the system initialization.
    10278 */
    103  
    104 void bsp_postdriver_hook(void);
    10579
    10680void bsp_start( void )
  • c/src/lib/libbsp/m68k/efi332/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bsppost bspstart bspclean main sbrk setvec
     14C_PIECES=bsplibc bsppost bspstart bspclean main sbrk setvec
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/efi332/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
    54 *  The generic CPU dependent initialization has been performed
    65 *  before this routine is invoked.
    7  *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    116 *
    127 *  COPYRIGHT (c) 1989-1998.
     
    3934char *rtems_progname;
    4035
    41 /*      Initialize whatever libc we are using
    42  *      called from postdriver hook
     36/*
     37 *  Use the shared implementations of the following routines
    4338 */
     39 
     40void bsp_postdriver_hook(void);
     41void bsp_libc_init( void *, unsigned32, int );
    4442
    45 void bsp_libc_init()
     43/*
     44 *  Function:   bsp_pretasking_hook
     45 *  Created:    95/03/10
     46 *
     47 *  Description:
     48 *      BSP pretasking hook.  Called just before drivers are initialized.
     49 *      Used to setup libc and install any BSP extensions.
     50 *
     51 *  NOTES:
     52 *      Must not use libc (to do io) from here, since drivers are
     53 *      not yet initialized.
     54 *
     55 */
     56 
     57void bsp_pretasking_hook(void)
    4658{
    4759/*   extern int end; */
     
    5971  }
    6072
    61   RTEMS_Malloc_Initialize((void *) heap_start,
    62                           (RAM_END - heap_start), 0);
    63    
    64   /*
    65    *  Init the RTEMS libio facility to provide UNIX-like system
    66    *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    67    *  Uses malloc() to get area for the iops, so must be after malloc init
    68    */
    69 
    70   rtems_libio_init();
    71 
    72   /*
    73    * Set up for the libc handling.
    74    */
    75  
    76   if (BSP_Configuration.ticks_per_timeslice > 0)
    77     libc_init(1);                /* reentrant if possible */
    78   else
    79     libc_init(0);                /* non-reentrant */
    80 }
    81 
    82 /*
    83  *  Function:   bsp_pretasking_hook
    84  *  Created:    95/03/10
    85  *
    86  *  Description:
    87  *      BSP pretasking hook.  Called just before drivers are initialized.
    88  *      Used to setup libc and install any BSP extensions.
    89  *
    90  *  NOTES:
    91  *      Must not use libc (to do io) from here, since drivers are
    92  *      not yet initialized.
    93  *
    94  */
    95  
    96 void
    97 bsp_pretasking_hook(void)
    98 {
    99     bsp_libc_init();
     73  bsp_libc_init((void *) heap_start, (RAM_END - heap_start), 0);
    10074 
    10175#ifdef RTEMS_DEBUG
     
    10478}
    10579 
    106  
    10780/*
    108  *  Use the shared bsp_postdriver_hook() implementation
     81 *  bsp_start
     82 *
     83 *  This routine does the bulk of the system initialization.
    10984 */
    110  
    111 void bsp_postdriver_hook(void);
    11285
    11386void bsp_start( void )
  • c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bsppost bspstart bspclean efi68k_tcp efi68k_wd main sbrk setvec
     14C_PIECES=bsplibc bsppost bspstart bspclean efi68k_tcp efi68k_wd main sbrk setvec
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
    54 *  The generic CPU dependent initialization has been performed
    65 *  before this routine is invoked.
    7  *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    116 *
    127 *  COPYRIGHT (c) 1989-1998.
     
    4439extern void breakpoint(void);
    4540
    46 /*      Initialize whatever libc we are using
    47  *      called from postdriver hook
     41/*
     42 *  Use the shared implementations of the following routines
    4843 */
     44 
     45void bsp_postdriver_hook(void);
     46void bsp_libc_init( void *, unsigned32, int );
    4947
    50 void bsp_libc_init()
     48/*
     49 *  Function:   bsp_pretasking_hook
     50 *  Created:    95/03/10
     51 *
     52 *  Description:
     53 *      BSP pretasking hook.  Called just before drivers are initialized.
     54 *      Used to setup libc and install any BSP extensions.
     55 *
     56 *  NOTES:
     57 *      Must not use libc (to do io) from here, since drivers are
     58 *      not yet initialized.
     59 *
     60 */
     61 
     62void bsp_pretasking_hook(void)
    5163{
    5264/*   extern int end; */
     
    6476  }
    6577
    66   RTEMS_Malloc_Initialize((void *) heap_start,
    67                           (RAM_END - heap_start), 0);
    68    
    69   /*
    70    *  Init the RTEMS libio facility to provide UNIX-like system
    71    *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    72    *  Uses malloc() to get area for the iops, so must be after malloc init
    73    */
    74 
    75   rtems_libio_init();
    76 
    77   /*
    78    * Set up for the libc handling.
    79    */
    80  
    81   if (BSP_Configuration.ticks_per_timeslice > 0)
    82     libc_init(1);                /* reentrant if possible */
    83   else
    84     libc_init(0);                /* non-reentrant */
    85 }
    86  
    87 /*
    88  *  Function:   bsp_pretasking_hook
    89  *  Created:    95/03/10
    90  *
    91  *  Description:
    92  *      BSP pretasking hook.  Called just before drivers are initialized.
    93  *      Used to setup libc and install any BSP extensions.
    94  *
    95  *  NOTES:
    96  *      Must not use libc (to do io) from here, since drivers are
    97  *      not yet initialized.
    98  *
    99  */
    100  
    101 void
    102 bsp_pretasking_hook(void)
    103 {
    104     bsp_libc_init();
     78  bsp_libc_init((void *) heap_start, (RAM_END - heap_start), 0);
    10579 
    10680#ifdef RTEMS_DEBUG
     
    10983}
    11084 
    111  
    11285/*
    113  *  Use the shared bsp_postdriver_hook() implementation
     86 *  bsp_start
     87 *
     88 *  This routine does the bulk of the system initialization.
    11489 */
    115  
    116 void bsp_postdriver_hook(void);
    117 
    11890
    11991void bsp_start( void )
  • c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bspclean bsppost bspstart main sbrk setvec
     14C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
    54 *  The generic CPU dependent initialization has been performed
    65 *  before this routine is invoked.
    7  *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    116 *
    127 *  COPYRIGHT (c) 1989-1998.
     
    4035char *rtems_progname;
    4136
    42 /*      Initialize whatever libc we are using
    43  *      called from postdriver hook
     37/*
     38 *  Use the shared implementations of the following routines
    4439 */
    45 
    46 void bsp_libc_init()
    47 {
    48     extern int end;
    49     rtems_unsigned32        heap_start;
    50 
    51     heap_start = (rtems_unsigned32) &end;
    52     if (heap_start & (CPU_ALIGNMENT-1))
    53         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    54 
    55     /*
    56      *  The last parameter to RTEMS_Malloc_Initialize is the "chunk"
    57      *  size which a multiple of will be requested on each sbrk()
    58      *  call by malloc().  A value of 0 indicates that sbrk() should
    59      *  not be called to extend the heap.
    60      */
    61 
    62     RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0);
    63 
    64     /*
    65      *  Init the RTEMS libio facility to provide UNIX-like system
    66      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    67      *  Uses malloc() to get area for the iops, so must be after malloc init
    68      */
    69 
    70     rtems_libio_init();
    71 
    72     /*
    73      * Set up for the libc handling.
    74      */
    75 
    76     if (BSP_Configuration.ticks_per_timeslice > 0)
    77         libc_init(1);                /* reentrant if possible */
    78     else
    79         libc_init(0);                /* non-reentrant */
    80 }
     40 
     41void bsp_postdriver_hook(void);
     42void bsp_libc_init( void *, unsigned32, int );
    8143
    8244/*
     
    9456 */
    9557 
    96 void
    97 bsp_pretasking_hook(void)
     58void bsp_pretasking_hook(void)
    9859{
    99     bsp_libc_init();
     60    extern int end;
     61    rtems_unsigned32        heap_start;
     62
     63    heap_start = (rtems_unsigned32) &end;
     64    if (heap_start & (CPU_ALIGNMENT-1))
     65        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     66
     67    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
     68
    10069 
    10170#ifdef RTEMS_DEBUG
     
    10372#endif
    10473}
    105  
    10674
    10775/*
    108  *  Use the shared bsp_postdriver_hook() implementation
     76 *  bsp_start
     77 *
     78 *  This routine does the bulk of the system initialization.
    10979 */
    110  
    111 void bsp_postdriver_hook(void);
    112 
    11380
    11481void bsp_start( void )
  • c/src/lib/libbsp/m68k/gen68360/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=alloc360 bspclean bsppost bspstart init68360 main sbrk setvec
     14C_PIECES=alloc360 bspclean bsplibc bsppost bspstart init68360 main sbrk setvec
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/gen68360/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
    54 *  The generic CPU dependent initialization has been performed
    65 *  before this routine is invoked.
    7  *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    116 *
    127 *  COPYRIGHT (c) 1989-1998.
     
    4035char *rtems_progname;
    4136
    42 /*      Initialize whatever libc we are using
    43  *      called from postdriver hook
     37/*
     38 *  Use the shared implementations of the following routines
    4439 */
    45 
    46 void bsp_libc_init()
    47 {
    48     extern void *_HeapStart;
    49     extern rtems_unsigned32 _HeapSize;
    50 
    51     /*
    52      *  The last parameter to RTEMS_Malloc_Initialize is the "chunk"
    53      *  size which a multiple of will be requested on each sbrk()
    54      *  call by malloc().  A value of 0 indicates that sbrk() should
    55      *  not be called to extend the heap.
    56      */
    57 
    58     RTEMS_Malloc_Initialize(&_HeapStart, _HeapSize, 0);
    59 
    60     /*
    61      *  Init the RTEMS libio facility to provide UNIX-like system
    62      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    63      *  Uses malloc() to get area for the iops, so must be after malloc init
    64      */
    65 
    66     rtems_libio_init();
    67 
    68     /*
    69      * Set up for the libc handling.
    70      */
    71 
    72     if (BSP_Configuration.ticks_per_timeslice > 0)
    73         libc_init(1);                /* reentrant if possible */
    74     else
    75         libc_init(0);                /* non-reentrant */
    76 }
     40 
     41void bsp_postdriver_hook(void);
     42void bsp_libc_init( void *, unsigned32, int );
    7743
    7844/*
     
    9056 */
    9157 
    92 void
    93 bsp_pretasking_hook(void)
     58void bsp_pretasking_hook(void)
    9459{
    95     bsp_libc_init();
     60    extern void *_HeapStart;
     61    extern rtems_unsigned32 _HeapSize;
     62
     63    bsp_libc_init(&_HeapStart, _HeapSize, 0);
    9664 
    9765#ifdef RTEMS_DEBUG
     
    10068}
    10169 
    102 
    10370/*
    104  *  Use the shared bsp_postdriver_hook() implementation
     71 *  bsp_start
     72 *
     73 *  This routine does the bulk of the system initialization.
    10574 */
    106  
    107 void bsp_postdriver_hook(void);
    10875
    10976void bsp_start( void )
  • c/src/lib/libbsp/m68k/idp/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bspclean bsppost bspstart main sbrk setvec
     14C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/idp/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
     
    65 *  before this routine is invoked.
    76 *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    11  *
    127 *  COPYRIGHT (c) 1989-1998.
    138 *  On-Line Applications Research Corporation (OAR).
     
    4742char *rtems_progname;
    4843
    49 /*      Initialize whatever libc we are using
    50  *      called from postdriver hook
     44/*
     45 *  Use the shared implementations of the following routines
    5146 */
    5247 
    53 void bsp_libc_init()
    54 {
    55     extern int end;
    56     rtems_unsigned32        heap_start;
    57  
    58     heap_start = (rtems_unsigned32) &end;
    59     if (heap_start & (CPU_ALIGNMENT-1))
    60         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    61  
    62         /* Create 64 KByte memory region for RTEMS executive */
    63     RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0);
    64 
    65     /*
    66      *  Init the RTEMS libio facility to provide UNIX-like system
    67      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    68      *  Uses malloc() to get area for the iops, so must be after malloc init
    69      */
    70 
    71     rtems_libio_init();
    72  
    73     /*
    74      * Set up for the libc handling.
    75      */
    76  
    77     if (BSP_Configuration.ticks_per_timeslice > 0)
    78         libc_init(1);                /* reentrant if possible */
    79         else
    80         libc_init(0);                /* non-reentrant */
    81 }
     48void bsp_postdriver_hook(void);
     49void bsp_libc_init( void *, unsigned32, int );
    8250
    8351/*
     
    9563 */
    9664 
    97 void
    98 bsp_pretasking_hook(void)
     65void bsp_pretasking_hook(void)
    9966{
    100     bsp_libc_init();
     67    extern int end;
     68    rtems_unsigned32        heap_start;
     69 
     70    heap_start = (rtems_unsigned32) &end;
     71    if (heap_start & (CPU_ALIGNMENT-1))
     72        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     73 
     74        /* Create 64 KByte memory region for RTEMS executive */
     75    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
    10176 
    10277#ifdef RTEMS_DEBUG
     
    10580}
    10681 
    107 
    10882/*
    109  *  Use the shared bsp_postdriver_hook() implementation
     83 *  bsp_start
     84 *
     85 *  This routine does the bulk of the system initialization.
    11086 */
    111  
    112 void bsp_postdriver_hook(void);
    11387
    11488void bsp_start( void )
  • c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bspclean bsppost bspstart main sbrk setvec
     14C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
    54 *  The generic CPU dependent initialization has been performed
    65 *  before this routine is invoked.
    7  *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    116 *
    127 *  COPYRIGHT (c) 1989-1998.
     
    4136char *rtems_progname;
    4237
    43 /*      Initialize whatever libc we are using
    44  *      called from postdriver hook
     38/*
     39 *  Use the shared implementations of the following routines
    4540 */
    46 
    47 void bsp_libc_init()
    48 {
    49     extern int end;
    50     rtems_unsigned32        heap_start;
    51 
    52     heap_start = (rtems_unsigned32) &end;
    53     if (heap_start & (CPU_ALIGNMENT-1))
    54         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    55 
    56     RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0);
    57 
    58     /*
    59      *  Init the RTEMS libio facility to provide UNIX-like system
    60      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    61      *  Uses malloc() to get area for the iops, so must be after malloc init
    62      */
    63 
    64     rtems_libio_init();
    65 
    66     /*
    67      * Set up for the libc handling.
    68      */
    69 
    70     if (BSP_Configuration.ticks_per_timeslice > 0)
    71         libc_init(1);                /* reentrant if possible */
    72     else
    73         libc_init(0);                /* non-reentrant */
    74 }
     41 
     42void bsp_postdriver_hook(void);
     43void bsp_libc_init( void *, unsigned32, int );
    7544
    7645/*
     
    8857 */
    8958 
    90 void
    91 bsp_pretasking_hook(void)
     59void bsp_pretasking_hook(void)
    9260{
    93     bsp_libc_init();
     61    extern int end;
     62    rtems_unsigned32        heap_start;
     63
     64    heap_start = (rtems_unsigned32) &end;
     65    if (heap_start & (CPU_ALIGNMENT-1))
     66        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     67
     68    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
     69
    9470 
    9571#ifdef RTEMS_DEBUG
     
    9773#endif
    9874}
    99  
     75
    10076/*
    101  *  Use the shared bsp_postdriver_hook() implementation
     77 *  bsp_start
     78 *
     79 *  This routine does the bulk of the system initialization.
    10280 */
    103  
    104 void bsp_postdriver_hook(void);
    10581
    10682void bsp_start( void )
  • c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bspclean bsppost bspstart main sbrk setvec
     14C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
    54 *  The generic CPU dependent initialization has been performed
    65 *  before this routine is invoked.
    7  *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    116 *
    127 *  COPYRIGHT (c) 1989-1998.
     
    4439char *rtems_progname;
    4540
    46 /*      Initialize whatever libc we are using
    47  *      called from postdriver hook
     41/*
     42 *  Use the shared implementations of the following routines
    4843 */
    49 
    50 void bsp_libc_init()
    51 {
    52     extern int end;
    53     rtems_unsigned32        heap_start;
    54 
    55     heap_start = (rtems_unsigned32) &end;
    56     if (heap_start & (CPU_ALIGNMENT-1))
    57         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    58 
    59     RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0);
    60 
    61     /*
    62      *  Init the RTEMS libio facility to provide UNIX-like system
    63      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    64      *  Uses malloc() to get area for the iops, so must be after malloc init
    65      */
    66 
    67     rtems_libio_init();
    68 
    69     /*
    70      * Set up for the libc handling.
    71      */
    72 
    73     if (BSP_Configuration.ticks_per_timeslice > 0)
    74         libc_init(1);                /* reentrant if possible */
    75     else
    76         libc_init(0);                /* non-reentrant */
    77 }
     44 
     45void bsp_postdriver_hook(void);
     46void bsp_libc_init( void *, unsigned32, int );
    7847
    7948/*
     
    9160 */
    9261 
    93 void
    94 bsp_pretasking_hook(void)
     62void bsp_pretasking_hook(void)
    9563{
    96     bsp_libc_init();
     64    extern int end;
     65    rtems_unsigned32        heap_start;
     66
     67    heap_start = (rtems_unsigned32) &end;
     68    if (heap_start & (CPU_ALIGNMENT-1))
     69        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     70
     71    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
     72
    9773 
    9874#ifdef RTEMS_DEBUG
     
    10177}
    10278 
    103 
    10479/*
    105  *  Use the shared bsp_postdriver_hook() implementation
     80 *  bsp_start
     81 *
     82 *  This routine does the bulk of the system initialization.
    10683 */
    107  
    108 void bsp_postdriver_hook(void);
    109 
    11084
    11185void bsp_start( void )
  • c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bspclean bsppost bspstart main sbrk setvec
     14C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
     
    65 *  before this routine is invoked.
    76 *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    11  *
    127 *  COPYRIGHT (c) 1989-1998.
    138 *  On-Line Applications Research Corporation (OAR).
     
    4439char *rtems_progname;
    4540
    46 /*      Initialize whatever libc we are using
    47  *      called from postdriver hook
    48  */
    49 
    50 void bsp_libc_init()
     41/*
     42 *  Use the shared implementations of the following routines
     43 */
     44 
     45void bsp_postdriver_hook(void);
     46void bsp_libc_init( void *, unsigned32, int );
     47
     48/*
     49 *  Function:   bsp_pretasking_hook
     50 *  Created:    95/03/10
     51 *
     52 *  Description:
     53 *      BSP pretasking hook.  Called just before drivers are initialized.
     54 *      Used to setup libc and install any BSP extensions.
     55 *
     56 *  NOTES:
     57 *      Must not use libc (to do io) from here, since drivers are
     58 *      not yet initialized.
     59 *
     60 */
     61 
     62void bsp_pretasking_hook(void)
    5163{
    5264    extern int end;
     
    5769        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    5870
    59     RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0);
    60 
    61     /*
    62      *  Init the RTEMS libio facility to provide UNIX-like system
    63      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    64      *  Uses malloc() to get area for the iops, so must be after malloc init
    65      */
    66 
    67     rtems_libio_init();
    68 
    69     /*
    70      * Set up for the libc handling.
    71      */
    72 
    73     if (BSP_Configuration.ticks_per_timeslice > 0)
    74         libc_init(1);                /* reentrant if possible */
    75     else
    76         libc_init(0);                /* non-reentrant */
    77 }
    78 
    79 /*
    80  *  Function:   bsp_pretasking_hook
    81  *  Created:    95/03/10
    82  *
    83  *  Description:
    84  *      BSP pretasking hook.  Called just before drivers are initialized.
    85  *      Used to setup libc and install any BSP extensions.
    86  *
    87  *  NOTES:
    88  *      Must not use libc (to do io) from here, since drivers are
    89  *      not yet initialized.
    90  *
    91  */
    92  
    93 void
    94 bsp_pretasking_hook(void)
    95 {
    96     bsp_libc_init();
     71    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
    9772 
    9873#ifdef RTEMS_DEBUG
     
    10176}
    10277 
    103 
    104 /*
    105  *  Use the shared bsp_postdriver_hook() implementation
    106  */
    107  
    108 void bsp_postdriver_hook(void);
    109 
     78/*
     79 *  bsp_start
     80 *
     81 *  This routine does the bulk of the system initialization.
     82 */
    11083
    11184void bsp_start( void )
  • c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bspclean bsppost bspstart main page_table sbrk setvec
     14C_PIECES=bspclean bsplibc bsppost bspstart main page_table sbrk setvec
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
    54 *  The generic CPU dependent initialization has been performed
    65 *  before this routine is invoked.
    7  *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    116 *
    127 *  COPYRIGHT (c) 1989-1998.
     
    4843char *rtems_progname;
    4944
    50 /*      Initialize whatever libc we are using
    51  *      called from postdriver hook
     45/*
     46 *  Use the shared implementations of the following routines
    5247 */
    53 
    54 void bsp_libc_init()
    55 {
    56     extern int end;
    57     rtems_unsigned32        heap_start;
    58 
    59     heap_start = (rtems_unsigned32) &end;
    60     if (heap_start & (CPU_ALIGNMENT-1))
    61         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    62 
    63     RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0);
    64 
    65     /*
    66      *  Init the RTEMS libio facility to provide UNIX-like system
    67      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    68      *  Uses malloc() to get area for the iops, so must be after malloc init
    69      */
    70 
    71     rtems_libio_init();
    72 
    73     /*
    74      * Set up for the libc handling.
    75      */
    76 
    77     if (BSP_Configuration.ticks_per_timeslice > 0)
    78         libc_init(1);                /* reentrant if possible */
    79     else
    80         libc_init(0);                /* non-reentrant */
    81 }
     48 
     49void bsp_postdriver_hook(void);
     50void bsp_libc_init( void *, unsigned32, int );
    8251
    8352/*
     
    9564 */
    9665 
    97 void
    98 bsp_pretasking_hook(void)
     66void bsp_pretasking_hook(void)
    9967{
    100     bsp_libc_init();
     68    extern int end;
     69    rtems_unsigned32        heap_start;
     70
     71    heap_start = (rtems_unsigned32) &end;
     72    if (heap_start & (CPU_ALIGNMENT-1))
     73        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     74
     75    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
    10176 
    10277#ifdef RTEMS_DEBUG
     
    10479#endif
    10580}
    106  
    10781
    10882/*
    109  *  Use the shared bsp_postdriver_hook() implementation
     83 *  bsp_start
     84 *
     85 *  This routine does the bulk of the system initialization.
    11086 */
    111  
    112 void bsp_postdriver_hook(void);
    113 
    11487
    11588void bsp_start( void )
  • c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1313# C source names, if any, go here -- minus the .c
    1414C_PIECES=crc debugport gdb-hooks main m68302scc m68k-stub memcheck trace \
    15                 bsppost bspstart bspclean sbrk setvec
     15                bsplibc bsppost bspstart bspclean sbrk setvec
    1616C_FILES=$(C_PIECES:%=%.c)
    1717C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
    54 *  The generic CPU dependent initialization has been performed
    65 *  before this routine is invoked.
    7  *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    116 *
    127 *  COPYRIGHT (c) 1989-1998.
     
    4136char *rtems_progname;
    4237
    43 /*      Initialize whatever libc we are using
    44  *      called from postdriver hook
     38/*
     39 *  Use the shared implementations of the following routines
    4540 */
    46 
    47 void bsp_libc_init()
    48 {
    49     extern int end;
    50     rtems_unsigned32        heap_start;
    51 
    52     heap_start = (rtems_unsigned32) &end;
    53     if (heap_start & (CPU_ALIGNMENT-1))
    54         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    55 
    56     /*
    57      *  The last parameter to RTEMS_Malloc_Initialize is the "chunk"
    58      *  size which a multiple of will be requested on each sbrk()
    59      *  call by malloc().  A value of 0 indicates that sbrk() should
    60      *  not be called to extend the heap.
    61      */
    62 
    63     RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0);
    64 
    65     /*
    66      *  Init the RTEMS libio facility to provide UNIX-like system
    67      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    68      *  Uses malloc() to get area for the iops, so must be after malloc init
    69      */
    70 
    71     rtems_libio_init();
    72 
    73     /*
    74      * Set up for the libc handling.
    75      */
    76 
    77     if (BSP_Configuration.ticks_per_timeslice > 0)
    78         libc_init(1);                /* reentrant if possible */
    79     else
    80         libc_init(0);                /* non-reentrant */
    81 }
     41 
     42void bsp_postdriver_hook(void);
     43void bsp_libc_init( void *, unsigned32, int );
    8244
    8345/*
     
    9557 */
    9658 
    97 void
    98 bsp_pretasking_hook(void)
     59void bsp_pretasking_hook(void)
    9960{
    100     bsp_libc_init();
     61    extern int end;
     62    rtems_unsigned32        heap_start;
     63
     64    heap_start = (rtems_unsigned32) &end;
     65    if (heap_start & (CPU_ALIGNMENT-1))
     66        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     67
     68    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
    10169 
    10270#ifdef RTEMS_DEBUG
     
    10573}
    10674 
    107 
    10875/*
    109  *  Use the shared bsp_postdriver_hook() implementation
     76 *  bsp_start
     77 *
     78 *  This routine does the bulk of the system initialization.
    11079 */
    111  
    112 void bsp_postdriver_hook(void);
    11380
    11481void bsp_start( void )
  • c/src/lib/libbsp/mips/p4000/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
    54 *  The generic CPU dependent initialization has been performed
    65 *  before this routine is invoked.
    7  *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    116 *
    127 *  COPYRIGHT (c) 1989-1998.
     
    4944char *rtems_progname;
    5045
    51 /*      Initialize whatever libc we are using
    52  *      called from postdriver hook
     46/*
     47 *  Use the shared implementations of the following routines
    5348 */
    54 
    55 #define LIBC_HEAP_SIZE (64 * 1024)
    56 
    57 void bsp_libc_init()
    58 {
    59     extern int end;
    60     rtems_unsigned32        heap_start;
    61 
    62     heap_start = (rtems_unsigned32) &end;
    63     if (heap_start & (CPU_ALIGNMENT-1))
    64         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    65 
    66     /*
    67      *  The last parameter to RTEMS_Malloc_Initialize is the "chunk"
    68      *  size which a multiple of will be requested on each sbrk()
    69      *  call by malloc().  A value of 0 indicates that sbrk() should
    70      *  not be called to extend the heap.
    71      */
    72 
    73     RTEMS_Malloc_Initialize((void *) heap_start, LIBC_HEAP_SIZE, 0);
    74 
    75     /*
    76      *  Init the RTEMS libio facility to provide UNIX-like system
    77      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    78      *  Uses malloc() to get area for the iops, so must be after malloc init
    79      */
    80 
    81     rtems_libio_init();
    82 
    83     /*
    84      * Set up for the libc handling.
    85      */
    86 
    87     if (BSP_Configuration.ticks_per_timeslice > 0)
    88         libc_init(1);                /* reentrant if possible */
    89     else
    90         libc_init(0);                /* non-reentrant */
    91 }
     49 
     50void bsp_postdriver_hook(void);
     51void bsp_libc_init( void *, unsigned32, int );
    9252
    9353/*
     
    10565 */
    10666 
    107 void
    108 bsp_pretasking_hook(void)
     67#define LIBC_HEAP_SIZE (64 * 1024)
     68
     69void bsp_pretasking_hook(void)
    10970{
    110     bsp_libc_init();
    111  
     71    extern int end;
     72    rtems_unsigned32        heap_start;
     73
     74    heap_start = (rtems_unsigned32) &end;
     75    if (heap_start & (CPU_ALIGNMENT-1))
     76        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     77
     78    bsp_libc_init((void *) heap_start, LIBC_HEAP_SIZE, 0);
     79
    11280#ifdef RTEMS_DEBUG
    11381    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
     
    11583}
    11684 
     85extern int end; /* defined by linker */
     86
    11787/*
    118  *  Use the shared bsp_postdriver_hook() implementation
     88 *  bsp_start
     89 *
     90 *  This routine does the bulk of the system initialization.
    11991 */
    120  
    121 void bsp_postdriver_hook(void);
    122 
    123 extern int end; /* defined by linker */
    12492
    12593void bsp_start( void )
  • c/src/lib/libbsp/mips64orion/p4000/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bspclean bsppost bspstart main sbrk setvec inittlb
     14C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec inittlb
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/mips64orion/p4000/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
    54 *  The generic CPU dependent initialization has been performed
    65 *  before this routine is invoked.
    7  *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    116 *
    127 *  COPYRIGHT (c) 1989-1998.
     
    4944char *rtems_progname;
    5045
    51 /*      Initialize whatever libc we are using
    52  *      called from postdriver hook
     46/*
     47 *  Use the shared implementations of the following routines
    5348 */
    54 
    55 #define LIBC_HEAP_SIZE (64 * 1024)
    56 
    57 void bsp_libc_init()
    58 {
    59     extern int end;
    60     rtems_unsigned32        heap_start;
    61 
    62     heap_start = (rtems_unsigned32) &end;
    63     if (heap_start & (CPU_ALIGNMENT-1))
    64         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    65 
    66     /*
    67      *  The last parameter to RTEMS_Malloc_Initialize is the "chunk"
    68      *  size which a multiple of will be requested on each sbrk()
    69      *  call by malloc().  A value of 0 indicates that sbrk() should
    70      *  not be called to extend the heap.
    71      */
    72 
    73     RTEMS_Malloc_Initialize((void *) heap_start, LIBC_HEAP_SIZE, 0);
    74 
    75     /*
    76      *  Init the RTEMS libio facility to provide UNIX-like system
    77      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    78      *  Uses malloc() to get area for the iops, so must be after malloc init
    79      */
    80 
    81     rtems_libio_init();
    82 
    83     /*
    84      * Set up for the libc handling.
    85      */
    86 
    87     if (BSP_Configuration.ticks_per_timeslice > 0)
    88         libc_init(1);                /* reentrant if possible */
    89     else
    90         libc_init(0);                /* non-reentrant */
    91 }
     49 
     50void bsp_postdriver_hook(void);
     51void bsp_libc_init( void *, unsigned32, int );
    9252
    9353/*
     
    10565 */
    10666 
    107 void
    108 bsp_pretasking_hook(void)
     67#define LIBC_HEAP_SIZE (64 * 1024)
     68
     69void bsp_pretasking_hook(void)
    10970{
    110     bsp_libc_init();
    111  
     71    extern int end;
     72    rtems_unsigned32        heap_start;
     73
     74    heap_start = (rtems_unsigned32) &end;
     75    if (heap_start & (CPU_ALIGNMENT-1))
     76        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     77
     78    bsp_libc_init((void *) heap_start, LIBC_HEAP_SIZE, 0);
     79
    11280#ifdef RTEMS_DEBUG
    11381    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
     
    11583}
    11684 
     85extern int end; /* defined by linker */
     86
    11787/*
    118  *  Use the shared bsp_postdriver_hook() implementation
     88 *  bsp_start
     89 *
     90 *  This routine does the bulk of the system initialization.
    11991 */
    120  
    121 void bsp_postdriver_hook(void);
    122 
    123 extern int end; /* defined by linker */
    12492
    12593void bsp_start( void )
  • c/src/lib/libbsp/no_cpu/no_bsp/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bspclean bsppost bspstart main sbrk setvec
     14C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
    54 *  The generic CPU dependent initialization has been performed
    65 *  before this routine is invoked.
    7  *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    116 *
    127 *  COPYRIGHT (c) 1989-1998.
     
    4136char *rtems_progname;
    4237
    43 /*      Initialize whatever libc we are using
    44  *      called from postdriver hook
     38/*
     39 *  Use the shared implementations of the following routines
    4540 */
    46 
    47 void bsp_libc_init()
    48 {
    49     extern int end;
    50     rtems_unsigned32        heap_start;
    51 
    52     heap_start = (rtems_unsigned32) &end;
    53     if (heap_start & (CPU_ALIGNMENT-1))
    54         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    55 
    56     /*
    57      *  The last parameter to RTEMS_Malloc_Initialize is the "chunk"
    58      *  size which a multiple of will be requested on each sbrk()
    59      *  call by malloc().  A value of 0 indicates that sbrk() should
    60      *  not be called to extend the heap.
    61      */
    62 
    63     RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0);
    64 
    65     /*
    66      *  Init the RTEMS libio facility to provide UNIX-like system
    67      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    68      *  Uses malloc() to get area for the iops, so must be after malloc init
    69      */
    70 
    71     rtems_libio_init();
    72 
    73     /*
    74      * Set up for the libc handling.
    75      */
    76 
    77     if (BSP_Configuration.ticks_per_timeslice > 0)
    78         libc_init(1);                /* reentrant if possible */
    79     else
    80         libc_init(0);                /* non-reentrant */
    81 }
     41 
     42void bsp_postdriver_hook(void);
     43void bsp_libc_init( void *, unsigned32, int );
    8244
    8345/*
     
    9557 */
    9658 
    97 void
    98 bsp_pretasking_hook(void)
     59void bsp_pretasking_hook(void)
    9960{
    100     bsp_libc_init();
    101  
     61    extern int end;
     62    rtems_unsigned32        heap_start;
     63
     64    heap_start = (rtems_unsigned32) &end;
     65    if (heap_start & (CPU_ALIGNMENT-1))
     66        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     67
     68    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
     69
    10270#ifdef RTEMS_DEBUG
    10371    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
     
    10573}
    10674 
    107 
    10875/*
    109  *  Use the shared bsp_postdriver_hook() implementation
     76 *  bsp_start
     77 *
     78 *  This routine does the bulk of the system initialization.
    11079 */
    111  
    112 void bsp_postdriver_hook(void);
    11380
    11481int bsp_start(
  • c/src/lib/libbsp/powerpc/papyrus/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bspclean bsppost bspstart main sbrk setvec
     14C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
     1/*
    22 *
    33 *  This routine starts the application.  It includes application,
     
    55 *  The generic CPU dependent initialization has been performed
    66 *  before this routine is invoked.
    7  *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    117 *
    128 *  Author:     Andrew Bray <andy@i-cubed.co.uk>
     
    5854char *rtems_progname;
    5955
    60 /*      Initialize whatever libc we are using
    61  *      called from postdriver hook
     56/*
     57 *  Use the shared implementations of the following routines
    6258 */
    63 
    64 void bsp_libc_init()
    65 {
    66     extern int _end;
    67     rtems_unsigned32        heap_start;
    68 
    69     heap_start = (rtems_unsigned32) &_end;
    70     if (heap_start & (CPU_ALIGNMENT-1))
    71         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    72 
    73     /*
    74      *  The last parameter to RTEMS_Malloc_Initialize is the "chunk"
    75      *  size which a multiple of will be requested on each sbrk()
    76      *  call by malloc().  A value of 0 indicates that sbrk() should
    77      *  not be called to extend the heap.
    78      */
    79 
    80     RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0);
    81 
    82     /*
    83      *  Init the RTEMS libio facility to provide UNIX-like system
    84      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    85      *  Uses malloc() to get area for the iops, so must be after malloc init
    86      */
    87 
    88     rtems_libio_init();
    89 
    90     /*
    91      * Set up for the libc handling.
    92      */
    93 
    94     if (BSP_Configuration.ticks_per_timeslice > 0)
    95         libc_init(1);                /* reentrant if possible */
    96     else
    97         libc_init(0);                /* non-reentrant */
    98 
    99 }
     59 
     60void bsp_postdriver_hook(void);
     61void bsp_libc_init( void *, unsigned32, int );
    10062
    10163/*
     
    11375 */
    11476 
    115 void
    116 bsp_pretasking_hook(void)
     77void bsp_pretasking_hook(void)
    11778{
    118     bsp_libc_init();
     79    extern int _end;
     80    rtems_unsigned32        heap_start;
     81
     82    heap_start = (rtems_unsigned32) &_end;
     83    if (heap_start & (CPU_ALIGNMENT-1))
     84        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     85
     86    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
    11987 
    12088#ifdef RTEMS_DEBUG
     
    12391}
    12492 
    125 
    12693/*
    127  *  Use the shared bsp_postdriver_hook() implementation
     94 *  bsp_start
     95 *
     96 *  This routine does the bulk of the system initialization.
    12897 */
    129  
    130 void bsp_postdriver_hook(void);
    131 
    13298
    13399void bsp_start( void )
  • c/src/lib/libbsp/powerpc/psim/clock/clock.c

    rb3d3a34e rb6394ae  
    77 *  microseconds per tick.
    88 *
    9  *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997.
     9 *  COPYRIGHT (c) 1989-1998.
    1010 *  On-Line Applications Research Corporation (OAR).
    11  *  All rights assigned to U.S. Government, 1994.
    12  *
    13  *  This material may be reproduced by or for the U.S. Government pursuant
    14  *  to the copyright license under the clause at DFARS 252.227-7013.  This
    15  *  notice must appear in all copies of this file and its derivatives.
     11 *  Copyright assigned to U.S. Government, 1994.
     12 *
     13 *  The license and distribution terms for this file may be
     14 *  found in found in the file LICENSE in this distribution or at
     15 *  http://www.OARcorp.com/rtems/license.html.
    1616 *
    1717 *  $Id$
  • c/src/lib/libbsp/powerpc/psim/include/bsp.h

    rb3d3a34e rb6394ae  
    2020 *  Derived from c/src/lib/libbsp/no_cpu/no_bsp/include/bsp.h
    2121 *
    22  *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
     22 *  COPYRIGHT (c) 1989-1998.
    2323 *  On-Line Applications Research Corporation (OAR).
    24  *  All rights assigned to U.S. Government, 1994.
     24 *  Copyright assigned to U.S. Government, 1994.
    2525 *
    26  *  This material may be reproduced by or for the U.S. Government pursuant
    27  *  to the copyright license under the clause at DFARS 252.227-7013.  This
    28  *  notice must appear in all copies of this file and its derivatives.
     26 *  The license and distribution terms for this file may be
     27 *  found in found in the file LICENSE in this distribution or at
     28 *  http://www.OARcorp.com/rtems/license.html.
    2929 *
    3030 *  $Id$
  • c/src/lib/libbsp/powerpc/psim/include/coverhd.h

    rb3d3a34e rb6394ae  
    1515 *         all calling overhead including passing of arguments.
    1616 *
    17  *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
     17 *  COPYRIGHT (c) 1989-1998.
    1818 *  On-Line Applications Research Corporation (OAR).
    19  *  All rights assigned to U.S. Government, 1994.
     19 *  Copyright assigned to U.S. Government, 1994.
    2020 *
    21  *  This material may be reproduced by or for the U.S. Government pursuant
    22  *  to the copyright license under the clause at DFARS 252.227-7013.  This
    23  *  notice must appear in all copies of this file and its derivatives.
     21 *  The license and distribution terms for this file may be
     22 *  found in found in the file LICENSE in this distribution or at
     23 *  http://www.OARcorp.com/rtems/license.html.
    2424 *
    2525 *  $Id$
  • c/src/lib/libbsp/powerpc/psim/shmsupp/README

    rb3d3a34e rb6394ae  
    44
    55This shared memory driver support code works with a modified version
    6 of the PowerPC Sim
     6of the PowerPC Simulator.  The modifications are not yet merged
     7into the mainsteam distribution.
  • c/src/lib/libbsp/powerpc/psim/shmsupp/addrconv.c

    rb3d3a34e rb6394ae  
    99 *    returns - converted address
    1010 *
    11  *  COPYRIGHT (c) 1989-1997.
     11 *  COPYRIGHT (c) 1989-1998.
    1212 *  On-Line Applications Research Corporation (OAR).
    1313 *  Copyright assigned to U.S. Government, 1994.
    1414 *
    15  *  The license and distribution terms for this file may in
    16  *  the file LICENSE in this distribution or at
     15 *  The license and distribution terms for this file may be
     16 *  found in found in the file LICENSE in this distribution or at
    1717 *  http://www.OARcorp.com/rtems/license.html.
    1818 *
  • c/src/lib/libbsp/powerpc/psim/shmsupp/getcfg.c

    rb3d3a34e rb6394ae  
    1313 *  NOTES:  No interrupt support.
    1414 *
    15  *  COPYRIGHT (c) 1989-1997.
     15 *  COPYRIGHT (c) 1989-1998.
    1616 *  On-Line Applications Research Corporation (OAR).
    1717 *  Copyright assigned to U.S. Government, 1994.
    1818 *
    19  *  The license and distribution terms for this file may in
    20  *  the file LICENSE in this distribution or at
     19 *  The license and distribution terms for this file may be
     20 *  found in found in the file LICENSE in this distribution or at
    2121 *  http://www.OARcorp.com/rtems/license.html.
    2222 *
  • c/src/lib/libbsp/powerpc/psim/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bspclean bsppost bspstart main sbrk setvec
     14C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/powerpc/psim/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bspstart.c
    2  *
     1/*
    32 *  This set of routines starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
     
    65 *  before any of these are invoked.
    76 *
    8  *  Called by RTEMS::RTEMS constructor in rtems-ctor.cc
    9  *
    10  *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997.
     7 *  COPYRIGHT (c) 1989-1998.
    118 *  On-Line Applications Research Corporation (OAR).
    129 *  All rights assigned to U.S. Government, 1994.
    1310 *
    14  *  This material may be reproduced by or for the U.S. Government pursuant
    15  *  to the copyright license under the clause at DFARS 252.227-7013.  This
    16  *  notice must appear in all copies of this file and its derivatives.
     11 *  The license and distribution terms for this file may be
     12 *  found in the file LICENSE in this distribution or at
     13 *  http://www.OARcorp.com/rtems/license.html.
    1714 *
    1815 *  $Id$
     
    6966 */
    7067
    71 rtems_extension
    72 fast_idle_switch_hook(rtems_tcb *current_task,
    73                       rtems_tcb *heir_task)
     68rtems_extension fast_idle_switch_hook(
     69  rtems_tcb *current_task,
     70  rtems_tcb *heir_task
     71)
    7472{
    7573    static rtems_unsigned32 normal_clock = ~0;
     
    10199
    102100/*
    103  *  bsp_libc_init
    104  *
    105  *  Initialize whatever libc we are using called from bsp_postdriver_hook.
    106  */
    107 
    108 void bsp_libc_init(void)
     101 *  Use the shared implementations of the following routines
     102 */
     103 
     104void bsp_postdriver_hook(void);
     105void bsp_libc_init( void *, unsigned32, int );
     106
     107/*
     108 *  bsp_pretasking_hook
     109 *
     110 *  BSP pretasking hook.  Called just before drivers are initialized.
     111 *  Used to setup libc and install any BSP extensions.
     112 */
     113
     114void bsp_pretasking_hook(void)
    109115{
    110116  extern int end;
     
    119125  heap_size &= 0xfffffff0;  /* keep it as a multiple of 16 bytes */
    120126
    121   RTEMS_Malloc_Initialize((void *) heap_start, heap_size, 0);
    122 
    123   /*
    124    *  Init the RTEMS libio facility to provide UNIX-like system
    125    *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    126    *  Uses malloc() to get area for the iops, so must be after malloc init
    127    */
    128  
    129   rtems_libio_init();
    130  
    131   /*
    132    * Set up for the libc handling.
    133    */
    134  
    135   if (BSP_Configuration.ticks_per_timeslice > 0)
    136     libc_init(1);                /* reentrant if possible */
    137   else
    138     libc_init(0);                /* non-reentrant */
    139 
    140 }
    141 
    142 
    143 /*
    144  *  bsp_pretasking_hook
    145  *
    146  *  BSP pretasking hook.  Called just before drivers are initialized.
    147  *  Used to setup libc and install any BSP extensions.
    148  */
    149 
    150 void bsp_pretasking_hook(void)
    151 {
    152   bsp_libc_init();
     127  bsp_libc_init((void *) heap_start, heap_size, 0);
    153128
    154129#if PSIM_FAST_IDLE
     
    187162
    188163}
    189 
    190 /*
    191  *  Use the shared bsp_postdriver_hook() implementation
    192  */
    193  
    194 void bsp_postdriver_hook(void);
    195164
    196165/*
  • c/src/lib/libbsp/powerpc/psim/startup/linkcmds

    rb3d3a34e rb6394ae  
     1/*
     2 *
     3 *  COPYRIGHT (c) 1989-1998.
     4 *  On-Line Applications Research Corporation (OAR).
     5 *  Copyright assigned to U.S. Government, 1994.
     6 *
     7 *  The license and distribution terms for this file may be
     8 *  found in found in the file LICENSE in this distribution or at
     9 *  http://www.OARcorp.com/rtems/license.html.
     10 *
     11 *  $Id$
     12 */
     13
    114OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
    215              "elf32-powerpc")
  • c/src/lib/libbsp/powerpc/psim/startup/setvec.c

    rb3d3a34e rb6394ae  
    3030 *  Derived from c/src/lib/libbsp/no_cpu/no_bsp/startup/setvec.c:
    3131 *
    32  *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
     32 *  COPYRIGHT (c) 1989-1998.
    3333 *  On-Line Applications Research Corporation (OAR).
    34  *  All rights assigned to U.S. Government, 1994.
     34 *  Copyright assigned to U.S. Government, 1994.
    3535 *
    36  *  This material may be reproduced by or for the U.S. Government pursuant
    37  *  to the copyright license under the clause at DFARS 252.227-7013.  This
    38  *  notice must appear in all copies of this file and its derivatives.
     36 *  The license and distribution terms for this file may be
     37 *  found in found in the file LICENSE in this distribution or at
     38 *  http://www.OARcorp.com/rtems/license.html.
    3939 *
    4040 *  $Id$
  • c/src/lib/libbsp/powerpc/psim/timer/timer.c

    rb3d3a34e rb6394ae  
    44 *  the MEC.
    55 *
    6  *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
     6 *  COPYRIGHT (c) 1989-1998.
    77 *  On-Line Applications Research Corporation (OAR).
    8  *  All rights assigned to U.S. Government, 1994.
     8 *  Copyright assigned to U.S. Government, 1994.
    99 *
    10  *  This material may be reproduced by or for the U.S. Government pursuant
    11  *  to the copyright license under the clause at DFARS 252.227-7013.  This
    12  *  notice must appear in all copies of this file and its derivatives.
     10 *  The license and distribution terms for this file may be
     11 *  found in found in the file LICENSE in this distribution or at
     12 *  http://www.OARcorp.com/rtems/license.html.
    1313 *
    1414 *  Ported to ERC32 implementation of the SPARC by On-Line Applications
  • c/src/lib/libbsp/powerpc/psim/tools/psim

    rb3d3a34e rb6394ae  
    22#
    33#  Shell script to ease invocation of the powerpc simulator
     4#
     5#  COPYRIGHT (c) 1989-1998.
     6#  On-Line Applications Research Corporation (OAR).
     7#  Copyright assigned to U.S. Government, 1994.
     8#
     9#  The license and distribution terms for this file may be
     10#  found in found in the file LICENSE in this distribution or at
     11#  http://www.OARcorp.com/rtems/license.html.
    412#
    513#  $Id$
  • c/src/lib/libbsp/powerpc/psim/tools/runtest

    rb3d3a34e rb6394ae  
    11#!/bin/sh -p
    2 #
    3 #  $Id$
    42#
    53# Run rtems tests on the powerpc simulator
     
    75# Typically the test is then run, although it can be generated
    86# and left as a file using -s
     7#
     8#  COPYRIGHT (c) 1989-1998.
     9#  On-Line Applications Research Corporation (OAR).
     10#  Copyright assigned to U.S. Government, 1994.
     11#
     12#  The license and distribution terms for this file may be
     13#  found in found in the file LICENSE in this distribution or at
     14#  http://www.OARcorp.com/rtems/license.html.
     15#
     16#  $Id$
    917#
    1018
  • c/src/lib/libbsp/powerpc/psim/vectors/vectors.s

    rb3d3a34e rb6394ae  
    22 *
    33 *  This file contains the assembly code for the PowerPC
    4  *  interrupt veneers for RTEMS.
     4 *  interrupt vectors for RTEMS.
    55 *
     6 *  COPYRIGHT (c) 1989-1998.
     7 *  On-Line Applications Research Corporation (OAR).
     8 *  Copyright assigned to U.S. Government, 1994.
     9 *
     10 *  The license and distribution terms for this file may be
     11 *  found in found in the file LICENSE in this distribution or at
     12 *  http://www.OARcorp.com/rtems/license.html.
     13 *
     14 *  $Id$
    615 */
    716
     
    2231 *  offset from 0x????0000 to the first location in the file.  This
    2332 *  will usually be 0x0000 or 0x0100.
    24  *
    25  *  $Id$
    2633 */
    2734
  • c/src/lib/libbsp/sh/gensh1/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bsppost bspstart bspclean sbrk setvec main
     14C_PIECES=bsplibc bsppost bspstart bspclean sbrk setvec main
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/sh/gensh1/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
    54 *  The generic CPU dependent initialization has been performed
    65 *  before this routine is invoked.
    7  *
    8  *  INPUT:  NONE
    9  *
    10  *  OUTPUT: NONE
    116 *
    127 *  Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
     
    5146char *rtems_progname;
    5247
    53 /*      Initialize whatever libc we are using
    54  *      called from postdriver hook
     48/*
     49 *  Use the shared implementations of the following routines
    5550 */
    56 
    57 
    58 void bsp_libc_init()
    59 {
    60     /*
    61      *  The last parameter to RTEMS_Malloc_Initialize is the "chunk"
    62      *  size which a multiple of will be requested on each sbrk()
    63      *  call by malloc().  A value of 0 indicates that sbrk() should
    64      *  not be called to extend the heap.
    65      */
    66 
    67     RTEMS_Malloc_Initialize(&HeapStart, sizeof(unsigned32) * (&HeapEnd - &HeapStart), 0);
    68 
    69     /*
    70      *  Init the RTEMS libio facility to provide UNIX-like system
    71      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    72      *  Uses malloc() to get area for the iops, so must be after malloc init
    73      */
    74 
    75     rtems_libio_init();
    76 
    77     /*
    78      * Set up for the libc handling.
    79      */
    80 
    81     if (BSP_Configuration.ticks_per_timeslice > 0)
    82         libc_init(1);                /* reentrant if possible */
    83     else
    84         libc_init(0);                /* non-reentrant */
    85 }
     51 
     52void bsp_postdriver_hook(void);
     53void bsp_libc_init( void *, unsigned32, int );
    8654
    8755/*
     
    9866 */
    9967 
    100 void
    101 bsp_pretasking_hook(void)
     68void bsp_pretasking_hook(void)
    10269{
    103     bsp_libc_init();
     70    bsp_libc_init((&HeapStart, sizeof(unsigned32) * (&HeapEnd - &HeapStart), 0);
    10471 
    10572#ifdef RTEMS_DEBUG
     
    10976
    11077/*
    111  *  Use the shared bsp_postdriver_hook() implementation
     78 *  bsp_start
     79 *
     80 *  This routine does the bulk of the system initialization.
    11281 */
    113  
    114 void bsp_postdriver_hook(void);
    115 
    11682
    11783void bsp_start(void)
  • c/src/lib/libbsp/sparc/erc32/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bspclean bsppost bspstart main sbrk setvec spurious
     14C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec spurious
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/sparc/erc32/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bspstart.c
    2  *
     1/*
    32 *  This set of routines starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
     
    65 *  before any of these are invoked.
    76 *
    8  *  Called by RTEMS::RTEMS constructor in rtems-ctor.cc
    9  *
    107 *  COPYRIGHT (c) 1989-1998.
    118 *  On-Line Applications Research Corporation (OAR).
     
    4239
    4340rtems_cpu_table   Cpu_table;
    44 rtems_unsigned32  bsp_isr_level;
    4541
    4642/*
     
    7369 */
    7470
    75 rtems_extension
    76 fast_idle_switch_hook(rtems_tcb *current_task,
    77                       rtems_tcb *heir_task)
     71rtems_extension fast_idle_switch_hook(
     72  rtems_tcb *current_task,
     73  rtems_tcb *heir_task
     74)
    7875{
    7976    static rtems_unsigned32 normal_clock = ~0;
     
    10299
    103100/*
    104  *  bsp_libc_init
    105  *
    106  *  Initialize whatever libc we are using called from bsp_postdriver_hook.
    107  */
    108 
    109 void bsp_libc_init(void)
     101 *  Use the shared implementations of the following routines
     102 */
     103 
     104void bsp_postdriver_hook(void);
     105void bsp_libc_init( void *, unsigned32, int );
     106
     107/*
     108 *  bsp_pretasking_hook
     109 *
     110 *  BSP pretasking hook.  Called just before drivers are initialized.
     111 *  Used to setup libc and install any BSP extensions.
     112 */
     113
     114void bsp_pretasking_hook(void)
    110115{
    111116  extern int end;
     
    120125  heap_size &= 0xfffffff0;  /* keep it as a multiple of 16 bytes */
    121126
    122   RTEMS_Malloc_Initialize((void *) heap_start, heap_size, 0);
    123 
    124   /*
    125    *  Init the RTEMS libio facility to provide UNIX-like system
    126    *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    127    *  Uses malloc() to get area for the iops, so must be after malloc init
    128    */
    129  
    130   rtems_libio_init();
    131  
    132   /*
    133    * Set up for the libc handling.
    134    */
    135  
    136   if (BSP_Configuration.ticks_per_timeslice > 0)
    137     libc_init(1);                /* reentrant if possible */
    138   else
    139     libc_init(0);                /* non-reentrant */
    140 
    141 }
    142 
    143 
    144 /*
    145  *  bsp_pretasking_hook
    146  *
    147  *  BSP pretasking hook.  Called just before drivers are initialized.
    148  *  Used to setup libc and install any BSP extensions.
    149  */
    150 
    151 void bsp_pretasking_hook(void)
    152 {
    153   bsp_libc_init();
     127  bsp_libc_init((void *) heap_start, heap_size, 0);
     128
    154129
    155130#if SIMSPARC_FAST_IDLE
     
    190165
    191166/*
    192  *  Use the shared bsp_postdriver_hook() implementation
    193  */
    194  
    195 void bsp_postdriver_hook(void);
    196 
    197 
    198 /*
    199167 *  bsp_start
    200168 *
  • c/src/lib/libbsp/unix/posix/startup/Makefile.in

    rb3d3a34e rb6394ae  
    1313
    1414# C source names, if any, go here -- minus the .c
    15 C_PIECES=bspclean bspstart setvec
     15C_PIECES=bspclean bsplibc bspstart setvec
    1616C_FILES=$(C_PIECES:%=%.c)
    1717C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/unix/posix/startup/bspstart.c

    rb3d3a34e rb6394ae  
    1 /*  bsp_start()
    2  *
     1/*
    32 *  This routine starts the application.  It includes application,
    43 *  board, and monitor specific initialization and configuration.
     
    76 *
    87 *  Called by RTEMS::RTEMS constructor in startup-ctor.cc
    9  *
    10  *  INPUT:  NONE
    11  *
    12  *  OUTPUT: NONE
    138 *
    149 *  COPYRIGHT (c) 1989-1998.
     
    6964
    7065/*
    71  *  Function:   bsp_libc_init
    72  *  Created:    94/12/6
     66 *  Use the shared implementations of the following routines
     67 */
     68 
     69void bsp_postdriver_hook(void);
     70void bsp_libc_init( void *, unsigned32, int );
     71
     72/*
     73 *  Function:   bsp_pretasking_hook
     74 *  Created:    95/03/10
    7375 *
    7476 *  Description:
    75  *      Initialize whatever libc we are using
    76  *      called from bsp_postdriver_hook
    77  *
    78  *
    79  *  Parameters:
    80  *      none
    81  *
    82  *  Returns:
    83  *      none.
    84  *
    85  *  Side Effects:
    86  *
    87  *
    88  *  Notes:
    89  *
    90  *  Deficiencies/ToDo:
    91  *
    92  *
    93  */
    94 
    95 void
    96 bsp_libc_init(void)
     77 *      BSP pretasking hook.  Called just before drivers are initialized.
     78 *      Used to setup libc and install any BSP extensions.
     79 *
     80 *  NOTES:
     81 *      Must not use libc (to do io) from here, since drivers are
     82 *      not yet initialized.
     83 */
     84
     85void bsp_pretasking_hook(void)
    9786{
    9887    void *heap_start;
     
    10594    heap_start = 0;
    10695
    107     RTEMS_Malloc_Initialize((void *)heap_start, Heap_size, 1024 * 1024);
    108 
    109     /*
    110      *  Init the RTEMS libio facility to provide UNIX-like system
    111      *  calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
    112      *  Uses malloc() to get area for the iops, so must be after malloc init
    113      */
    114 
    115     rtems_libio_init();
    116 
    117     libc_init(1);
    118 }
    119 
    120 
    121 /*
    122  *  Function:   bsp_pretasking_hook
    123  *  Created:    95/03/10
    124  *
    125  *  Description:
    126  *      BSP pretasking hook.  Called just before drivers are initialized.
    127  *      Used to setup libc and install any BSP extensions.
    128  *
    129  *  Parameters:
    130  *      none
    131  *
    132  *  Returns:
    133  *      nada
    134  *
    135  *  Side Effects:
    136  *      installs a few extensions
    137  *
    138  *  Notes:
    139  *      Must not use libc (to do io) from here, since drivers are
    140  *      not yet initialized.
    141  *
    142  *  Deficiencies/ToDo:
    143  *
    144  *
    145  */
    146 
    147 void
    148 bsp_pretasking_hook(void)
    149 {
    150     bsp_libc_init();
     96    bsp_libc_init((void *)heap_start, Heap_size, 1024 * 1024);
     97
    15198
    15299#ifdef RTEMS_DEBUG
     
    166113 */
    167114 
    168 void
    169 bsp_postdriver_hook(void)
     115void bsp_postdriver_hook(void)
    170116{
    171117  return;
     
    173119
    174120/*
    175  *  Function:   bsp_start
    176  *  Created:    94/12/6
    177  *
    178  *  Description:
    179  *      called by crt0 as our "main" equivalent
    180  *
    181  *
    182  *
    183  *  Parameters:
    184  *
    185  *
    186  *  Returns:
    187  *
    188  *
    189  *  Side Effects:
    190  *
    191  *
    192  *  Notes:
    193  *
    194  *
    195  *  Deficiencies/ToDo:
    196  *
    197  *
    198  */
    199 
    200 void
    201 bsp_start(void)
     121 *  bsp_start
     122 *
     123 *  This routine does the bulk of the system initialization.
     124 */
     125
     126void bsp_start(void)
    202127{
    203128    unsigned32 workspace_ptr;
Note: See TracChangeset for help on using the changeset viewer.