source: rtems/c/src/lib/libbsp/c4x/c4xsim/startup/bspstart.c @ dde1fedb

4.104.114.95
Last change on this file since dde1fedb was dde1fedb, checked in by Joel Sherrill <joel.sherrill@…>, on 05/15/08 at 15:55:28

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

  • startup/bspstart.c: Add capability for bootcard.c BSP Initialization Framework to ask the BSP where it has memory for the RTEMS Workspace and C Program Heap. These collectively are referred to as work area. If the BSP supports this, then it does not have to include code to split the available memory between the two areas. This reduces the amount of code in the BSP specific bspstart.c file. Additionally, the shared framework can initialize the C Library, call rtems_debug_enable(), and dirty the work area memory. Until most/all BSPs support this new capability, if the BSP supports this, it should call RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION from its configure.ac. When the transition is complete, this autoconf macro can be removed.
  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 *  This set of routines starts the application.  It includes application,
3 *  board, and monitor specific initialization and configuration.
4 *  The generic CPU dependent initialization has been performed
5 *  before any of these are invoked.
6 *
7 *  COPYRIGHT (c) 1989-1999.
8 *  On-Line Applications Research Corporation (OAR).
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.rtems.com/license/LICENSE.
13 *
14 *  $Id$
15 */
16
17#include <string.h>
18
19#include <bsp.h>
20#include <rtems/libio.h>
21#include <rtems/libcsupport.h>
22
23/*
24 *  Use the shared implementations of the following routines
25 */
26
27void bsp_libc_init( void *, uint32_t, int );
28extern void bsp_spurious_initialize();
29
30/*
31 *  bsp_pretasking_hook
32 *
33 *  BSP pretasking hook.  Called just before drivers are initialized.
34 *  Used to setup libc and install any BSP extensions.
35 */
36
37void bsp_pretasking_hook(void)
38{
39  extern void      *_HeapStart;
40  extern uint32_t   _HeapSize;
41
42  bsp_libc_init(&_HeapStart, (unsigned int) &_HeapSize, 0);
43
44  bsp_spurious_initialize();
45}
46
47/*
48 *  bsp_start
49 *
50 *  This routine does the bulk of the system initialization.
51 */
52
53#include <rtems/bspIo.h>
54
55BSP_output_char_function_type           BSP_output_char;
56BSP_polling_getchar_function_type       BSP_poll_char;
57extern void C4X_BSP_output_char(char c);
58
59void bsp_start( void )
60{
61  extern void     *_WorkspaceBase;
62  extern uint32_t _WorkspaceMax;
63
64  Configuration.work_space_start = (void *)&_WorkspaceBase;
65  /* XXX check to see if satisfying small memory model */
66
67  if ( rtems_configuration_get_work_space_size() > (int) &_WorkspaceMax )
68    rtems_fatal_error_occurred( 0x43218765 );
69
70  BSP_output_char = C4X_BSP_output_char;
71  BSP_poll_char = (BSP_polling_getchar_function_type) NULL;
72}
Note: See TracBrowser for help on using the repository browser.