source: rtems/c/src/lib/libbsp/shared/bootcard.c @ ca4602e

5
Last change on this file since ca4602e was ca4602e, checked in by Sebastian Huber <sebastian.huber@…>, on 01/25/16 at 21:03:00

Use linker set for libio initialization

Update #2408.

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup bsp_bootcard
5 *
6 * @brief Standard system startup.
7 *
8 *  This is the C entry point for ALL RTEMS BSPs.  It is invoked
9 *  from the assembly language initialization file usually called
10 *  start.S.  It provides the framework for the BSP initialization
11 *  sequence.  For the basic flow of initialization see RTEMS C User's Guide,
12 *  Initialization Manager.
13 *
14 *  This style of initialization ensures that the C++ global
15 *  constructors are executed after RTEMS is initialized.
16 *  Thanks to Chris Johns <cjohns@plessey.com.au> for the idea
17 *  to move C++ global constructors into the first task.
18 */
19
20/*
21 *  COPYRIGHT (c) 1989-2014.
22 *  On-Line Applications Research Corporation (OAR).
23 *
24 *  The license and distribution terms for this file may be
25 *  found in the file LICENSE in this distribution or at
26 *  http://www.rtems.org/license/LICENSE.
27 */
28
29#include <bsp/bootcard.h>
30
31#include <rtems.h>
32#include <rtems/sysinit.h>
33
34/*
35 *  At most a single pointer to the cmdline for those target
36 *  short on memory and not supporting a command line.
37 */
38const char *bsp_boot_cmdline;
39
40RTEMS_SYSINIT_ITEM(
41  bsp_work_area_initialize,
42  RTEMS_SYSINIT_BSP_WORK_AREAS,
43  RTEMS_SYSINIT_ORDER_MIDDLE
44);
45
46RTEMS_SYSINIT_ITEM(
47  bsp_start,
48  RTEMS_SYSINIT_BSP_START,
49  RTEMS_SYSINIT_ORDER_MIDDLE
50);
51
52RTEMS_SYSINIT_ITEM(
53  bsp_predriver_hook,
54  RTEMS_SYSINIT_BSP_PRE_DRIVERS,
55  RTEMS_SYSINIT_ORDER_MIDDLE
56);
57
58/*
59 *  This is the initialization framework routine that weaves together
60 *  calls to RTEMS and the BSP in the proper sequence to initialize
61 *  the system while maximizing shared code and keeping BSP code in C
62 *  as much as possible.
63 */
64void boot_card(
65  const char *cmdline
66)
67{
68  rtems_interrupt_level  bsp_isr_level;
69
70  /*
71   *  Make sure interrupts are disabled.
72   */
73  (void) bsp_isr_level;
74  rtems_interrupt_local_disable( bsp_isr_level );
75
76  bsp_boot_cmdline = cmdline;
77
78  rtems_initialize_executive();
79
80  /***************************************************************
81   ***************************************************************
82   *  APPLICATION RUNS NOW!!!  We will not return to here!!!     *
83   ***************************************************************
84   ***************************************************************/
85}
Note: See TracBrowser for help on using the repository browser.