source: rtems/c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c @ 2211b75c

4.104.114.95
Last change on this file since 2211b75c was 2211b75c, checked in by Joel Sherrill <joel.sherrill@…>, on 05/15/08 at 15:54:55

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

  • configure.ac, 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.7 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-2008.
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 *  $Id$
15 */
16
17#include <bsp.h>
18
19/*
20 *  This method returns the base address and size of the area which
21 *  is to be allocated between the RTEMS Workspace and the C Program
22 *  Heap.
23 */
24void bsp_get_workarea(
25  void   **workarea_base,
26  size_t  *workarea_size,
27  size_t  *requested_heap_size
28)
29{
30  extern int WorkspaceBase;
31  extern int end;
32
33  *workarea_base       = &WorkspaceBase;
34  *workarea_size       = (void *)&end - (void *)&WorkspaceBase;
35  *requested_heap_size = 0;
36}
37
38/*
39 *  bsp_start
40 *
41 *  This routine does the bulk of the system initialization.
42 */
43
44void bsp_start( void )
45{
46  extern void mips_install_isr_entries(void);
47
48  mips_set_sr( 0xff00 );  /* all interrupts unmasked but globally off */
49                          /* depend on the IRC to take care of things */
50  mips_install_isr_entries();
51}
52
53/*
54 *  Required routine by some gcc run-times.
55 */
56void clear_cache( void *address, size_t n )
57{
58}
59
60/* Structure filled in by get_mem_info.  Only the size field is
61   actually used (to clear bss), so the others aren't even filled in.  */
62
63struct s_mem
64{
65  unsigned int size;
66  unsigned int icsize;
67  unsigned int dcsize;
68};
69
70void
71get_mem_info (mem)
72     struct s_mem *mem;
73{
74  mem->size = 0x1000000;        /* XXX figure out something here */
75}
Note: See TracBrowser for help on using the repository browser.