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

4.104.114.84.95
Last change on this file since ca7858bb was 17508d02, checked in by Joel Sherrill <joel.sherrill@…>, on 07/26/00 at 19:26:28

Port of RTEMS to the Texas Instruments C3x/C4x DSP families including
a BSP (c4xsim) supporting the simulator included with gdb. This port
was done by Joel Sherrill and Jennifer Averett of OAR Corporation.
Also included with this port is a space/time optimization to eliminate
FP context switch management on CPUs without hardware or software FP.

An issue with this port was that sizeof(unsigned32) = sizeof(unsigned8)
on this CPU. This required addressing alignment checks and assumptions
as well as fixing code that assumed sizeof(unsigned32) == 4.

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