source: rtems/c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c @ 6128a4a

4.104.114.84.95
Last change on this file since 6128a4a was 6128a4a, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/21/04 at 10:43:04

Remove stray white spaces.

  • Property mode set to 100644
File size: 2.6 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 *  MVME147 port for TNI - Telecom Bretagne
15 *  by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
16 *  May 1996
17 *
18 *  $Id$
19 */
20
21#include <string.h>
22
23#include <bsp.h>
24#include <rtems/libio.h>
25#include <rtems/libcsupport.h>
26
27/*
28 *  The original table from the application and our copy of it with
29 *  some changes.
30 */
31
32extern rtems_configuration_table  Configuration;
33rtems_configuration_table         BSP_Configuration;
34
35rtems_cpu_table Cpu_table;
36
37char *rtems_progname;
38
39/*
40 *  Use the shared implementations of the following routines
41 */
42
43void bsp_postdriver_hook(void);
44void bsp_libc_init( void *, uint32_t, int );
45void bsp_pretasking_hook(void);               /* m68k version */
46
47/*
48 *  bsp_start
49 *
50 *  This routine does the bulk of the system initialization.
51 */
52
53void bsp_start( void )
54{
55  m68k_isr_entry *monitors_vector_table;
56  int             index;
57  extern void          *_WorkspaceBase;
58  extern void          *_RamSize;
59  extern unsigned long  _M68k_Ramsize;
60
61  _M68k_Ramsize = (unsigned long)&_RamSize;             /* RAM size set in linker script */
62
63  monitors_vector_table = (m68k_isr_entry *)0;   /* 135Bug Vectors are at 0 */
64  m68k_set_vbr( monitors_vector_table );
65
66  for ( index=2 ; index<=255 ; index++ )
67    M68Kvec[ index ] = monitors_vector_table[ 32 ];
68
69  M68Kvec[  2 ] = monitors_vector_table[  2 ];   /* bus error vector */
70  M68Kvec[  4 ] = monitors_vector_table[  4 ];   /* breakpoints vector */
71  M68Kvec[  9 ] = monitors_vector_table[  9 ];   /* trace vector */
72  M68Kvec[ 47 ] = monitors_vector_table[ 47 ];   /* system call vector */
73
74  m68k_set_vbr( &M68Kvec );
75
76  pcc->int_base_vector = PCC_BASE_VECTOR; /* Set the PCC int vectors base */
77
78  (*(uint8_t*)0xfffe2001) = 0x08;
79      /* make VME access round-robin */
80
81  rtems_cache_enable_instruction();
82  rtems_cache_enable_data();
83
84  /*
85   *  we only use a hook to get the C library initialized.
86   */
87
88  Cpu_table.pretasking_hook = bsp_pretasking_hook;  /* init libc, etc. */
89  Cpu_table.postdriver_hook = bsp_postdriver_hook;
90  Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec;
91  Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY;
92
93  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
94}
Note: See TracBrowser for help on using the repository browser.