forked from Imagelibrary/rtems
bsp/raspberrypi: Use shared start code
This commit is contained in:
@@ -21,26 +21,10 @@
|
||||
* http://www.rtems.com/license/LICENSE
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <bspopts.h>
|
||||
#include <bsp/start.h>
|
||||
#include <bsp/raspberrypi.h>
|
||||
#include <bsp/mmu.h>
|
||||
#include <bsp/linker-symbols.h>
|
||||
#include <bsp/uart-output-char.h>
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user