From: Pavel Pisa Date: Tue, 26 Apr 2011 10:10:07 +0000 (+0200) Subject: lpc17xx: replace hard-coded vector table placement by more flexible code. X-Git-Url: https://rtime.felk.cvut.cz/gitweb/sysless.git/commitdiff_plain/4b56e8eab2b2c91fcd72a2e55351e1a0c66446c6 lpc17xx: replace hard-coded vector table placement by more flexible code. Change allows to fill initial values for interrupt service functions by override functions for global weak symbols. Signed-off-by: Pavel Pisa --- diff --git a/arch/arm/mach-lpc17xx/libs/hal/startup.c b/arch/arm/mach-lpc17xx/libs/hal/startup.c index ab9d1fc..516785b 100644 --- a/arch/arm/mach-lpc17xx/libs/hal/startup.c +++ b/arch/arm/mach-lpc17xx/libs/hal/startup.c @@ -22,6 +22,7 @@ // Mod by nio for the .fastcode part +#include "cpu_def.h" #include "LPC17xx.h" #define WEAK __attribute__ ((weak)) @@ -217,9 +218,17 @@ void Reset_Handler(void) *(pulDest++) = 0; } - - // set irq table - SCB->VTOR=0x10000000; + // copy initial values and set irq table + if(irq_handler_table && irq_table_size) { + int i; + pulSrc = (unsigned long*)g_pfnVectors; + pulDest = (unsigned long*)irq_handler_table; + for(i = irq_table_size; i--; ) { + *(pulDest++) = *(pulSrc++); + } + /*SCB->VTOR=0x10000000;*/ + SCB->VTOR=(uint32_t)irq_handler_table; + } //if (_setup_board!=0) _setup_board();