Changeset 1986152 in rtems


Ignore:
Timestamp:
Sep 17, 2008, 6:38:05 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
25ed5539
Parents:
bd5984de
Message:

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

  • bootcard.c: Add support for optionally having a unified work area. In other words, the RTEMS Workspace and C Program Heap are the same pool of memory.
Location:
c/src/lib/libbsp/shared
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/shared/ChangeLog

    rbd5984de r1986152  
     12008-09-17      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * bootcard.c: Add support for optionally having a unified work area. In
     4        other words, the RTEMS Workspace and C Program Heap are the same pool
     5        of memory.
     6
    172008-09-17      Miao Yan <yanmiaobest@gmail.com>
    28
  • c/src/lib/libbsp/shared/bootcard.c

    rbd5984de r1986152  
    5454
    5555/*
     56 * Are we using a single heap for the RTEMS Workspace and C Program Heap?
     57 */
     58extern bool rtems_unified_work_area;
     59
     60/*
    5661 *  These are the prototypes and helper routines which are used
    5762 *  when the BSP lets the framework handle RAM allocation between
     
    6873    size_t heap_size_default = 0;
    6974
    70     if (heap_start == BSP_BOOTCARD_HEAP_USES_WORK_AREA) {
     75    if ( !rtems_unified_work_area &&
     76         heap_start == BSP_BOOTCARD_HEAP_USES_WORK_AREA) {
    7177      /* Use the work area start as heap start */
    7278      heap_start = work_area_start;
     
    166172  #if defined(BSP_BOOTCARD_HANDLES_RAM_ALLOCATION)
    167173    {
    168       void *work_space_start = NULL;
    169    
    170174      bsp_get_work_area(
    171175        &work_area_start,
     
    175179      );
    176180   
    177       work_space_start = (char *) work_area_start + work_area_size
    178         - rtems_configuration_get_work_space_size();
    179    
    180       if ((uintptr_t) work_space_start <= (uintptr_t) work_area_start) {
    181         printk( "bootcard: Work space to big for work area!\n");
     181      if ( work_area_size <= Configuration.work_space_size ) {
     182        printk( "bootcard: Work space too big for work area!\n");
    182183        bsp_cleanup();
    183184        return -1;
    184185      }
    185186   
    186       Configuration.work_space_start = work_space_start;
    187    
     187      if ( rtems_unified_work_area ) {
     188        Configuration.work_space_start = work_area_start;
     189        Configuration.work_space_size  = work_area_size;
     190      } else {
     191        Configuration.work_space_start = (char *) work_area_start +
     192          work_area_size - rtems_configuration_get_work_space_size();
     193      }
     194
    188195      #if (BSP_DIRTY_MEMORY == 1)
    189196        memset( work_area_start, 0xCF,  work_area_size);
Note: See TracChangeset for help on using the changeset viewer.