RTEMS
bspgetworkarea.c
1 /*
2  * This set of routines are the BSP specific initialization
3  * support routines.
4  *
5  * COPYRIGHT (c) 1989-2008.
6  * On-Line Applications Research Corporation (OAR).
7  *
8  * The license and distribution terms for this file may be
9  * found in the file LICENSE in this distribution or at
10  * http://www.rtems.org/license/LICENSE.
11  */
12 
13 #include <bsp.h>
14 #include <bsp/bootcard.h>
15 
16 #include <rtems/sysinit.h>
17 
18 /* Tells us where to put the workspace in case remote debugger is present. */
19 extern uintptr_t rdb_start;
20 
21 static Memory_Area _Memory_Areas[ 1 ];
22 
23 static const Memory_Information _Memory_Information =
24  MEMORY_INFORMATION_INITIALIZER( _Memory_Areas );
25 
26 static void bsp_memory_initialize( void )
27 {
28  void *begin;
29  uintptr_t size;
30 
31  begin = &end;
32  size = rdb_start - (uintptr_t)begin;
33  _Memory_Initialize_by_size( &_Memory_Areas[ 0 ], begin, size );
34 }
35 
36 RTEMS_SYSINIT_ITEM(
37  bsp_memory_initialize,
38  RTEMS_SYSINIT_MEMORY,
39  RTEMS_SYSINIT_ORDER_MIDDLE
40 );
41 
43 {
44  return &_Memory_Information;
45 }
#define MEMORY_INFORMATION_INITIALIZER(areas)
Statically initialize a memory information.
Definition: memory.h:97
The memory information.
Definition: memory.h:80
The memory area description.
Definition: memory.h:60
static __inline__ void _Memory_Initialize_by_size(Memory_Area *area, void *begin, uintptr_t size)
Initialize the memory area by size.
Definition: memory.h:164
const Memory_Information * _Memory_Get(void)
Return the memory information of this platform.