arm/reset: relocate the vector table when a non-XIP image

The processor is made aware that the vector table built in the image is
located at the start of SRAM in the case of a non-XIP image, rather than
at 0 in as is the case in XIP images.

Change-Id: I40b28ca32daf3e8930f103224766ed4e0ccc88e0
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
Benjamin Walsh 2015-10-22 18:39:48 -04:00 committed by Anas Nashif
commit 4465cf47e9

View file

@ -26,6 +26,7 @@
* initialization is performed.
*/
#include <nanokernel.h>
#include <stdint.h>
#include <toolchain.h>
#include <linker-defs.h>
@ -69,10 +70,18 @@ static void dataCopy(void)
pRAM[n] = pROM[n];
}
}
static inline void relocate_vector_table(void) { /* do nothing */ }
#else
static void dataCopy(void)
{
}
static inline void relocate_vector_table(void)
{
/* vector table is already in SRAM, just point to it */
_scs_relocate_vector_table((void *)CONFIG_SRAM_BASE_ADDRESS);
}
#endif
extern FUNC_NORETURN void _Cstart(void);
@ -87,6 +96,7 @@ extern FUNC_NORETURN void _Cstart(void);
void _PrepC(void)
{
relocate_vector_table();
bssZero();
dataCopy();
_Cstart();