nrf52: add stackcheck support
This commit is contained in:
parent
c33040f0cf
commit
e5200d4af9
@ -209,6 +209,7 @@ config ARCH_CHIP_NRF52
|
|||||||
bool "Nordic NRF52"
|
bool "Nordic NRF52"
|
||||||
select ARCH_CORTEXM4
|
select ARCH_CORTEXM4
|
||||||
select ARCH_HAVE_TICKLESS
|
select ARCH_HAVE_TICKLESS
|
||||||
|
select ARMV7M_HAVE_STACKCHECK
|
||||||
#select ARCH_HAVE_MPU
|
#select ARCH_HAVE_MPU
|
||||||
#select ARM_HAVE_MPU_UNIFIED
|
#select ARM_HAVE_MPU_UNIFIED
|
||||||
select ARCH_HAVE_SPI_BITORDER
|
select ARCH_HAVE_SPI_BITORDER
|
||||||
|
@ -80,6 +80,10 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||||||
CMN_CSRCS += arm_checkstack.c
|
CMN_CSRCS += arm_checkstack.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_ARMV7M_STACKCHECK),y)
|
||||||
|
CMN_CSRCS += arm_stackcheck.c
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_ARCH_FPU),y)
|
ifeq ($(CONFIG_ARCH_FPU),y)
|
||||||
CMN_ASRCS += arm_fpu.S
|
CMN_ASRCS += arm_fpu.S
|
||||||
CMN_CSRCS += arm_copyarmstate.c
|
CMN_CSRCS += arm_copyarmstate.c
|
||||||
|
@ -81,6 +81,12 @@
|
|||||||
* Private Functions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_ARMV7M_STACKCHECK
|
||||||
|
/* we need to get r10 set before we can allow instrumentation calls */
|
||||||
|
|
||||||
|
void __start(void) __attribute__ ((no_instrument_function));
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_STACK_COLORATION
|
#ifdef CONFIG_STACK_COLORATION
|
||||||
static void go_nx_start(void *pv, unsigned int nbytes)
|
static void go_nx_start(void *pv, unsigned int nbytes)
|
||||||
__attribute__ ((naked, no_instrument_function, noreturn));
|
__attribute__ ((naked, no_instrument_function, noreturn));
|
||||||
@ -231,6 +237,13 @@ void __start(void)
|
|||||||
const uint32_t *src;
|
const uint32_t *src;
|
||||||
uint32_t *dest;
|
uint32_t *dest;
|
||||||
|
|
||||||
|
#ifdef CONFIG_ARMV7M_STACKCHECK
|
||||||
|
/* Set the stack limit before we attempt to call any functions */
|
||||||
|
|
||||||
|
__asm__ volatile("sub r10, sp, %0" : :
|
||||||
|
"r"(CONFIG_IDLETHREAD_STACKSIZE - 64) :);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Make sure that interrupts are disabled */
|
/* Make sure that interrupts are disabled */
|
||||||
|
|
||||||
__asm__ __volatile__ ("\tcpsid i\n");
|
__asm__ __volatile__ ("\tcpsid i\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user