forked from Imagelibrary/rtems
bsp/lm3s69xx: Use shared start.S
This commit is contained in:
@@ -45,7 +45,7 @@ include_HEADERS += ../../shared/include/tm27.h
|
||||
|
||||
noinst_LIBRARIES = libbspstart.a
|
||||
|
||||
libbspstart_a_SOURCES = start/start.S
|
||||
libbspstart_a_SOURCES = ../shared/start/start.S
|
||||
|
||||
project_lib_DATA = start.$(OBJEXT)
|
||||
|
||||
@@ -75,9 +75,11 @@ libbsp_a_SOURCES += ../../shared/bootcard.c \
|
||||
../../shared/src/stackalloc.c
|
||||
|
||||
# Startup
|
||||
libbsp_a_SOURCES += startup/bspstart.c \
|
||||
startup/bspstarthook.c \
|
||||
startup/bspreset.c
|
||||
libbsp_a_SOURCES += ../shared/startup/bsp-start-copy-sections.c
|
||||
libbsp_a_SOURCES += ../shared/startup/bsp-start-memcpy.S
|
||||
libbsp_a_SOURCES += startup/bspstart.c
|
||||
libbsp_a_SOURCES += startup/bspstarthook.c
|
||||
libbsp_a_SOURCES += startup/bspreset.c
|
||||
|
||||
# IRQ
|
||||
libbsp_a_SOURCES += ../../shared/src/irq-generic.c \
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2011 embedded brains GmbH. All rights reserved.
|
||||
*
|
||||
* embedded brains GmbH
|
||||
* Obere Lagerstr. 30
|
||||
* 82178 Puchheim
|
||||
* Germany
|
||||
* <rtems@embedded-brains.de>
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <rtems/asm.h>
|
||||
#include <rtems/system.h>
|
||||
#include <rtems/score/cpu.h>
|
||||
|
||||
#include <bspopts.h>
|
||||
#include <bsp/irq.h>
|
||||
#include <bsp/linker-symbols.h>
|
||||
|
||||
/* External symbols */
|
||||
|
||||
.extern bsp_start_hook
|
||||
.extern boot_card
|
||||
.extern bsp_reset
|
||||
|
||||
/* Global symbols */
|
||||
|
||||
.globl _start
|
||||
|
||||
.syntax unified
|
||||
|
||||
.section ".bsp_start_text", "ax"
|
||||
.thumb
|
||||
.word bsp_stack_main_end
|
||||
.word _start /* Reset */
|
||||
.word bsp_reset /* NMI */
|
||||
.word bsp_reset /* Hard Fault */
|
||||
.word bsp_reset /* MPU Fault */
|
||||
.word bsp_reset /* Bus Fault */
|
||||
.word bsp_reset /* Usage Fault */
|
||||
.word 0 /* Reserved */
|
||||
.word 0 /* Reserved */
|
||||
.word 0 /* Reserved */
|
||||
.word 0 /* Reserved */
|
||||
.word bsp_reset /* SVC */
|
||||
.word bsp_reset /* Debug Monitor */
|
||||
.word 0 /* Reserved */
|
||||
.word bsp_reset /* PendSV */
|
||||
.word bsp_reset /* SysTick */
|
||||
.rept BSP_INTERRUPT_VECTOR_MAX - 15
|
||||
.word bsp_reset /* IRQ */
|
||||
.endr
|
||||
|
||||
.thumb_func
|
||||
_start:
|
||||
bl bsp_start_hook_0
|
||||
mov r0, #0
|
||||
bl boot_card
|
||||
|
||||
twiddle:
|
||||
bl bsp_reset
|
||||
b twiddle
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011 Sebastian Huber. All rights reserved.
|
||||
* Copyright (c) 2011-2012 Sebastian Huber. All rights reserved.
|
||||
*
|
||||
* embedded brains GmbH
|
||||
* Obere Lagerstr. 30
|
||||
@@ -12,74 +12,17 @@
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <bspopts.h>
|
||||
#include <bsp.h>
|
||||
#include <bsp/start.h>
|
||||
#include <bsp/linker-symbols.h>
|
||||
|
||||
static void BSP_START_TEXT_SECTION copy(int *dst, const int *src, int n)
|
||||
{
|
||||
if (src != dst) {
|
||||
const int *end = dst + (n + sizeof(int) - 1) / sizeof(int);
|
||||
|
||||
while (dst != end) {
|
||||
*dst = *src;
|
||||
++src;
|
||||
++dst;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void BSP_START_TEXT_SECTION clear_bss(void)
|
||||
{
|
||||
int *dst = (int *) bsp_section_bss_begin;
|
||||
int n = (int) bsp_section_bss_size;
|
||||
const int *end = dst + (n + sizeof(int) - 1) / sizeof(int);
|
||||
|
||||
while (dst != end) {
|
||||
*dst = 0;
|
||||
++dst;
|
||||
}
|
||||
}
|
||||
|
||||
void BSP_START_TEXT_SECTION bsp_start_hook_0(void)
|
||||
{
|
||||
/* Copy .text section */
|
||||
copy(
|
||||
(int *) bsp_section_text_begin,
|
||||
(const int *) bsp_section_text_load_begin,
|
||||
(size_t) bsp_section_text_size
|
||||
);
|
||||
/* Do nothing */
|
||||
}
|
||||
|
||||
/* Copy .rodata section */
|
||||
copy(
|
||||
(int *) bsp_section_rodata_begin,
|
||||
(const int *) bsp_section_rodata_load_begin,
|
||||
(size_t) bsp_section_rodata_size
|
||||
);
|
||||
|
||||
/* Copy .data section */
|
||||
copy(
|
||||
(int *) bsp_section_data_begin,
|
||||
(const int *) bsp_section_data_load_begin,
|
||||
(size_t) bsp_section_data_size
|
||||
);
|
||||
|
||||
/* Copy .fast_text section */
|
||||
copy(
|
||||
(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 */
|
||||
copy(
|
||||
(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();
|
||||
void BSP_START_TEXT_SECTION bsp_start_hook_1(void)
|
||||
{
|
||||
bsp_start_copy_sections();
|
||||
|
||||
/* At this point we can use objects outside the .start section */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user