Changeset 7f09abec in rtems


Ignore:
Timestamp:
Sep 18, 2008, 8:40:09 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
ef37cb6
Parents:
76ba5f2
Message:

2008-09-18 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, configure.ac, startup/bspstart.c: Add bsp_get_work_area() implementation and use more of the BSP Initialization Framework.
  • startup/bspgetworkarea.c, startup/bsppost.c: New files.
Location:
c/src/lib/libbsp/unix/posix
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/unix/posix/ChangeLog

    r76ba5f2 r7f09abec  
     12008-09-18      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * Makefile.am, configure.ac, startup/bspstart.c: Add
     4        bsp_get_work_area() implementation and use more of the BSP
     5        Initialization Framework.
     6        * startup/bspgetworkarea.c, startup/bsppost.c: New files.
     7
    182008-09-18      Joel Sherrill <joel.sherrill@oarcorp.com>
    29
  • c/src/lib/libbsp/unix/posix/Makefile.am

    r76ba5f2 r7f09abec  
    4141
    4242startup_SOURCES = startup/bspclean.c ../../shared/bsplibc.c \
    43     ../../shared/bsppredriverhook.c startup/bspstart.c \
     43    ../../shared/bsppredriverhook.c ../../shared/bsppretaskinghook.c \
     44    startup/bspstart.c startup/bsppost.c startup/bspgetworkarea.c \
    4445    startup/setvec.c ../../shared/bootcard.c
    4546## for now always using main.c style startup
  • c/src/lib/libbsp/unix/posix/configure.ac

    r76ba5f2 r7f09abec  
    3636[The BSP's heapspace RAM in MB.])
    3737
     38RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION
     39
    3840# Explicitly list all Makefiles here
    3941AC_CONFIG_FILES([Makefile])
  • c/src/lib/libbsp/unix/posix/startup/bspstart.c

    r76ba5f2 r7f09abec  
    2323#include <bsp.h>
    2424#include <rtems/libcsupport.h>
    25 #include <rtems/libio.h>
    26 
    27 uint32_t                     Heap_size;
    28 int                          rtems_argc;
    29 char                       **rtems_argv;
    30 
    31 /*
    32  * May be overridden by RTEMS_WORKSPACE_SIZE and RTEMS_HEAPSPACE_SIZE
    33  * environment variables; see below.
    34  */
    35 
    36 #define DEFAULT_WORKSPACE_SIZE (WORKSPACE_MB * (1024 * 1024))
    37 #define DEFAULT_HEAPSPACE_SIZE (HEAPSPACE_MB * (1024 * 1024))
    3825
    3926/*
     
    4633
    4734/*
    48  *  Use the shared implementations of the following routines
    49  */
    50 
    51 void bsp_libc_init( void *, uint32_t, int );
    52 
    53 /*
    54  *  Function:   bsp_pretasking_hook
    55  *  Created:    95/03/10
    56  *
    57  *  Description:
    58  *      BSP pretasking hook.  Called just before drivers are initialized.
    59  *      Used to setup libc and install any BSP extensions.
    60  *
    61  *  NOTES:
    62  *      Must not use libc (to do io) from here, since drivers are
    63  *      not yet initialized.
    64  */
    65 
    66 void bsp_pretasking_hook(void)
    67 {
    68     void *heap_start;
    69 
    70     if (getenv("RTEMS_HEAPSPACE_SIZE"))
    71         Heap_size = strtol(getenv("RTEMS_HEAPSPACE_SIZE"), 0, 0);
    72     else
    73         Heap_size = DEFAULT_HEAPSPACE_SIZE;
    74 
    75     heap_start = 0;
    76 
    77     bsp_libc_init((void *)heap_start, Heap_size, 1024 * 1024);
    78 }
    79 
    80 /*
    81  *  DO NOT Use the shared bsp_postdriver_hook() implementation
    82  */
    83 
    84 void bsp_postdriver_hook(void)
    85 {
    86   return;
    87 }
    88 
    89 /*
    9035 *  bsp_start
    9136 *
    9237 *  This routine does the bulk of the system initialization.
    9338 */
    94 
    9539void bsp_start(void)
    9640{
    97   uintptr_t   workspace_ptr;
    98 
    9941  cpu_number = 0;
    10042
     
    12769   #endif
    12870
    129     if (getenv("RTEMS_WORKSPACE_SIZE"))
    130         rtems_configuration_get_work_space_size() =
    131            strtol(getenv("RTEMS_WORKSPACE_SIZE"), 0, 0);
    132     else
    133         rtems_configuration_get_work_space_size() = DEFAULT_WORKSPACE_SIZE;
    134 
    135     /*
    136      * Allocate workspace memory, ensuring it is properly aligned
    137      */
    138 
    139     workspace_ptr =
    140       (uintptr_t) sbrk(rtems_configuration_get_work_space_size() + CPU_ALIGNMENT);
    141     workspace_ptr += CPU_ALIGNMENT - 1;
    142     workspace_ptr &= ~(CPU_ALIGNMENT - 1);
    143 
    144     Configuration.work_space_start = (void *) workspace_ptr;
    145 
    14671    CPU_CLICKS_PER_TICK = 1;
    147 
    14872}
Note: See TracChangeset for help on using the changeset viewer.