Changeset f2e9d0d in rtems


Ignore:
Timestamp:
May 6, 2013, 7:59:16 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
33c98fd
Parents:
86b79fb
git-author:
Sebastian Huber <sebastian.huber@…> (05/06/13 07:59:16)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/06/13 13:06:52)
Message:

bsp/raspberrypi: Use shared start code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/raspberrypi/startup/bspstarthooks.c

    r86b79fb rf2e9d0d  
    2222 */
    2323
    24 #include <stdbool.h>
    25 
    2624#include <bspopts.h>
    2725#include <bsp/start.h>
    2826#include <bsp/raspberrypi.h>
    2927#include <bsp/mmu.h>
    30 #include <bsp/linker-symbols.h>
    31 #include <bsp/uart-output-char.h>
    32 
    33 static void BSP_START_TEXT_SECTION clear_bss(void)
    34 {
    35   const int *end = (const int *) bsp_section_bss_end;
    36   int *out = (int *) bsp_section_bss_begin;
    37 
    38   /* Clear BSS */
    39   while (out != end) {
    40     *out = 0;
    41     ++out;
    42   }
    43 }
    4428
    4529static void BSP_START_TEXT_SECTION raspberrypi_cache_setup(void)
     
    6852void BSP_START_TEXT_SECTION bsp_start_hook_1(void)
    6953{
    70 
    71     /* Copy .text section */
    72     arm_cp15_instruction_cache_invalidate();
    73     bsp_start_memcpy(
    74                      (int *) bsp_section_text_begin,
    75                      (const int *) bsp_section_text_load_begin,
    76                      (size_t) bsp_section_text_size
    77                      );
    78 
    79     /* Copy .rodata section */
    80     arm_cp15_instruction_cache_invalidate();
    81     bsp_start_memcpy(
    82                      (int *) bsp_section_rodata_begin,
    83                      (const int *) bsp_section_rodata_load_begin,
    84                      (size_t) bsp_section_rodata_size
    85                      );
    86 
    87     /* Copy .data section */
    88     arm_cp15_instruction_cache_invalidate();
    89     bsp_start_memcpy(
    90                      (int *) bsp_section_data_begin,
    91                      (const int *) bsp_section_data_load_begin,
    92                      (size_t) bsp_section_data_size
    93                      );
    94 
    95     /* Copy .fast_text section */
    96     arm_cp15_instruction_cache_invalidate();
    97     bsp_start_memcpy(
    98                      (int *) bsp_section_fast_text_begin,
    99                      (const int *) bsp_section_fast_text_load_begin,
    100                      (size_t) bsp_section_fast_text_size
    101                      );
    102 
    103     /* Copy .fast_data section */
    104     arm_cp15_instruction_cache_invalidate();
    105     bsp_start_memcpy(
    106                      (int *) bsp_section_fast_data_begin,
    107                      (const int *) bsp_section_fast_data_load_begin,
    108                      (size_t) bsp_section_fast_data_size
    109                      );
    110 
    111   /* Clear .bss section */
    112   clear_bss();
    113 
     54  bsp_start_copy_sections();
     55  bsp_start_clear_bss();
    11456}
Note: See TracChangeset for help on using the changeset viewer.