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

4.104.114.84.95
Last change on this file since d85c279e was d85c279e, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/31/04 at 04:16:57

2004-03-31 Ralf Corsepius <ralf_corsepius@…>

  • clock/clock.c, include/bsp.h, startup/bspstart.c, timer/timer.c: Convert to using c99 fixed size types.
  • Property mode set to 100644
File size: 2.7 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 *  The original table from the application and our copy of it with
25 *  some changes.
26 */
27 
28extern rtems_configuration_table  Configuration;
29rtems_configuration_table         BSP_Configuration;
30
31rtems_cpu_table   Cpu_table;
32
33/*
34 *  Use the shared implementations of the following routines
35 */
36 
37void bsp_postdriver_hook(void);
38void bsp_libc_init( void *, uint32_t, int );
39extern void bsp_spurious_initialize();
40
41/*
42 *  bsp_pretasking_hook
43 *
44 *  BSP pretasking hook.  Called just before drivers are initialized.
45 *  Used to setup libc and install any BSP extensions.
46 */
47
48void bsp_pretasking_hook(void)
49{
50  extern void *_HeapStart;
51  extern uint32_t         _HeapSize;
52
53  bsp_libc_init(&_HeapStart, (unsigned int) &_HeapSize, 0);
54
55#ifdef RTEMS_DEBUG
56  rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
57#endif
58
59  bsp_spurious_initialize();
60}
61
62/*
63 *  bsp_start
64 *
65 *  This routine does the bulk of the system initialization.
66 */
67
68#include <rtems/bspIo.h>
69
70BSP_output_char_function_type           BSP_output_char;
71BSP_polling_getchar_function_type       BSP_poll_char;
72extern void C4X_BSP_output_char(char c);
73
74void bsp_start( void )
75{
76  extern void *_WorkspaceBase;
77  extern uint32_t         _WorkspaceMax;
78  /*
79   * Set up our hooks
80   * Make sure libc_init is done before drivers initialized so that
81   * they can use atexit()
82   */
83
84  Cpu_table.pretasking_hook = bsp_pretasking_hook;    /* init libc, etc. */
85  Cpu_table.postdriver_hook = bsp_postdriver_hook;
86
87  /*
88   *  SIS does zero out memory BUT only when IT begins execution.  Thus
89   *  if we want to have a clean slate in the workspace each time we
90   *  begin execution of OUR application, then we must zero the workspace.
91   */
92  Cpu_table.do_zero_of_workspace = FALSE;
93
94  /*
95   *  This should be enough interrupt stack.
96   */
97
98  Cpu_table.interrupt_stack_size = 0;
99
100  BSP_Configuration.work_space_start = (void *)&_WorkspaceBase;
101  /* XXX check to see if satisfying small memory model */
102
103  if ( BSP_Configuration.work_space_size > (int) &_WorkspaceMax )
104    rtems_fatal_error_occurred( 0x43218765 );
105 
106  BSP_output_char = C4X_BSP_output_char;
107  BSP_poll_char = (BSP_polling_getchar_function_type) NULL;
108}
Note: See TracBrowser for help on using the repository browser.