source: rtems/c/src/lib/libbsp/arm/shared/include/start.h @ 287bbb6

4.115
Last change on this file since 287bbb6 was 287bbb6, checked in by Sebastian Huber <sebastian.huber@…>, on 08/30/13 at 15:43:16

bsps/arm: Use ALIGN_WITH_INPUT

This requires at least Binutils 2.24.

  • Property mode set to 100644
File size: 3.0 KB
RevLine 
[8dcfc0a]1/**
2 * @file
3 *
[98eb7e78]4 * @ingroup arm_start
[091705c]5 *
[98eb7e78]6 * @brief ARM system low level start.
[8dcfc0a]7 */
8
9/*
[fb0584f]10 * Copyright (c) 2008-2013 embedded brains GmbH.  All rights reserved.
[4c622e5]11 *
12 *  embedded brains GmbH
13 *  Obere Lagerstr. 30
14 *  82178 Puchheim
15 *  Germany
16 *  <rtems@embedded-brains.de>
[8dcfc0a]17 *
[091705c]18 * The license and distribution terms for this file may be
19 * found in the file LICENSE in this distribution or at
20 * http://www.rtems.com/license/LICENSE.
[8dcfc0a]21 */
22
23#ifndef LIBBSP_ARM_SHARED_START_H
24#define LIBBSP_ARM_SHARED_START_H
25
[fb0584f]26#include <string.h>
27
28#include <bsp/linker-symbols.h>
[8dcfc0a]29
[c3dd440]30#ifdef __cplusplus
31extern "C" {
32#endif /* __cplusplus */
33
[091705c]34/**
[98eb7e78]35 * @defgroup arm_start System Start
[091705c]36 *
[296c74e6]37 * @ingroup arm_shared
[091705c]38 *
[98eb7e78]39 * @brief ARM system low level start.
[091705c]40 *
41 * @{
42 */
[9647f7fe]43
[a3579d3b]44#define BSP_START_TEXT_SECTION __attribute__((section(".bsp_start_text")))
[c3dd440]45
46#define BSP_START_DATA_SECTION __attribute__((section(".bsp_start_data")))
47
[091705c]48/**
49* @brief System start entry.
50*/
[a3579d3b]51void _start(void);
[8dcfc0a]52
[091705c]53/**
54* @brief Start entry hook 0.
55*
56* This hook will be called from the start entry code after all modes and
57* stack pointers are initialized but before the copying of the exception
58* vectors.
59*/
60void bsp_start_hook_0(void);
[8dcfc0a]61
[091705c]62/**
63* @brief Start entry hook 1.
64*
65* This hook will be called from the start entry code after copying of the
66* exception vectors but before the call to boot_card().
67*/
68void bsp_start_hook_1(void);
[8dcfc0a]69
[091705c]70/**
71 * @brief Similar to standard memcpy().
72 *
73 * The memory areas must be word aligned.  Copy code will be executed from the
74 * stack.  If @a dest equals @a src nothing will be copied.
75 */
76void bsp_start_memcpy(int *dest, const int *src, size_t n);
[8dcfc0a]77
[091705c]78/**
79 * @brief ARM entry point to bsp_start_memcpy().
80 */
81void bsp_start_memcpy_arm(int *dest, const int *src, size_t n);
[8dcfc0a]82
[4c622e5]83/**
84 * @brief Copies all standard sections from the load to the runtime area.
85 */
[fb0584f]86BSP_START_TEXT_SECTION static inline void bsp_start_copy_sections(void)
87{
88  /* Copy .text section */
89  bsp_start_memcpy(
90    (int *) bsp_section_text_begin,
91    (const int *) bsp_section_text_load_begin,
92    (size_t) bsp_section_text_size
93  );
94
95  /* Copy .rodata section */
96  bsp_start_memcpy(
97    (int *) bsp_section_rodata_begin,
98    (const int *) bsp_section_rodata_load_begin,
99    (size_t) bsp_section_rodata_size
100  );
101
102  /* Copy .data section */
103  bsp_start_memcpy(
104    (int *) bsp_section_data_begin,
105    (const int *) bsp_section_data_load_begin,
106    (size_t) bsp_section_data_size
107  );
108
109  /* Copy .fast_text section */
110  bsp_start_memcpy(
111    (int *) bsp_section_fast_text_begin,
112    (const int *) bsp_section_fast_text_load_begin,
113    (size_t) bsp_section_fast_text_size
114  );
115
116  /* Copy .fast_data section */
117  bsp_start_memcpy(
118    (int *) bsp_section_fast_data_begin,
119    (const int *) bsp_section_fast_data_load_begin,
120    (size_t) bsp_section_fast_data_size
121  );
122}
123
124BSP_START_TEXT_SECTION static inline void bsp_start_clear_bss(void)
125{
126  memset(bsp_section_bss_begin, 0, (size_t) bsp_section_bss_size);
127}
[4c622e5]128
[091705c]129/** @} */
[8dcfc0a]130
[c3dd440]131#ifdef __cplusplus
132}
133#endif /* __cplusplus */
134
[8dcfc0a]135#endif /* LIBBSP_ARM_SHARED_START_H */
Note: See TracBrowser for help on using the repository browser.