source: rtems/c/src/lib/libbsp/mips/rbtx4938/startup/bspstart.c @ dde1fedb

4.104.114.9
Last change on this file since dde1fedb was dde1fedb, checked in by Joel Sherrill <joel.sherrill@…>, on May 15, 2008 at 3:55:28 PM

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

  • startup/bspstart.c: Add capability for bootcard.c BSP Initialization Framework to ask the BSP where it has memory for the RTEMS Workspace and C Program Heap. These collectively are referred to as work area. If the BSP supports this, then it does not have to include code to split the available memory between the two areas. This reduces the amount of code in the BSP specific bspstart.c file. Additionally, the shared framework can initialize the C Library, call rtems_debug_enable(), and dirty the work area memory. Until most/all BSPs support this new capability, if the BSP supports this, it should call RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION from its configure.ac. When the transition is complete, this autoconf macro can be removed.
  • Property mode set to 100644
File size: 1.8 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_libc_init( void *, uint32_t, int );
32
33void init_exc_vecs(void);
34
35/*
36 *  Function:   bsp_pretasking_hook
37 *  Created:    95/03/10
38 *
39 *  Description:
40 *      BSP pretasking hook.  Called just before drivers are initialized.
41 *      Used to setup libc and install any BSP extensions.
42 *
43 *  NOTES:
44 *      Must not use libc (to do io) from here, since drivers are
45 *      not yet initialized.
46 *
47 */
48 
49void bsp_pretasking_hook(void)
50{
51    uint32_t heap_start;
52
53    heap_start = (uint32_t) &end;
54    if (heap_start & (CPU_ALIGNMENT-1))
55        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
56
57    bsp_libc_init((void *) heap_start, LIBC_HEAP_SIZE, 0);
58}
59 
60/*
61 *  bsp_start
62 *
63 *  This routine does the bulk of the system initialization.
64 */
65
66void bsp_start( void )
67{
68  extern int WorkspaceBase;
69  extern void mips_install_isr_entries(void);
70
71  Configuration.work_space_start =
72       (void *)((uint64_t)((&end) + LIBC_HEAP_SIZE + 0x100) & ~0x7);
73
74  mips_install_isr_entries();  /* Install generic MIPS exception handler */
75}
76
Note: See TracBrowser for help on using the repository browser.