diff options
author | Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> | 2010-04-09 12:22:57 +0000 |
---|---|---|
committer | Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> | 2010-04-09 12:22:57 +0000 |
commit | 7a6f8d09fe3efe112e8c752d978e4488a1b41d0e (patch) | |
tree | f41f7689ef1c4817d6259d82e0d3c149ca07a135 /c/src/lib/libbsp/arm/shared/start/start.S | |
parent | gcc-4.5.0-RC-20100406. (diff) | |
download | rtems-7a6f8d09fe3efe112e8c752d978e4488a1b41d0e.tar.bz2 |
added dma header
added thumb support to start.S
updated documentation
Diffstat (limited to 'c/src/lib/libbsp/arm/shared/start/start.S')
-rw-r--r-- | c/src/lib/libbsp/arm/shared/start/start.S | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/c/src/lib/libbsp/arm/shared/start/start.S b/c/src/lib/libbsp/arm/shared/start/start.S index d1843ce17f..a135feb25a 100644 --- a/c/src/lib/libbsp/arm/shared/start/start.S +++ b/c/src/lib/libbsp/arm/shared/start/start.S @@ -140,17 +140,28 @@ start: /* * Branch to start hook 0. * - * This code up to the start hook 0 may run with an address offset so - * it must be position independent. After the start hook 0 it is - * assumed that the code can run at its intended position. The link - * register will be loaded with the absolute address. + * The previous code and parts of the start hook 0 may run with an + * address offset. This implies that only branches relative to the + * program counter are allowed. After the start hook 0 it is assumed + * that the code can run at its intended position. Thus the link + * register will be loaded with the absolute address. In THUMB mode + * the start hook 0 must be within a 2kByte range due to the branch + * instruction limitation. */ ldr lr, =bsp_start_hook_0_done +#ifdef __thumb__ + orr lr, #1 +#endif + + SWITCH_FROM_ARM_TO_THUMB r0 + b bsp_start_hook_0 bsp_start_hook_0_done: + SWITCH_FROM_THUMB_TO_ARM + /* * Initialize the exception vectors. This includes the exceptions * vectors and the pointers to the default exception handlers. @@ -163,11 +174,11 @@ bsp_start_hook_0_done: ldmia r1!, {r2-r9} stmia r0!, {r2-r9} + SWITCH_FROM_ARM_TO_THUMB r0 + /* Branch to start hook 1 */ bl bsp_start_hook_1 - SWITCH_FROM_ARM_TO_THUMB r0 - /* Branch to boot card */ mov r0, #0 bl boot_card |