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

4.104.114.95
Last change on this file since cafa2c5 was cafa2c5, checked in by Joel Sherrill <joel.sherrill@…>, on 12/04/07 at 22:22:03

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.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 *  $Id$
15 */
16
17#include <string.h>
18
19#include <bsp.h>
20#include <libcpu/au1x00.h>
21#include <rtems/libio.h>
22#include <rtems/libcsupport.h>
23
24/*
25 *  The original table from the application and our copy of it with
26 *  some changes.
27 */
28
29extern void            *_sdram_size;
30extern void            *_sdram_base;
31extern void            *_bss_free_start;
32
33unsigned long           free_mem_start;
34unsigned long           free_mem_end;
35
36extern rtems_configuration_table Configuration;
37rtems_configuration_table  BSP_Configuration;
38char *rtems_progname;
39
40au1x00_uart_t *uart0 = (au1x00_uart_t *)AU1X00_UART0_ADDR;
41au1x00_uart_t *uart3 = (au1x00_uart_t *)AU1X00_UART3_ADDR;
42
43/*
44 *  Use the shared implementations of the following routines
45 */
46 
47void bsp_postdriver_hook(void);
48void bsp_libc_init( void *, uint32_t, int );
49
50/*
51 *  Function:   bsp_pretasking_hook
52 *  Created:    95/03/10
53 *
54 *  Description:
55 *      BSP pretasking hook.  Called just before drivers are initialized.
56 *      Used to setup libc and install any BSP extensions.
57 *
58 *  NOTES:
59 *      Must not use libc (to do io) from here, since drivers are
60 *      not yet initialized.
61 *
62 */
63 
64void bsp_pretasking_hook(void)
65{
66    uint32_t heap_start;
67    uint32_t heap_size;
68
69    /*
70     * Set up the heap.
71     */
72    heap_start =  free_mem_start;
73    heap_size = free_mem_end - free_mem_start;
74
75        /* call rtems lib init - malloc stuff */
76    bsp_libc_init((void *)heap_start, heap_size, 0);
77
78#ifdef RTEMS_DEBUG
79    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
80#endif
81
82}
83 
84/*
85 *  bsp_start
86 *
87 *  This routine does the bulk of the system initialization.
88 */
89
90void bsp_start( void )
91{
92  extern void mips_install_isr_entries(void);
93  unsigned int compare = 0;
94
95  /* Place RTEMS workspace at beginning of free memory. */
96  BSP_Configuration.work_space_start = (void *)&_bss_free_start;
97 
98  free_mem_start = ((uint32_t)&_bss_free_start +
99                    BSP_Configuration.work_space_size);
100 
101  free_mem_end = ((uint32_t)&_sdram_base + (uint32_t)&_sdram_size);
102 
103  mips_set_sr( 0x7f00 );  /* all interrupts unmasked but globally off */
104                          /* depend on the IRC to take care of things */
105  asm volatile ("mtc0 %0, $11\n" :: "r" (compare));
106  mips_install_isr_entries();
107}
108
109
110/* These replace the ones in newlib. I'm not sure why the newlib ones
111 * don't work.
112 */
113void _init(void)
114{
115}
116
117void _fini(void)
118{
119}
Note: See TracBrowser for help on using the repository browser.