bootloader: Check if DRAM segments are going to collide with stack

This commit is contained in:
Angus Gratton
2016-12-20 16:04:15 +11:00
parent 1ed584f896
commit 198889ad26
2 changed files with 40 additions and 3 deletions

View File

@@ -26,6 +26,16 @@
#define WSR(reg, newval) asm volatile ("wsr %0, " #reg : : "r" (newval));
#define XSR(reg, swapval) asm volatile ("xsr %0, " #reg : "+r" (swapval));
/** @brief Read current stack pointer address
*
*/
static inline void *get_sp()
{
void *sp;
asm volatile ("mov %0, sp;" : "=r" (sp));
return sp;
}
/* Return true if the CPU is in an interrupt context
(PS.UM == 0)
*/