1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup RTEMSBSPsSharedStartup |
---|
5 | */ |
---|
6 | |
---|
7 | /* |
---|
8 | * COPYRIGHT (c) 1989-2014. |
---|
9 | * On-Line Applications Research Corporation (OAR). |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in the file LICENSE in this distribution or at |
---|
13 | * http://www.rtems.org/license/LICENSE. |
---|
14 | */ |
---|
15 | |
---|
16 | #include <bsp/bootcard.h> |
---|
17 | |
---|
18 | #include <rtems.h> |
---|
19 | #include <rtems/sysinit.h> |
---|
20 | |
---|
21 | /* |
---|
22 | * At most a single pointer to the cmdline for those target |
---|
23 | * short on memory and not supporting a command line. |
---|
24 | */ |
---|
25 | const char *bsp_boot_cmdline; |
---|
26 | |
---|
27 | #if BSP_DIRTY_MEMORY == 1 |
---|
28 | static void bsp_dirty_memory(void) |
---|
29 | { |
---|
30 | _Memory_Fill( _Memory_Get(), 0xcf ); |
---|
31 | } |
---|
32 | |
---|
33 | RTEMS_SYSINIT_ITEM( |
---|
34 | bsp_dirty_memory, |
---|
35 | RTEMS_SYSINIT_DIRTY_MEMORY, |
---|
36 | RTEMS_SYSINIT_ORDER_MIDDLE |
---|
37 | ); |
---|
38 | #endif |
---|
39 | |
---|
40 | RTEMS_SYSINIT_ITEM( |
---|
41 | bsp_start, |
---|
42 | RTEMS_SYSINIT_BSP_START, |
---|
43 | RTEMS_SYSINIT_ORDER_MIDDLE |
---|
44 | ); |
---|
45 | |
---|
46 | /* |
---|
47 | * This is the initialization framework routine that weaves together |
---|
48 | * calls to RTEMS and the BSP in the proper sequence to initialize |
---|
49 | * the system while maximizing shared code and keeping BSP code in C |
---|
50 | * as much as possible. |
---|
51 | */ |
---|
52 | void boot_card( |
---|
53 | const char *cmdline |
---|
54 | ) |
---|
55 | { |
---|
56 | ISR_Level bsp_isr_level; |
---|
57 | |
---|
58 | /* |
---|
59 | * Make sure interrupts are disabled. Directly use the CPU port API to allow |
---|
60 | * tracing of the higher level interrupt disable/enable routines, e.g. |
---|
61 | * _ISR_Local_disable() and _ISR_Local_enable(). |
---|
62 | */ |
---|
63 | _CPU_ISR_Disable( bsp_isr_level ); |
---|
64 | (void) bsp_isr_level; |
---|
65 | |
---|
66 | bsp_boot_cmdline = cmdline; |
---|
67 | |
---|
68 | rtems_initialize_executive(); |
---|
69 | |
---|
70 | /*************************************************************** |
---|
71 | *************************************************************** |
---|
72 | * APPLICATION RUNS NOW!!! We will not return to here!!! * |
---|
73 | *************************************************************** |
---|
74 | ***************************************************************/ |
---|
75 | } |
---|