source: rtems/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c @ 6ea100c1

4.104.114.95
Last change on this file since 6ea100c1 was 6ea100c1, checked in by Joel Sherrill <joel.sherrill@…>, on 05/12/08 at 18:43:55

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

  • startup/bspstart.c: Refactored and renamed initialization routines to rtems_initialize_data_structures, rtems_initialize_before_drivers, rtems_initialize_device_drivers, and rtems_initialize_start_multitasking. This opened the sequence up so that bootcard() could provide a more robust and flexible framework which is easier to explain and understand. This also lays the groundwork for sharing the division of available memory between the RTEMS workspace and heap and the C library initialization across all BSPs.
  • Property mode set to 100644
File size: 2.4 KB
Line 
1/*
2 *  This routine 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 this routine is 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 *  Modifications of respective RTEMS file: COPYRIGHT (c) 1994.
15 *  EISCAT Scientific Association. M.Savitski
16 *
17 *  This material is a part of the MVME162 Board Support Package
18 *  for the RTEMS executive. Its licensing policies are those of the
19 *  RTEMS above.
20 *
21 *  $Id$
22 */
23
24#include <string.h>
25
26#include <bsp.h>
27#include <rtems/libio.h>
28#include <rtems/libcsupport.h>
29#include <page_table.h>
30
31/*
32 *  Use the shared implementations of the following routines
33 */
34
35void bsp_libc_init( void *, uint32_t, int );
36void bsp_pretasking_hook(void);               /* m68k version */
37
38/*
39 *  bsp_start
40 *
41 *  This routine does the bulk of the system initialization.
42 */
43
44void bsp_start( void )
45{
46  m68k_isr_entry       *monitors_vector_table;
47  int                   index;
48  extern void          *_WorkspaceBase;
49  extern void          *_RamSize;
50  extern unsigned long  _M68k_Ramsize;
51
52  _M68k_Ramsize = (unsigned long)&_RamSize;  /* RAM size set in linker script */
53
54  /*
55   *  162Bug Vectors are at 0xFFE00000
56   *  162Bug Vectors on LX are at 0x00000000
57   */
58
59#if defined(mvme162lx)
60  monitors_vector_table = (m68k_isr_entry *)0x00000000;
61#else
62  monitors_vector_table = (m68k_isr_entry *)0xFFE00000;
63#endif
64
65  m68k_set_vbr( monitors_vector_table );
66
67  for ( index=2 ; index<=255 ; index++ )
68    M68Kvec[ index ] = monitors_vector_table[ 32 ];
69
70  M68Kvec[  2 ] = monitors_vector_table[  2 ];   /* bus error vector */
71  M68Kvec[  4 ] = monitors_vector_table[  4 ];   /* breakpoints vector */
72  M68Kvec[  9 ] = monitors_vector_table[  9 ];   /* trace vector */
73  M68Kvec[ 47 ] = monitors_vector_table[ 47 ];   /* system call vector */
74
75  m68k_set_vbr( &M68Kvec );
76
77  /*
78   *  You may wish to make the VME arbitration round-robin here, currently
79   *  we leave it as it is.
80   */
81
82  /* set the Interrupt Base Vectors */
83
84  lcsr->vector_base = (VBR0 << 28) | (VBR1 << 24);
85
86  page_table_init();
87
88  Configuration.work_space_start = (void *) &_WorkspaceBase;
89}
Note: See TracBrowser for help on using the repository browser.