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

4.104.114.95
Last change on this file since 4130d8e2 was 4130d8e2, checked in by Joel Sherrill <joel.sherrill@…>, on 12/11/07 at 15:50:25

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

  • include/bsp.h, startup/bspstart.c: Eliminate copies of the Configuration Table. Use the RTEMS provided accessor macros to obtain configuration fields.
  • Property mode set to 100644
File size: 1.9 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 *  Use the shared implementations of the following routines
29 */
30 
31void bsp_postdriver_hook(void);
32void bsp_libc_init( void *, uint32_t, int );
33
34void init_exc_vecs(void);
35
36/*
37 *  Function:   bsp_pretasking_hook
38 *  Created:    95/03/10
39 *
40 *  Description:
41 *      BSP pretasking hook.  Called just before drivers are initialized.
42 *      Used to setup libc and install any BSP extensions.
43 *
44 *  NOTES:
45 *      Must not use libc (to do io) from here, since drivers are
46 *      not yet initialized.
47 *
48 */
49 
50void bsp_pretasking_hook(void)
51{
52    uint32_t heap_start;
53
54    heap_start = (uint32_t) &end;
55    if (heap_start & (CPU_ALIGNMENT-1))
56        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
57
58    bsp_libc_init((void *) heap_start, LIBC_HEAP_SIZE, 0);
59
60#ifdef RTEMS_DEBUG
61    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
62#endif
63
64}
65 
66/*
67 *  bsp_start
68 *
69 *  This routine does the bulk of the system initialization.
70 */
71
72void bsp_start( void )
73{
74  extern int WorkspaceBase;
75  extern void mips_install_isr_entries(void);
76
77  Configuration.work_space_start =
78       (void *)((uint64_t)((&end) + LIBC_HEAP_SIZE + 0x100) & ~0x7);
79
80  mips_install_isr_entries();  /* Install generic MIPS exception handler */
81}
82
Note: See TracBrowser for help on using the repository browser.