Ignore:
Timestamp:
May 15, 2008, 3:54:55 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
dde1fedb
Parents:
5545002
Message:

2008-05-15 Joel Sherrill <joel.sherrill@…>

  • configure.ac, startup/bspstart.c: Add capability for bootcard.c BSP Initialization Framework to ask the BSP where it has memory for the RTEMS Workspace and C Program Heap. These collectively are referred to as work area. If the BSP supports this, then it does not have to include code to split the available memory between the two areas. This reduces the amount of code in the BSP specific bspstart.c file. Additionally, the shared framework can initialize the C Library, call rtems_debug_enable(), and dirty the work area memory. Until most/all BSPs support this new capability, if the BSP supports this, it should call RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION from its configure.ac. When the transition is complete, this autoconf macro can be removed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c

    r5545002 r2211b75c  
    55 *  before this routine is invoked.
    66 *
    7  *  COPYRIGHT (c) 1989-2000.
     7 *  COPYRIGHT (c) 1989-2008.
    88 *  On-Line Applications Research Corporation (OAR).
    99 *
     
    1515 */
    1616
    17 #include <string.h>
    18 
    1917#include <bsp.h>
    20 #include <rtems/libio.h>
    21 #include <rtems/libcsupport.h>
    2218
    2319/*
    24  *  Use the shared implementations of the following routines
     20 *  This method returns the base address and size of the area which
     21 *  is to be allocated between the RTEMS Workspace and the C Program
     22 *  Heap.
    2523 */
     24void bsp_get_workarea(
     25  void   **workarea_base,
     26  size_t  *workarea_size,
     27  size_t  *requested_heap_size
     28)
     29{
     30  extern int WorkspaceBase;
     31  extern int end;
    2632
    27 void bsp_libc_init( void *, uint32_t, int );
    28 
    29 /*
    30  *  Function:   bsp_pretasking_hook
    31  *  Created:    95/03/10
    32  *
    33  *  Description:
    34  *      BSP pretasking hook.  Called just before drivers are initialized.
    35  *      Used to setup libc and install any BSP extensions.
    36  *
    37  *  NOTES:
    38  *      Must not use libc (to do io) from here, since drivers are
    39  *      not yet initialized.
    40  *
    41  */
    42 
    43 void bsp_pretasking_hook(void)
    44 {
    45     extern int HeapBase;
    46     extern int HeapSize;
    47     void         *heapStart = &HeapBase;
    48     unsigned long heapSize = (unsigned long)&HeapSize;
    49 
    50     bsp_libc_init(heapStart, (uint32_t) heapSize, 0);
    51 
    52 #ifdef RTEMS_DEBUG
    53     rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
    54 #endif
    55 
     33  *workarea_base       = &WorkspaceBase;
     34  *workarea_size       = (void *)&end - (void *)&WorkspaceBase;
     35  *requested_heap_size = 0;
    5636}
    5737
     
    6444void bsp_start( void )
    6545{
    66   extern int WorkspaceBase;
    67   extern void _sys_exit(int);
    6846  extern void mips_install_isr_entries(void);
    69 
    70   /* HACK -- tied to value linkcmds */
    71   if ( rtems_configuration_get_work_space_size() >(4096*1024) )
    72    _sys_exit( 1 );
    73 
    74   Configuration.work_space_start = (void *) &WorkspaceBase;
    7547
    7648  mips_set_sr( 0xff00 );  /* all interrupts unmasked but globally off */
     
    7951}
    8052
    81 /* XXX */
     53/*
     54 *  Required routine by some gcc run-times.
     55 */
    8256void clear_cache( void *address, size_t n )
    8357{
Note: See TracChangeset for help on using the changeset viewer.