Changeset 4c622e5 in rtems


Ignore:
Timestamp:
Nov 8, 2011, 10:18:19 AM (8 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
4a6cc2a
Parents:
d922dab
Message:

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.
Location:
c/src/lib/libbsp/arm
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/ChangeLog

    rd922dab r4c622e5  
     12011-11-08      Sebastian Huber <sebastian.huber@embedded-brains.de>
     2
     3        * shared/startup/bsp-start-copy-sections.c,
     4        shared/startup/bsp-start-memcpy.S: New files.
     5        * shared/include/start.h: Declare bsp_start_copy_sections().
     6        * shared/start/start.S, shared/include/linker-symbols.h: Moved
     7        content.  Support for ARMv7-M.
     8
    192011-09-24      Sebastian Huber <sebastian.huber@embedded-brains.de>
    210
  • c/src/lib/libbsp/arm/shared/include/linker-symbols.h

    rd922dab r4c622e5  
    117117LINKER_SYMBOL(bsp_vector_table_size)
    118118
     119LINKER_SYMBOL(bsp_start_vector_table_begin)
     120LINKER_SYMBOL(bsp_start_vector_table_end)
     121LINKER_SYMBOL(bsp_start_vector_table_size)
     122
    119123#define BSP_FAST_TEXT_SECTION __attribute__((section(".bsp_fast_text")))
    120124
  • c/src/lib/libbsp/arm/shared/include/start.h

    rd922dab r4c622e5  
    88
    99/*
    10  * Copyright (c) 2008, 2009
    11  * embedded brains GmbH
    12  * Obere Lagerstr. 30
    13  * D-82178 Puchheim
    14  * Germany
    15  * <rtems@embedded-brains.de>
     10 * Copyright (c) 2008-2011 embedded brains GmbH.  All rights reserved.
     11 *
     12 *  embedded brains GmbH
     13 *  Obere Lagerstr. 30
     14 *  82178 Puchheim
     15 *  Germany
     16 *  <rtems@embedded-brains.de>
    1617 *
    1718 * The license and distribution terms for this file may be
     
    7879void bsp_start_memcpy_arm(int *dest, const int *src, size_t n);
    7980
     81/**
     82 * @brief Copies all standard sections from the load to the runtime area.
     83 */
     84void bsp_start_copy_sections(void);
     85
    8086/** @} */
    8187
  • c/src/lib/libbsp/arm/shared/start/start.S

    rd922dab r4c622e5  
    66
    77/*
    8  * Copyright (c) 2008
    9  * Embedded Brains GmbH
    10  * Obere Lagerstr. 30
    11  * D-82178 Puchheim
    12  * Germany
    13  * rtems@embedded-brains.de
     8 * Copyright (c) 2008-2011 embedded brains GmbH.  All rights reserved.
    149 *
    15  * The license and distribution terms for this file may be found in the file
    16  * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
     10 *  embedded brains GmbH
     11 *  Obere Lagerstr. 30
     12 *  82178 Puchheim
     13 *  Germany
     14 *  <rtems@embedded-brains.de>
     15 *
     16 * The license and distribution terms for this file may be
     17 * found in the file LICENSE in this distribution or at
     18 * http://www.rtems.com/license/LICENSE.
    1719 */
    1820
     
    2224       
    2325#include <bspopts.h>
     26#include <bsp/irq.h>
    2427#include <bsp/linker-symbols.h>
    2528
    26 /* External symbols */
    27 
    28 .extern bsp_reset
    29 .extern boot_card
    30 .extern bsp_start_hook_0
    31 .extern bsp_start_hook_1
    32 
    33 /* Global symbols */
    34 
    35 .globl _start
    36 .globl bsp_start_memcpy
    37 
    38 .section ".bsp_start_text", "ax"
    39 
    40 .arm
     29        /* External symbols */
     30        .extern bsp_reset
     31        .extern boot_card
     32        .extern bsp_start_hook_0
     33        .extern bsp_start_hook_1
     34
     35        /* Global symbols */
     36        .globl  _start
     37        .globl  bsp_start_vector_table_begin
     38        .globl  bsp_start_vector_table_end
     39        .globl  bsp_start_vector_table_size
     40        .globl  bsp_vector_table_size
     41
     42        .section        ".bsp_start_text", "ax"
     43
     44#if defined(ARM_MULTILIB_ARCH_V4)
     45
     46        .arm
    4147
    4248/*
     
    4551 */
    4652
    47 vector_block:
     53bsp_start_vector_table_begin:
    4854
    4955        ldr     pc, handler_addr_reset
     
    94100
    95101        .word   reset
     102
     103bsp_start_vector_table_end:
    96104
    97105/* Start entry */
     
    170178
    171179        ldr     r0, =bsp_vector_table_begin
    172         adr     r1, vector_block
     180        adr     r1, bsp_start_vector_table_begin
    173181        ldmia   r1!, {r2-r9}
    174182        stmia   r0!, {r2-r9}
     
    199207        b       twiddle
    200208
    201 DEFINE_FUNCTION_ARM(bsp_start_memcpy)
    202 
    203         /* Return if dest == src */
    204         cmp     r0, r1
    205 #ifdef __thumb__
    206         bxeq    lr
    207 #else
    208         moveq   pc, lr
    209 #endif
    210 
    211         /* Return if length is zero */
    212         mov     r3, #0
    213         cmp     r3, r2
    214 #ifdef __thumb__
    215         bxeq    lr
    216 #else
    217         moveq   pc, lr
    218 #endif
    219 
    220         /* Save non-volatile registers */
    221         push    {r4-r8, lr}
    222 
    223         /* Copy worker routine to stack */
    224         adr     ip, bsp_start_memcpy_begin
    225         ldm     ip, {r3-r8}
    226         push    {r3-r8}
    227 
    228         /* Execute worker routine */
    229         mov     r3, #0
    230         mov     ip, sp
    231         mov     lr, pc
    232 #ifdef __thumb__
    233         bx      ip
    234 #else
    235         mov     pc, ip
    236 #endif
    237 
    238         /* Restore stack and non-volatile registers */
    239         add     sp, sp, #24
    240         pop     {r4-r8, lr}
    241 
    242         /* Return */
    243 #ifdef __thumb__
    244         bx      lr
    245 #else
    246         mov     pc, lr
    247 #endif
    248 
    249 bsp_start_memcpy_begin:
    250 
    251         /* Worker routine */
    252         ldr     ip, [r1, r3]
    253         str     ip, [r0, r3]
    254         add     r3, r3, #4
    255         cmp     r3, r2
    256         bcc     bsp_start_memcpy_begin
    257 #ifdef __thumb__
    258         bx      lr
    259 #else
    260         mov     pc, lr
    261 #endif
     209#elif defined(ARM_MULTILIB_ARCH_V7M)
     210
     211        .syntax unified
     212
     213        .extern bsp_stack_main_end
     214
     215        .thumb
     216
     217bsp_start_vector_table_begin:
     218
     219        .word   bsp_stack_main_end
     220        .word   _start /* Reset */
     221        .word   bsp_reset /* NMI */
     222        .word   bsp_reset /* Hard Fault */
     223        .word   bsp_reset /* MPU Fault */
     224        .word   bsp_reset /* Bus Fault */
     225        .word   bsp_reset /* Usage Fault */
     226        .word   bsp_reset /* Reserved */
     227        .word   bsp_reset /* Reserved */
     228        .word   bsp_reset /* Reserved */
     229        .word   bsp_reset /* Reserved */
     230        .word   bsp_reset /* SVC */
     231        .word   bsp_reset /* Debug Monitor */
     232        .word   bsp_reset /* Reserved */
     233        .word   bsp_reset /* PendSV */
     234        .word   bsp_reset /* SysTick */
     235        .rept   BSP_INTERRUPT_VECTOR_MAX + 1
     236        .word   bsp_reset /* IRQ */
     237        .endr
     238
     239bsp_start_vector_table_end:
     240
     241        .thumb_func
     242
     243_start:
     244
     245        ldr     sp, =bsp_stack_main_end
     246        ldr     lr, =bsp_start_hook_0_done + 1
     247        b       bsp_start_hook_0
     248
     249bsp_start_hook_0_done:
     250
     251        bl      bsp_start_hook_1
     252        movs    r0, #0
     253        bl      boot_card
     254
     255twiddle:
     256
     257        bl      bsp_reset
     258        b       twiddle
     259
     260#endif /* defined(ARM_MULTILIB_ARCH_V7M) */
     261
     262        .set    bsp_start_vector_table_size, bsp_start_vector_table_end - bsp_start_vector_table_begin
     263        .set    bsp_vector_table_size, bsp_start_vector_table_size
Note: See TracChangeset for help on using the changeset viewer.