source: rtems/c/src/lib/libbsp/mips/rbtx4925/startup/bspstart.c @ cafa2c5

4.104.114.95
Last change on this file since cafa2c5 was cafa2c5, checked in by Joel Sherrill <joel.sherrill@…>, on 12/04/07 at 22:22:03

2007-12-04 Joel Sherrill <joel.sherrill@…>

  • startup/bspstart.c: Move interrupt_stack_size field from CPU Table to Configuration Table. Eliminate CPU Table from all ports. Delete references to CPU Table in all forms.
  • Property mode set to 100644
File size: 2.1 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-2000.
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 *  bspstart.c,v 1.4.2.1 2003/09/04 18:44:49 joel Exp
15 */
16
17#include <string.h>
18
19#include <bsp.h>
20#include <rtems/libio.h>
21#include <rtems/libcsupport.h>
22
23#define LIBC_HEAP_SIZE (64 * 1024)
24
25extern int end; /* defined by linker */
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;
34char *rtems_progname;
35
36/*
37 *  Use the shared implementations of the following routines
38 */
39 
40void bsp_postdriver_hook(void);
41void bsp_libc_init( void *, uint32_t, int );
42
43void init_exc_vecs(void);
44
45/*
46 *  Function:   bsp_pretasking_hook
47 *  Created:    95/03/10
48 *
49 *  Description:
50 *      BSP pretasking hook.  Called just before drivers are initialized.
51 *      Used to setup libc and install any BSP extensions.
52 *
53 *  NOTES:
54 *      Must not use libc (to do io) from here, since drivers are
55 *      not yet initialized.
56 *
57 */
58 
59void bsp_pretasking_hook(void)
60{
61    uint32_t heap_start;
62
63    heap_start = (uint32_t) &end;
64    if (heap_start & (CPU_ALIGNMENT-1))
65        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
66
67    bsp_libc_init((void *) heap_start, LIBC_HEAP_SIZE, 0);
68
69#ifdef RTEMS_DEBUG
70    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
71#endif
72
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 int WorkspaceBase;
84  extern void mips_install_isr_entries(void);
85
86  BSP_Configuration.work_space_start =
87       (void *)((uint64_t)((&end) + LIBC_HEAP_SIZE + 0x100) & ~0x7);
88
89  mips_install_isr_entries();  /* Install generic MIPS exception handler */
90}
91
Note: See TracBrowser for help on using the repository browser.