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

4.104.114.84.95
Last change on this file since cba119c9 was 418899d, checked in by Ralf Corsepius <ralf.corsepius@…>, on 05/10/05 at 06:27:31

Eliminate unsigned{8|16|32}.

  • Property mode set to 100644
File size: 3.0 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.OARcorp.com/rtems/license.html.
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;
37
38rtems_configuration_table  BSP_Configuration;
39
40rtems_cpu_table Cpu_table;
41
42char *rtems_progname;
43
44au1x00_uart_t *uart0 = (au1x00_uart_t *)AU1X00_UART0_ADDR;
45au1x00_uart_t *uart3 = (au1x00_uart_t *)AU1X00_UART3_ADDR;
46
47/*
48 *  Use the shared implementations of the following routines
49 */
50 
51void bsp_postdriver_hook(void);
52void bsp_libc_init( void *, uint32_t, int );
53
54/*
55 *  Function:   bsp_pretasking_hook
56 *  Created:    95/03/10
57 *
58 *  Description:
59 *      BSP pretasking hook.  Called just before drivers are initialized.
60 *      Used to setup libc and install any BSP extensions.
61 *
62 *  NOTES:
63 *      Must not use libc (to do io) from here, since drivers are
64 *      not yet initialized.
65 *
66 */
67 
68void bsp_pretasking_hook(void)
69{
70    uint32_t heap_start;
71    uint32_t heap_size;
72
73    /*
74     * Set up the heap.
75     */
76    heap_start =  free_mem_start;
77    heap_size = free_mem_end - free_mem_start;
78
79        /* call rtems lib init - malloc stuff */
80    bsp_libc_init((void *)heap_start, heap_size, 0);
81
82#ifdef RTEMS_DEBUG
83    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
84#endif
85
86}
87 
88/*
89 *  bsp_start
90 *
91 *  This routine does the bulk of the system initialization.
92 */
93
94void bsp_start( void )
95{
96  extern void mips_install_isr_entries(void);
97  unsigned int compare = 0;
98  /* Configure Number of Register Caches */
99
100  Cpu_table.pretasking_hook = bsp_pretasking_hook;  /* init libc, etc. */
101  Cpu_table.postdriver_hook = bsp_postdriver_hook;
102  Cpu_table.interrupt_stack_size = 8192;
103
104  /* Place RTEMS workspace at beginning of free memory. */
105  BSP_Configuration.work_space_start = (void *)&_bss_free_start;
106 
107  free_mem_start = ((uint32_t)&_bss_free_start +
108                    BSP_Configuration.work_space_size);
109 
110  free_mem_end = ((uint32_t)&_sdram_base + (uint32_t)&_sdram_size);
111 
112  mips_set_sr( 0x7f00 );  /* all interrupts unmasked but globally off */
113                          /* depend on the IRC to take care of things */
114  asm volatile ("mtc0 %0, $11\n" :: "r" (compare));
115  mips_install_isr_entries();
116}
117
118
119/* These replace the ones in newlib. I'm not sure why the newlib ones
120 * don't work.
121 */
122void _init(void)
123{
124}
125
126void _fini(void)
127{
128}
Note: See TracBrowser for help on using the repository browser.