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:
parent
21628d41d0
commit
4465cf47e9
1 changed files with 10 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue