source: rtems/c/src/lib/libbsp/powerpc/shared/startup/bspgetworkarea.c @ db77b92

4.104.11
Last change on this file since db77b92 was db77b92, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 15, 2008 at 10:05:19 PM

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

  • shared/startup/bspstart.c, shared/startup/pretaskinghook.c: Add use of bsp_get_work_area() in its own file and rely on BSP Framework to perform more initialization.
  • shared/startup/bspgetworkarea.c: New file.
  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  The license and distribution terms for this file may be
3 *  found in the file LICENSE in this distribution or at
4 *  http://www.rtems.com/license/LICENSE.
5 *
6 *  $Id$
7 */
8
9#include <bsp.h>
10#include <bsp/bootcard.h>
11#include <stdint.h>
12
13extern void *__rtems_end;
14extern uint32_t _bsp_sbrk_init(uint32_t, uint32_t*);
15
16/*
17 *  This method returns the base address and size of the area which
18 *  is to be allocated between the RTEMS Workspace and the C Program
19 *  Heap.
20 */
21void bsp_get_work_area(
22  void   **work_area_start,
23  size_t  *work_area_size,
24  void   **heap_start,
25  size_t  *heap_size
26)
27{
28  uintptr_t size;
29  uintptr_t reserve;
30  uintptr_t spared;
31
32  reserve  = (uintptr_t)BSP_INIT_STACK_SIZE;
33  reserve += rtems_configuration_get_interrupt_stack_size();
34  size     = (uintptr_t)BSP_mem_size - (uintptr_t)&__rtems_end + reserve;
35
36  *work_area_start = (void *)(&__rtems_end + reserve);
37  *work_area_size  = size;
38  spared = _bsp_sbrk_init( *work_area_start, work_area_size );
39  *heap_start      = BSP_BOOTCARD_HEAP_USES_WORK_AREA;
40  *heap_size       = BSP_BOOTCARD_HEAP_SIZE_DEFAULT;
41}
42
Note: See TracBrowser for help on using the repository browser.