source: rtems/c/src/lib/libbsp/m68k/gen68340/startup/bspstart.c @ 132f194

4.104.114.84.95
Last change on this file since 132f194 was 132f194, checked in by Joel Sherrill <joel.sherrill@…>, on 07/01/98 at 22:03:20

Initial submission of gen68340 BSP (should run on a 68349) from
Geoffroy Montel <g_montel@…>.

  • Property mode set to 100644
File size: 2.8 KB
RevLine 
[132f194]1/*  bsp_start()
2 *
3 *  This routine starts the application.  It includes application,
4 *  board, and monitor specific initialization and configuration.
5 *  The generic CPU dependent initialization has been performed
6 *  before this routine is invoked.
7 *
8 *  INPUT:  NONE
9 *
10 *  OUTPUT: NONE
11 *
12 *  COPYRIGHT (c) 1989-1998.
13 *  On-Line Applications Research Corporation (OAR).
14 *  Copyright assigned to U.S. Government, 1994.
15 *
16 *  The license and distribution terms for this file may be
17 *  found in the file LICENSE in this distribution or at
18 *  http://www.OARcorp.com/rtems/license.html.
19 *
20 *  $Id$
21 */
22
23#include <bsp.h>
24#include <rtems/libio.h>
25 
26#include <libcsupport.h>
27 
28#include <string.h>
29 
30
31/*
32 *  The original table from the application and our copy of it with
33 *  some changes.
34 */
35
36extern rtems_configuration_table Configuration;
37rtems_configuration_table  BSP_Configuration;
38
39rtems_cpu_table Cpu_table;
40
41char *rtems_progname;
42
43/*      Initialize whatever libc we are using
44 *      called from postdriver hook
45 */
46void bsp_postdriver_hook(void);
47void bsp_libc_init( void *, unsigned32, int );
48
49/*
50 *  Function:   bsp_pretasking_hook
51 *  Created:    95/03/10
52 *
53 *  Description:
54 *      BSP pretasking hook.  Called just before drivers are initialized.
55 *      Used to setup libc and install any BSP extensions.
56 *
57 *  NOTES:
58 *      Must not use libc (to do io) from here, since drivers are
59 *      not yet initialized.
60 *
61 */
62 
63void bsp_pretasking_hook(void)
64{
65    extern void *_HeapStart;
66    extern rtems_unsigned32 _HeapSize;
67
68    bsp_libc_init(&_HeapStart, _HeapSize, 0);
69 
70#ifdef RTEMS_DEBUG
71    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
72#endif
73}
74
75/*
76 *  bsp_start
77 *
78 *  This routine does the bulk of the system initialization.
79 */
80
81void bsp_start( void )
82{
83  extern void *_WorkspaceBase;
84
85  /*
86   *  Allocate the memory for the RTEMS Work Space.  This can come from
87   *  a variety of places: hard coded address, malloc'ed from outside
88   *  RTEMS world (e.g. simulator or primitive memory manager), or (as
89   *  typically done by stock BSPs) by subtracting the required amount
90   *  of work space from the last physical address on the CPU board.
91   */
92#if 0
93  Cpu_table.interrupt_vector_table = (mc68000_isr *) 0/*&M68Kvec*/;
94#endif
95
96  /*
97   *  Need to "allocate" the memory for the RTEMS Workspace and
98   *  tell the RTEMS configuration where it is.  This memory is
99   *  not malloc'ed.  It is just "pulled from the air".
100   */
101
102  BSP_Configuration.work_space_start = (void *)&_WorkspaceBase;
103
104  /*
105   *  Account for the console's resources
106   */
107
108  console_reserve_resources( &BSP_Configuration );
109
110  /*
111   *  initialize the CPU table for this BSP
112   */
113
114  Cpu_table.pretasking_hook = bsp_pretasking_hook;  /* init libc, etc. */
115  Cpu_table.postdriver_hook = bsp_postdriver_hook;
116  Cpu_table.do_zero_of_workspace = TRUE;
117  Cpu_table.interrupt_stack_size = 4096;
118}
Note: See TracBrowser for help on using the repository browser.