From f2e9d0df8ab6d3aa1d64cc41a053e05998dbcd7a Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 6 May 2013 09:59:16 +0200 Subject: bsp/raspberrypi: Use shared start code --- .../libbsp/arm/raspberrypi/startup/bspstarthooks.c | 62 +--------------------- 1 file changed, 2 insertions(+), 60 deletions(-) (limited to 'c/src/lib/libbsp/arm/raspberrypi/startup/bspstarthooks.c') diff --git a/c/src/lib/libbsp/arm/raspberrypi/startup/bspstarthooks.c b/c/src/lib/libbsp/arm/raspberrypi/startup/bspstarthooks.c index 1d2591f6d5..a2241687cc 100644 --- a/c/src/lib/libbsp/arm/raspberrypi/startup/bspstarthooks.c +++ b/c/src/lib/libbsp/arm/raspberrypi/startup/bspstarthooks.c @@ -21,26 +21,10 @@ * http://www.rtems.com/license/LICENSE */ -#include - #include #include #include #include -#include -#include - -static void BSP_START_TEXT_SECTION clear_bss(void) -{ - const int *end = (const int *) bsp_section_bss_end; - int *out = (int *) bsp_section_bss_begin; - - /* Clear BSS */ - while (out != end) { - *out = 0; - ++out; - } -} static void BSP_START_TEXT_SECTION raspberrypi_cache_setup(void) { @@ -67,48 +51,6 @@ void BSP_START_TEXT_SECTION bsp_start_hook_0(void) void BSP_START_TEXT_SECTION bsp_start_hook_1(void) { - - /* Copy .text section */ - arm_cp15_instruction_cache_invalidate(); - bsp_start_memcpy( - (int *) bsp_section_text_begin, - (const int *) bsp_section_text_load_begin, - (size_t) bsp_section_text_size - ); - - /* Copy .rodata section */ - arm_cp15_instruction_cache_invalidate(); - bsp_start_memcpy( - (int *) bsp_section_rodata_begin, - (const int *) bsp_section_rodata_load_begin, - (size_t) bsp_section_rodata_size - ); - - /* Copy .data section */ - arm_cp15_instruction_cache_invalidate(); - bsp_start_memcpy( - (int *) bsp_section_data_begin, - (const int *) bsp_section_data_load_begin, - (size_t) bsp_section_data_size - ); - - /* Copy .fast_text section */ - arm_cp15_instruction_cache_invalidate(); - bsp_start_memcpy( - (int *) bsp_section_fast_text_begin, - (const int *) bsp_section_fast_text_load_begin, - (size_t) bsp_section_fast_text_size - ); - - /* Copy .fast_data section */ - arm_cp15_instruction_cache_invalidate(); - bsp_start_memcpy( - (int *) bsp_section_fast_data_begin, - (const int *) bsp_section_fast_data_load_begin, - (size_t) bsp_section_fast_data_size - ); - - /* Clear .bss section */ - clear_bss(); - + bsp_start_copy_sections(); + bsp_start_clear_bss(); } -- cgit v1.2.3