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