source: rtems/c/src/lib/libbsp/arm/shared/startup/bsp-start-copy-sections.c @ 4c622e5

4.115
Last change on this file since 4c622e5 was 4c622e5, checked in by Sebastian Huber <sebastian.huber@…>, on Nov 8, 2011 at 10:18:19 AM

2011-11-08 Sebastian Huber <sebastian.huber@…>

  • shared/startup/bsp-start-copy-sections.c, shared/startup/bsp-start-memcpy.S: New files.
  • shared/include/start.h: Declare bsp_start_copy_sections().
  • shared/start/start.S, shared/include/linker-symbols.h: Moved content. Support for ARMv7-M.
  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2 * Copyright (c) 2008-2011 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Obere Lagerstr. 30
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
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
15#include <bsp/start.h>
16#include <bsp/linker-symbols.h>
17
18static void BSP_START_TEXT_SECTION bsp_start_clear_bss(void)
19{
20  const int *end = (const int *) bsp_section_bss_end;
21  int *out = (int *) bsp_section_bss_begin;
22
23  /* Clear BSS */
24  while (out != end) {
25    *out = 0;
26    ++out;
27  }
28}
29
30void BSP_START_TEXT_SECTION bsp_start_copy_sections(void)
31{
32  /* Copy .text section */
33  bsp_start_memcpy(
34    (int *) bsp_section_text_begin,
35    (const int *) bsp_section_text_load_begin,
36    (size_t) bsp_section_text_size
37  );
38
39  /* Copy .rodata section */
40  bsp_start_memcpy(
41    (int *) bsp_section_rodata_begin,
42    (const int *) bsp_section_rodata_load_begin,
43    (size_t) bsp_section_rodata_size
44  );
45
46  /* Copy .data section */
47  bsp_start_memcpy(
48    (int *) bsp_section_data_begin,
49    (const int *) bsp_section_data_load_begin,
50    (size_t) bsp_section_data_size
51  );
52
53  /* Copy .fast_text section */
54  bsp_start_memcpy(
55    (int *) bsp_section_fast_text_begin,
56    (const int *) bsp_section_fast_text_load_begin,
57    (size_t) bsp_section_fast_text_size
58  );
59
60  /* Copy .fast_data section */
61  bsp_start_memcpy(
62    (int *) bsp_section_fast_data_begin,
63    (const int *) bsp_section_fast_data_load_begin,
64    (size_t) bsp_section_fast_data_size
65  );
66
67  bsp_start_clear_bss();
68}
Note: See TracBrowser for help on using the repository browser.