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

4.104.114.9
Last change on this file since cafa2c5 was cafa2c5, checked in by Joel Sherrill <joel.sherrill@…>, on Dec 4, 2007 at 10:22:03 PM

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.5 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 *  $Id$
15 */
16
17#include <string.h>
18
19#include <bsp.h>
20#include <rtems/libio.h>
21#include <rtems/libcsupport.h>
22
23/*
24 *  The original table from the application and our copy of it with
25 *  some changes.
26 */
27
28extern rtems_configuration_table Configuration;
29rtems_configuration_table  BSP_Configuration;
30char *rtems_progname;
31
32/*
33 *  Use the shared implementations of the following routines
34 */
35
36void bsp_postdriver_hook(void);
37void bsp_libc_init( void *, uint32_t, int );
38
39/*
40 *  Function:   bsp_pretasking_hook
41 *  Created:    95/03/10
42 *
43 *  Description:
44 *      BSP pretasking hook.  Called just before drivers are initialized.
45 *      Used to setup libc and install any BSP extensions.
46 *
47 *  NOTES:
48 *      Must not use libc (to do io) from here, since drivers are
49 *      not yet initialized.
50 *
51 */
52
53void bsp_pretasking_hook(void)
54{
55    extern int HeapBase;
56    extern int HeapSize;
57    void         *heapStart = &HeapBase;
58    unsigned long heapSize = (unsigned long)&HeapSize;
59
60    bsp_libc_init(heapStart, (uint32_t) heapSize, 0);
61
62#ifdef RTEMS_DEBUG
63    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
64#endif
65
66}
67
68/*
69 *  bsp_start
70 *
71 *  This routine does the bulk of the system initialization.
72 */
73
74void bsp_start( void )
75{
76  extern int WorkspaceBase;
77  extern void _sys_exit(int);
78  extern void mips_install_isr_entries(void);
79
80  /* HACK -- tied to value linkcmds */
81  if ( BSP_Configuration.work_space_size >(4096*1024) )
82   _sys_exit( 1 );
83
84  BSP_Configuration.work_space_start = (void *) &WorkspaceBase;
85
86  mips_set_sr( 0xff00 );  /* all interrupts unmasked but globally off */
87                          /* depend on the IRC to take care of things */
88  mips_install_isr_entries();
89}
90
91/* XXX */
92void clear_cache( void *address, size_t n )
93{
94}
95
96/* Structure filled in by get_mem_info.  Only the size field is
97   actually used (to clear bss), so the others aren't even filled in.  */
98
99struct s_mem
100{
101  unsigned int size;
102  unsigned int icsize;
103  unsigned int dcsize;
104};
105
106void
107get_mem_info (mem)
108     struct s_mem *mem;
109{
110  mem->size = 0x1000000;        /* XXX figure out something here */
111}
Note: See TracBrowser for help on using the repository browser.