source: rtems/c/src/lib/libbsp/m68k/idp/startup/bspstart.c @ 69537ca9

4.104.114.84.95
Last change on this file since 69537ca9 was 69537ca9, checked in by Joel Sherrill <joel.sherrill@…>, on 01/12/00 at 16:38:56

Patch rtems-rc-20000104-16.diff from Ralf Corsepius <corsepiu@…>
that converts the libbsp/i386 subdirectory to full automake.

  • Property mode set to 100644
File size: 3.3 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.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 
24unsigned char *duart_base;
25extern struct duart_regs duart_info;
26
27#define DELAY 5000
28
29void led_putnum();
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/*
44 *  Use the shared implementations of the following routines
45 */
46 
47void bsp_postdriver_hook(void);
48void bsp_libc_init( void *, unsigned32, int );
49
50/*
51 *  Function:   bsp_pretasking_hook
52 *  Created:    95/03/10
53 *
54 *  Description:
55 *      BSP pretasking hook.  Called just before drivers are initialized.
56 *      Used to setup libc and install any BSP extensions.
57 *
58 *  NOTES:
59 *      Must not use libc (to do io) from here, since drivers are
60 *      not yet initialized.
61 *
62 */
63 
64void bsp_pretasking_hook(void)
65{
66    extern int _end;
67    rtems_unsigned32        heap_start;
68 
69    heap_start = (rtems_unsigned32) &_end;
70    if (heap_start & (CPU_ALIGNMENT-1))
71        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
72 
73        /* Create 64 KByte memory region for RTEMS executive */
74    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
75 
76#ifdef RTEMS_DEBUG
77    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
78#endif
79}
80 
81/*
82 *  bsp_start
83 *
84 *  This routine does the bulk of the system initialization.
85 */
86
87void bsp_start( void )
88{
89  m68k_isr_entry *monitors_vector_table;
90  int             index;
91
92  duart_base = (unsigned char *)DUART_ADDR;
93
94  /*
95   *  Set the VBR here to the monitor's default.
96   */
97
98  monitors_vector_table = (m68k_isr_entry *)0;
99   /* This is where you set vector base register = 0 */
100  m68k_set_vbr( monitors_vector_table );
101
102  /* The vector interrupt table for the 680x0 is in appendix B-2
103         of the M68000 Family Programmer's reference table */
104  for ( index=2 ; index<=255 ; index++ )
105    M68Kvec[ index ] = monitors_vector_table[ 32 ];
106
107
108  M68Kvec[  2 ] = monitors_vector_table[  2 ];   /* bus error vector */
109  M68Kvec[  4 ] = monitors_vector_table[  4 ];   /* breakpoints vector */
110  M68Kvec[  9 ] = monitors_vector_table[  9 ];   /* trace vector */
111
112  /*
113   *  Set the VBR here if you do not want to use the monitor's vector table.
114   */
115
116  m68k_set_vbr( &M68Kvec );
117
118  m68k_enable_caching();
119
120  /*
121   *  we only use a hook to get the C library initialized.
122   */
123 
124  Cpu_table.pretasking_hook = bsp_pretasking_hook;  /* init libc, etc. */
125  Cpu_table.postdriver_hook = bsp_postdriver_hook;
126  Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec;
127  Cpu_table.interrupt_stack_size = 4096;
128
129  BSP_Configuration.work_space_start = (void *)
130     (RAM_END - BSP_Configuration.work_space_size);
131 
132/*  led_putnum('e'); * for debugging purposes only */
133
134  /* Clock_exit is done as an atexit() function */
135}
Note: See TracBrowser for help on using the repository browser.