From 1764b2db55a2d35f1e394c6f8edf1beebc5f326e Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 29 May 2014 14:02:06 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@6970 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/common/ports/ARM/compilers/GCC/crt0.s | 6 +++--- os/common/ports/ARM/compilers/GCC/irq.s | 6 +++++- os/common/ports/ARM/compilers/GCC/rules.ld | 3 ++- os/common/ports/ARM/devices/LPC214x/armparams.h | 14 +++++--------- 4 files changed, 15 insertions(+), 14 deletions(-) (limited to 'os/common') diff --git a/os/common/ports/ARM/compilers/GCC/crt0.s b/os/common/ports/ARM/compilers/GCC/crt0.s index 8eae3452d..c5fb53092 100644 --- a/os/common/ports/ARM/compilers/GCC/crt0.s +++ b/os/common/ports/ARM/compilers/GCC/crt0.s @@ -146,7 +146,7 @@ bssloop: ldr r1, =_main_exit_handler bx r1 .code 32 -#else /* !defined(THUMB_NO_INTERWORKING) +#else /* !defined(THUMB_NO_INTERWORKING) */ bl main b _main_exit_handler #endif /* !defined(THUMB_NO_INTERWORKING) */ @@ -172,7 +172,6 @@ _main_exit_handler: __early_init: bx lr .code 32 -#endif /* * Default late initialization code. It is declared weak in order to be @@ -188,6 +187,7 @@ __early_init: __late_init: bx lr .code 32 -#endif + +#endif /* !defined(__DOXYGEN__) */ /** @} */ diff --git a/os/common/ports/ARM/compilers/GCC/irq.s b/os/common/ports/ARM/compilers/GCC/irq.s index 8490beb8c..8bce5cc67 100644 --- a/os/common/ports/ARM/compilers/GCC/irq.s +++ b/os/common/ports/ARM/compilers/GCC/irq.s @@ -26,6 +26,9 @@ * @{ */ +#define __FROM_ASM__ +#include "armparams.h" + #if !defined(__DOXYGEN__) .section irq @@ -39,7 +42,8 @@ .global IrqHandler IrqHandler: stmfd sp!, {r0-r3, r12, lr} - ldr r0, [pc, #ARM_IRQ_REGISTER_OFFSET] + ldr r0, =ARM_IRQ_VECTOR_REG + ldr r0, [r0] ldr lr, =_port_irq_common bx r0 diff --git a/os/common/ports/ARM/compilers/GCC/rules.ld b/os/common/ports/ARM/compilers/GCC/rules.ld index 8d131b75b..8c32a27a3 100644 --- a/os/common/ports/ARM/compilers/GCC/rules.ld +++ b/os/common/ports/ARM/compilers/GCC/rules.ld @@ -37,9 +37,10 @@ SECTIONS . = 0; _text = .; - startup : ALIGN(16) SUBALIGN(16) + boot : ALIGN(16) SUBALIGN(16) { KEEP(*(vectors)) + KEEP(*(irq)) } > flash constructors : ALIGN(4) SUBALIGN(4) diff --git a/os/common/ports/ARM/devices/LPC214x/armparams.h b/os/common/ports/ARM/devices/LPC214x/armparams.h index f1296c573..5d8fa8531 100644 --- a/os/common/ports/ARM/devices/LPC214x/armparams.h +++ b/os/common/ports/ARM/devices/LPC214x/armparams.h @@ -35,7 +35,7 @@ /** * @brief ARM core model. */ -#define ARM_MODEL ARM_MODEL_ARM7TDMI +#define ARM_CORE ARM_CORE_ARM7TDMI /** * @brief Thumb-capable. @@ -52,14 +52,10 @@ */ #define ARM_WFI_IMPL (PCON = 1) -/* The following code is not processed when the file is included from an - asm module.*/ -#if !defined(_FROM_ASM_) - -/* Including the device header.*/ -#include "lpc214x.h" - -#endif /* !defined(_FROM_ASM_) */ +/** + * @brief Address of the IRQ vector register in the interrupt controller. + */ +#define ARM_IRQ_VECTOR_REG 0xFFFFF030 #endif /* _ARMPARAMS_H_ */ -- cgit v1.2.3