source: rtems/c/src/lib/libbsp/mips/genmongoosev/startup/bspstart.c @ 3491e9e

4.104.114.84.9
Last change on this file since 3491e9e was 3491e9e, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 16, 2001 at 7:30:12 PM

2001-04-16 Joel Sherrill <joel@…>

  • start/start.S, startup/bspstart.c, startup/linkcmds: Modifications made with Gregory Menke <gregory.menke@…> as he debugged this BSP using a logic analyzer.
  • Property mode set to 100644
File size: 2.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-2001.
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.OARcorp.com/rtems/license.html.
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#include <libcpu/mongoose-v.h>
23
24
25/*
26 *  The original table from the application and our copy of it with
27 *  some changes.
28 */
29
30extern rtems_configuration_table Configuration;
31
32rtems_configuration_table  BSP_Configuration;
33
34rtems_cpu_table Cpu_table;
35
36char *rtems_progname;
37
38/*
39 *  Use the shared implementations of the following routines
40 */
41 
42void bsp_postdriver_hook(void);
43void bsp_libc_init( void *, unsigned32, int );
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    extern int HeapBase;
62    extern int HeapSize;
63    void         *heapStart = &HeapBase;
64    unsigned long heapSize = (unsigned long)&HeapSize;
65    unsigned long ramSpace;
66
67    bsp_libc_init(heapStart, (unsigned32) heapSize, 0);
68
69#ifdef RTEMS_DEBUG
70    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
71#endif
72
73}
74
75 
76/*
77 *  bsp_start
78 *
79 *  This routine does the bulk of the system initialization.
80 */
81
82void bsp_start( void )
83{
84  extern int _end;
85  extern int WorkspaceBase;
86  /* Configure Number of Register Caches */
87
88  Cpu_table.pretasking_hook = bsp_pretasking_hook;  /* init libc, etc. */
89  Cpu_table.postdriver_hook = bsp_postdriver_hook;
90  Cpu_table.interrupt_stack_size = 4096;
91
92  /* HACK -- tied to value linkcmds */
93  if ( BSP_Configuration.work_space_size >(4096*1024) )
94   _sys_exit( 1 );
95
96  BSP_Configuration.work_space_start = (void *) &WorkspaceBase;
97
98  MONGOOSEV_WRITE( MONGOOSEV_PERIPHERAL_FUNCTION_INTERRUPT_CAUSE_REGISTER, 0 );
99  mips_set_sr( 0xff00 );  /* all interrupts unmasked but globally off */
100                          /* depend on the IRC to take care of things */
101  mips_install_isr_entries();
102}
103
104/* XXX */
105void clear_cache( void *address, size_t n )
106{
107}
108
109/* Structure filled in by get_mem_info.  Only the size field is
110   actually used (to clear bss), so the others aren't even filled in.  */
111
112struct s_mem
113{
114  unsigned int size;
115  unsigned int icsize;
116  unsigned int dcsize;
117};
118
119
120void
121get_mem_info (mem)
122     struct s_mem *mem;
123{
124  mem->size = 0x1000000;        /* XXX figure out something here */
125}
126
Note: See TracBrowser for help on using the repository browser.