Ignore:
Timestamp:
Jul 24, 2008, 2:52:55 PM (12 years ago)
Author:
Thomas Doerfler <Thomas.Doerfler@…>
Branches:
4.10, 4.11, 4.9, master
Children:
de3864e
Parents:
075d817
Message:

Changed bsp_get_workarea() to bsp_get_work_area() and
added support for an optional separate heap area.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c

    r075d817 rd4886a06  
    3030
    3131#include <bsp.h>
     32#include <bsp/bootcard.h>
    3233#include <bsp/irq.h>
    3334#include <bsp/irq-generic.h>
     
    7980}
    8081
     82void bsp_get_work_area( void **work_area_start, size_t *work_area_size, void **heap_start, size_t *heap_size)
     83{
     84        *work_area_start = bsp_section_bss_end;
     85        *work_area_size = bsp_ram_end - 2 * MPC55XX_INTERRUPT_STACK_SIZE - bsp_section_bss_end;
     86        *heap_start = bsp_external_ram_start;
     87        *heap_size = (size_t) bsp_external_ram_size;
     88}
     89
    8190void bsp_pretasking_hook()
    8291{
    83         uint32_t heap_start = bsp_external_ram_start;
    84         uint32_t heap_size = bsp_external_ram_size;
    85 
    86         bsp_libc_init( heap_start, heap_size, 0);
    87 
    8892#ifdef STACK_CHECKER_ON
    8993        Stack_check_Initialize();
    90 #endif
    91 
    92 #ifdef RTEMS_DEBUG
    93         rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
    9494#endif
    9595}
     
    168168        ppc_cpu_revision_t myCpuRevision;
    169169
    170         uint32_t ram_start = bsp_ram_start;
    171         uint32_t ram_end = bsp_ram_end;
    172         uint32_t interrupt_stack_start = ram_end - 2 * MPC55XX_INTERRUPT_STACK_SIZE;
     170        uint32_t interrupt_stack_start = bsp_ram_end - 2 * MPC55XX_INTERRUPT_STACK_SIZE;
    173171        uint32_t interrupt_stack_size = MPC55XX_INTERRUPT_STACK_SIZE;
    174         uint32_t work_space_start = bsp_section_bss_end;
    175         uint32_t work_space_end = work_space_start + rtems_configuration_get_work_space_size();
    176172
    177173        /* ESCI pad configuration */
     
    181177        DEBUG_PRINT( "BSP start ...\n");
    182178
    183         /* Memory layout */
    184 
    185         Configuration.work_space_start = work_space_start;
    186 
    187179        DEBUG_PRINT( "System clock          : %i\n", mpc55xx_get_system_clock());
    188         DEBUG_PRINT( "Memory start          : 0x%08x\n", ram_start);
    189         DEBUG_PRINT( "Memory end            : 0x%08x\n", ram_end);
    190         DEBUG_PRINT( "Memory size           : 0x%08x\n", ram_end - ram_start);
    191         DEBUG_PRINT( "Work space start      : 0x%08x\n", work_space_start);
    192         DEBUG_PRINT( "Work space end        : 0x%08x\n", work_space_end);
    193         DEBUG_PRINT( "Work space size       : 0x%08x\n", work_space_end - work_space_start);
     180        DEBUG_PRINT( "Memory start          : 0x%08x\n", bsp_ram_start);
     181        DEBUG_PRINT( "Memory end            : 0x%08x\n", bsp_ram_end);
     182        DEBUG_PRINT( "Memory size           : 0x%08x\n", bsp_ram_end - bsp_ram_start);
    194183        DEBUG_PRINT( "Interrupt stack start : 0x%08x\n", interrupt_stack_start);
    195184        DEBUG_PRINT( "Interrupt stack end   : 0x%08x\n", interrupt_stack_start + interrupt_stack_size);
    196185        DEBUG_PRINT( "Interrupt stack size  : 0x%08x\n", interrupt_stack_size);
    197 
    198         if (work_space_end > interrupt_stack_start) {
    199                 BSP_panic( "Not enough memory for the work space");
    200         }
    201186       
    202187        /*
Note: See TracChangeset for help on using the changeset viewer.