source: rtems/c/src/lib/libbsp/shared/include/bootcard.h @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 3.9 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup bsp_bootcard
5 *
6 * @brief Standard system startup.
7 */
8
9/*
10 * Copyright (c) 2008
11 * Embedded Brains GmbH
12 * Obere Lagerstr. 30
13 * D-82178 Puchheim
14 * Germany
15 * rtems@embedded-brains.de
16 *
17 * The license and distribution terms for this file may be found in the file
18 * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
19 */
20
21/**
22 * @defgroup bsp_kit Board Support Package
23 *
24 * @brief Board support package dependent code.
25 */
26
27/**
28 * @defgroup bsp_bootcard Bootcard
29 *
30 * @ingroup bsp_kit
31 *
32 * @brief Standard system startup.
33 *
34 * @{
35 */
36
37#ifndef LIBBSP_SHARED_BOOTCARD_H
38#define LIBBSP_SHARED_BOOTCARD_H
39
40#include <stddef.h>
41#include <stdint.h>
42#include <sys/types.h>
43
44#include <bspopts.h>
45
46#ifdef __cplusplus
47extern "C" {
48#endif /* __cplusplus */
49
50/**
51 * @brief Global pointer to the command line of boot_card().
52 */
53extern const char *bsp_boot_cmdline;
54
55void bsp_start(void);
56
57void bsp_pretasking_hook(void);
58
59void bsp_predriver_hook(void);
60
61void bsp_postdriver_hook(void);
62
63void bsp_cleanup(uint32_t status);
64
65void bsp_reset(void);
66
67/**
68 * @brief Should be used as the heap begin address in bsp_get_work_area() if
69 * the heap area is contained in the work area.
70 */
71#define BSP_BOOTCARD_HEAP_USES_WORK_AREA NULL
72
73/**
74 * @brief Should be used to request the default heap size in bsp_get_work_area().
75 *
76 * In case that the heap area is contained in the work area this heap size
77 * value indicates that the area outside the work space should be used as heap
78 * space.
79 */
80#define BSP_BOOTCARD_HEAP_SIZE_DEFAULT 0
81
82void bsp_get_work_area(
83  void      **work_area_begin,
84  uintptr_t  *work_area_size,
85  void      **heap_begin,
86  uintptr_t  *heap_size
87);
88
89/**
90 * @brief Gives the BSP a chance to reduce the work area size with sbrk() adding more later.
91 *
92 * bsp_sbrk_init() may reduce the work area size passed in. The routine
93 * returns the 'sbrk_amount' to be used when extending the heap.
94 * Note that the return value may be zero.
95 *
96 */
97
98#ifdef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK
99uintptr_t bsp_sbrk_init(
100  void              *work_area_begin,
101  uintptr_t         *work_area_size_p
102);
103#endif
104
105
106/**
107 * @brief Standard system initialization procedure.
108 *
109 * You may pass a command line in @a cmdline.  It is later available via the
110 * global @ref bsp_boot_cmdline variable.
111 *
112 * This is the C entry point for ALL RTEMS BSPs.  It is invoked from the
113 * assembly language initialization file usually called @c start.S which does
114 * the basic CPU setup (stack, C runtime environment, zero BSS, load other
115 * sections) and calls afterwards boot_card().  The boot card function provides
116 * the framework for the BSP initialization sequence.  The basic flow of
117 * initialization is:
118 *
119 * - disable interrupts, interrupts will be enabled during the first context
120 *   switch
121 * - bsp_start() - more advanced initialization
122 * - obtain information on BSP memory via bsp_get_work_area() and allocate
123 *   RTEMS Workspace
124 * - rtems_initialize_data_structures()
125 * - allocate memory for C Program Heap
126 * - initialize C Library and C Program Heap
127 * - bsp_pretasking_hook()
128 * - if defined( RTEMS_DEBUG )
129 *   - rtems_debug_enable( RTEMS_DEBUG_ALL_MASK )
130 * - rtems_initialize_before_drivers()
131 * - bsp_predriver_hook()
132 * - rtems_initialize_device_drivers()
133 *   - initialization of all device drivers
134 * - bsp_postdriver_hook()
135 * - rtems_initialize_start_multitasking()
136 *   - 1st task executes C++ global constructors
137 *   - .... application runs ...
138 *   - exit
139 * - back to here eventually
140 * - bsp_cleanup()
141 *
142 * If something goes wrong bsp_cleanup() will be called out of order.
143 *
144 * This style of initialization ensures that the C++ global constructors are
145 * executed after RTEMS is initialized.
146 */
147uint32_t boot_card(const char *cmdline);
148
149/** @} */
150
151void bsp_libc_init(void *heap_begin, uintptr_t heap_size, size_t sbrk_amount);
152
153#ifdef __cplusplus
154}
155#endif /* __cplusplus */
156
157#endif /* LIBBSP_SHARED_BOOTCARD_H */
Note: See TracBrowser for help on using the repository browser.