arch: Remove all go_nx_start from chip specifc source

since the idle stack color is done in the common code now

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2021-06-09 17:22:58 +08:00 committed by David Sidrane
parent fa0d123f87
commit c0fdddc5d7
32 changed files with 1 additions and 1255 deletions

View File

@ -603,22 +603,6 @@ __start:
bl arm_boot
#ifdef CONFIG_STACK_COLORATION
/* Write a known value to the IDLE thread stack to support stack
* monitoring logic
*/
adr r3, .Lstkinit
ldmia r3, {r0, r1, r2} /* R0 = start of IDLE stack; R1 = Size of tack; R2 = coloration */
2: /* Top of the loop */
sub r1, r1, #1 /* R1 = Number of words remaining */
cmp r1, #0 /* Check (nwords == 0) */
str r2, [r0], #4 /* Save stack color word, increment stack address */
bne 2b /* Bottom of the loop */
#endif
/* Finally branch to the OS entry point */
mov lr, #0 /* LR = return address (none) */
@ -674,15 +658,6 @@ __start:
.long _sdata /* Where .data needs to reside in SDRAM */
.long _edata
#endif
#ifdef CONFIG_STACK_COLORATION
.type .Lstkinit, %object
.Lstkinit:
.long _ebss /* Beginning of the IDLE stack, then words of IDLE stack */
.long (CONFIG_IDLETHREAD_STACKSIZE >> 2)
.long STACK_COLOR /* Stack coloration word */
.size .Lstkinit, . -.Lstkinit
#endif
.size .Lvstart, .-.Lvstart
/***************************************************************************

View File

@ -112,22 +112,6 @@ __start:
bl board_autoled_initialize
#endif
#ifdef CONFIG_STACK_COLORATION
/* Write a known value to the IDLE thread stack to support stack
* monitoring logic
*/
adr r3, .Lstkinit
ldmia r3, {r0, r1, r2} /* R0 = start of IDLE stack; R1 = Size of tack; R2 = coloration */
2: /* Top of the loop */
sub r1, r1, #1 /* R1 = Number of words remaining */
cmp r1, #0 /* Check (nwords == 0) */
str r2, [r0], #4 /* Save stack color word, increment stack address */
bne 2b /* Bottom of the loop */
#endif
/* Finally branch to the OS entry point */
mov lr, #0 /* LR = return address (none) */
@ -154,14 +138,6 @@ __start:
.long _edata
#endif
#ifdef CONFIG_STACK_COLORATION
.type .Lstkinit, %object
.Lstkinit:
.long _ebss /* Beginning of the IDLE stack, then words of IDLE stack */
.long (CONFIG_IDLETHREAD_STACKSIZE >> 2)
.long STACK_COLOR /* Stack coloration word */
.size .Lstkinit, . -.Lstkinit
#endif
.size __start, .-__start
/* This global variable is unsigned long g_idle_topstack and is

View File

@ -396,22 +396,6 @@ __cpu3_start:
.Lcpu_vstart:
#ifdef CONFIG_STACK_COLORATION
/* Write a known value to the IDLE thread stack to support stack
* monitoring logic
*/
adr r3, .Lstkinit
mov r0, sp /* R0 = end of IDLE stack */
ldmia r3, {r1, r2} /* R1 = Size of stack; R2 = coloration */
1: /* Top of the loop */
sub r1, r1, #1 /* R1 = Number of words remaining */
cmp r1, #0 /* Check (nwords == 0) */
str r2, [r0, #-4]! /* Save stack color word, increment stack address */
bne 1b /* Bottom of the loop */
#endif
/* Branch to continue C level CPU initialization */
mov fp, #0 /* Clear framepointer */
@ -426,14 +410,6 @@ __cpu3_start:
/* Text-section constants: */
#ifdef CONFIG_STACK_COLORATION
.type .Lstkinit, %object
.Lstkinit:
.long SMP_STACK_WORDS
.long STACK_COLOR /* Stack coloration word */
.size .Lstkinit, . -.Lstkinit
#endif
/***************************************************************************
* .noinit section data
***************************************************************************/

View File

@ -632,21 +632,6 @@ __start:
bl arm_boot
#ifdef CONFIG_STACK_COLORATION
/* Write a known value to the IDLE thread stack to support stack
* monitoring logic
*/
adr r3, .Lstkinit
ldmia r3, {r0, r1, r2} /* R0 = start of IDLE stack; R1 = Size of tack; R2 = coloration */
1: /* Top of the loop */
sub r1, r1, #1 /* R1 = Number of words remaining */
cmp r1, #0 /* Check (nwords == 0) */
str r2, [r0], #4 /* Save stack color word, increment stack address */
bne 1b /* Bottom of the loop */
#endif
/* Finally branch to the OS entry point */
mov lr, #0 /* LR = return address (none) */
@ -753,21 +738,6 @@ arm_data_initialize:
.size .Ldatainit, . -.Ldatainit
#endif
#ifdef CONFIG_STACK_COLORATION
.type .Lstkinit, %object
.Lstkinit:
#ifdef CONFIG_BOOT_SDRAM_DATA
.long IDLE_STACK_VBASE /* Beginning of the IDLE stack, then words of IDLE stack */
#elif defined(CONFIG_SMP)
.long _enoinit
#else
.long _ebss /* Beginning of the IDLE stack, then words of IDLE stack */
#endif
.long (CONFIG_IDLETHREAD_STACKSIZE >> 2)
.long STACK_COLOR /* Stack coloration word */
.size .Lstkinit, . -.Lstkinit
#endif
/***************************************************************************
* Data section variables
***************************************************************************/

View File

@ -668,21 +668,6 @@ __start:
bl arm_boot
#ifdef CONFIG_STACK_COLORATION
/* Write a known value to the IDLE thread stack to support stack
* monitoring logic
*/
adr r3, .Lstkinit
ldmia r3, {r0, r1, r2} /* R0 = start of IDLE stack; R1 = Size of tack; R2 = coloration */
1: /* Top of the loop */
sub r1, r1, #1 /* R1 = Number of words remaining */
cmp r1, #0 /* Check (nwords == 0) */
str r2, [r0], #4 /* Save stack color word, increment stack address */
bne 1b /* Bottom of the loop */
#endif
/* Finally branch to the OS entry point */
mov lr, #0 /* LR = return address (none) */
@ -792,19 +777,6 @@ arm_data_initialize:
.long _edata
.size .Ldatainit, . -.Ldatainit
#ifdef CONFIG_STACK_COLORATION
.type .Lstkinit, %object
.Lstkinit:
#ifdef CONFIG_BOOT_SDRAM_DATA
.long IDLE_STACK_VBASE /* Beginning of the IDLE stack, then words of IDLE stack */
#else
.long _ebss /* Beginning of the IDLE stack, then words of IDLE stack */
#endif
.long (CONFIG_IDLETHREAD_STACKSIZE >> 2)
.long STACK_COLOR /* Stack coloration word */
.size .Lstkinit, . -.Lstkinit
#endif
/***************************************************************************
* Data section variables
***************************************************************************/

View File

@ -75,15 +75,6 @@
void weak_function up_cpuctxload(void);
/****************************************************************************
* Private Function prototypes
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
__attribute__((naked, no_instrument_function, noreturn));
#endif
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@ -116,46 +107,6 @@ extern uint32_t _vectors[];
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: go_nx_start
*
* Description:
* Set the IDLE stack to the
*
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
{
/* Set the IDLE stack to the stack coloration value then jump to
* nx_start(). We take extreme care here because were currently
* executing on this stack.
*
* We want to avoid sneak stack access generated by the compiler.
*/
__asm__ __volatile__
(
"\tmovs r1, r1, lsr #2\n" /* R1 = nwords = nbytes >> 2 */
"\tbeq 2f\n" /* (should not happen) */
"\tbic r0, r0, #3\n" /* R0 = Aligned stackptr */
"\tmovw r2, #0xbeef\n" /* R2 = STACK_COLOR = 0xdeadbeef */
"\tmovt r2, #0xdead\n"
"1:\n" /* Top of the loop */
"\tsub r1, r1, #1\n" /* R1 nwords-- */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tstr r2, [r0], #4\n" /* Save stack color word, increment stackptr */
"\tbne 1b\n" /* Bottom of the loop */
"2:\n"
"\tmov r14, #0\n" /* LR = return address (none) */
"\tb nx_start\n" /* Branch to nx_start */
);
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -354,17 +305,9 @@ void __start(void)
showprogress('\r');
showprogress('\n');
#ifdef CONFIG_STACK_COLORATION
/* Set the IDLE stack to the coloration value and jump into nx_start() */
go_nx_start((FAR void *)&_ebss, CONFIG_IDLETHREAD_STACKSIZE);
#else
/* Call nx_start() */
nx_start();
/* Shouldn't get here */
for (; ; );
#endif
}

View File

@ -79,10 +79,6 @@ const uintptr_t g_idle_topstack = HEAP_BASE;
#ifdef CONFIG_ARCH_FPU
static inline void efm32_fpuconfig(void);
#endif
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
__attribute__ ((naked, no_instrument_function, noreturn));
#endif
/****************************************************************************
* Private Functions
@ -198,47 +194,6 @@ static inline void efm32_fpuconfig(void)
# define efm32_fpuconfig()
#endif
/****************************************************************************
* Name: go_nx_start
*
* Description:
* Set the IDLE stack to the coloration value and jump into nx_start()
*
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
{
/* Set the IDLE stack to the stack coloration value then jump to
* nx_start(). We take extreme care here because were currently
* executing on this stack.
*
* We want to avoid sneak stack access generated by the compiler.
*/
__asm__ __volatile__
(
"\tmovs r1, r1, lsr #2\n" /* R1 = nwords = nbytes >> 2 */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tbeq 2f\n" /* (should not happen) */
"\tbic r0, r0, #3\n" /* R0 = Aligned stackptr */
"\tmovw r2, #0xbeef\n" /* R2 = STACK_COLOR = 0xdeadbeef */
"\tmovt r2, #0xdead\n"
"1:\n" /* Top of the loop */
"\tsub r1, r1, #1\n" /* R1 nwords-- */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tstr r2, [r0], #4\n" /* Save stack color word, increment stackptr */
"\tbne 1b\n" /* Bottom of the loop */
"2:\n"
"\tmov r14, #0\n" /* LR = return address (none) */
"\tb nx_start\n" /* Branch to nx_start */
);
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -319,17 +274,9 @@ void __start(void)
showprogress('\r');
showprogress('\n');
#ifdef CONFIG_STACK_COLORATION
/* Set the IDLE stack to the coloration value and jump into nx_start() */
go_nx_start((FAR void *)&_ebss, CONFIG_IDLETHREAD_STACKSIZE);
#else
/* Call nx_start() */
nx_start();
/* Shouldn't get here */
for (; ; );
#endif
}

View File

@ -72,10 +72,6 @@ const uintptr_t g_idle_topstack = HEAP_BASE;
#ifdef CONFIG_ARCH_FPU
static inline void eoss3_fpuconfig(void);
#endif
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
__attribute__ ((naked, no_instrument_function, noreturn));
#endif
/****************************************************************************
* Private Functions
@ -196,47 +192,6 @@ static inline void eoss3_fpuconfig(void)
# define eoss3_fpuconfig()
#endif
/****************************************************************************
* Name: go_nx_start
*
* Description:
* Set the IDLE stack to the coloration value and jump into nx_start()
*
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
{
/* Set the IDLE stack to the stack coloration value then jump to
* nx_start(). We take extreme care here because were currently
* executing on this stack.
*
* We want to avoid sneak stack access generated by the compiler.
*/
__asm__ __volatile__
(
"\tmovs r1, r1, lsr #2\n" /* R1 = nwords = nbytes >> 2 */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tbeq 2f\n" /* (should not happen) */
"\tbic r0, r0, #3\n" /* R0 = Aligned stackptr */
"\tmovw r2, #0xbeef\n" /* R2 = STACK_COLOR = 0xdeadbeef */
"\tmovt r2, #0xdead\n"
"1:\n" /* Top of the loop */
"\tsub r1, r1, #1\n" /* R1 nwords-- */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tstr r2, [r0], #4\n" /* Save stack color word, increment stackptr */
"\tbne 1b\n" /* Bottom of the loop */
"2:\n"
"\tmov r14, #0\n" /* LR = return address (none) */
"\tb nx_start\n" /* Branch to nx_start */
);
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -332,17 +287,9 @@ void __start(void)
showprogress('\r');
showprogress('\n');
#ifdef CONFIG_STACK_COLORATION
/* Set the IDLE stack to the coloration value and jump into nx_start() */
go_nx_start((FAR void *)&_ebss, CONFIG_IDLETHREAD_STACKSIZE);
#else
/* Call nx_start() */
nx_start();
/* Shouldn't get here */
for (; ; );
#endif
}

View File

@ -73,10 +73,6 @@
#ifdef CONFIG_ARCH_FPU
static inline void imxrt_fpuconfig(void);
#endif
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
__attribute__ ((naked, no_instrument_function, noreturn));
#endif
/****************************************************************************
* Private Functions
@ -226,47 +222,6 @@ static inline void imxrt_tcmenable(void)
#endif
}
/****************************************************************************
* Name: go_nx_start
*
* Description:
* Set the IDLE stack to the coloration value and jump into nx_start()
*
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
{
/* Set the IDLE stack to the stack coloration value then jump to
* nx_start(). We take extreme care here because were currently
* executing on this stack.
*
* We want to avoid sneak stack access generated by the compiler.
*/
__asm__ __volatile__
(
"\tmovs r1, r1, lsr #2\n" /* R1 = nwords = nbytes >> 2 */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tbeq 2f\n" /* (should not happen) */
"\tbic r0, r0, #3\n" /* R0 = Aligned stackptr */
"\tmovw r2, #0xbeef\n" /* R2 = STACK_COLOR = 0xdeadbeef */
"\tmovt r2, #0xdead\n"
"1:\n" /* Top of the loop */
"\tsub r1, r1, #1\n" /* R1 nwords-- */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tstr r2, [r0], #4\n" /* Save stack color word, increment stackptr */
"\tbne 1b\n" /* Bottom of the loop */
"2:\n"
"\tmov r14, #0\n" /* LR = return address (none) */
"\tb nx_start\n" /* Branch to nx_start */
);
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -375,17 +330,9 @@ void __start(void)
/* Then start NuttX */
#ifdef CONFIG_STACK_COLORATION
/* Set the IDLE stack to the coloration value and jump into nx_start() */
go_nx_start((FAR void *)&_ebss, CONFIG_IDLETHREAD_STACKSIZE);
#else
/* Call nx_start() */
nx_start();
/* Shouldn't get here */
for (; ; );
#endif
}

View File

@ -50,13 +50,6 @@
static inline void kinetis_fpuconfig(void);
#endif
#if 0 /* Not used */
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
__attribute__ ((naked, no_instrument_function, noreturn));
#endif
#endif
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@ -195,49 +188,6 @@ static inline void kinetis_fpuconfig(void)
# define kinetis_fpuconfig()
#endif
/****************************************************************************
* Name: go_nx_start
*
* Description:
* Set the IDLE stack to the coloration value and jump into nx_start()
*
****************************************************************************/
#if 0 /* Not used */
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
{
/* Set the IDLE stack to the stack coloration value then jump to
* nx_start(). We take extreme care here because were currently
* executing on this stack.
*
* We want to avoid sneak stack access generated by the compiler.
*/
__asm__ __volatile__
(
"\tmovs r1, r1, lsr #2\n" /* R1 = nwords = nbytes >> 2 */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tbeq 2f\n" /* (should not happen) */
"\tbic r0, r0, #3\n" /* R0 = Aligned stackptr */
"\tmovw r2, #0xbeef\n" /* R2 = STACK_COLOR = 0xdeadbeef */
"\tmovt r2, #0xdead\n"
"1:\n" /* Top of the loop */
"\tsub r1, r1, #1\n" /* R1 nwords-- */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tstr r2, [r0], #4\n" /* Save stack color word, increment stackptr */
"\tbne 1b\n" /* Bottom of the loop */
"2:\n"
"\tmov r14, #0\n" /* LR = return address (none) */
"\tb nx_start\n" /* Branch to nx_start */
);
}
#endif
#endif
/****************************************************************************
* Public Functions
****************************************************************************/

View File

@ -105,15 +105,6 @@ extern uint32_t _etext_sram;
extern uint32_t _ftext;
extern uint32_t _svect;
/****************************************************************************
* Private Function prototypes
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
__attribute__ ((naked, no_instrument_function, noreturn));
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
@ -132,47 +123,6 @@ static void go_nx_start(void *pv, unsigned int nbytes)
# define showprogress(c)
#endif
/****************************************************************************
* Name: go_nx_start
*
* Description:
* Set the IDLE stack to the coloration value and jump into nx_start()
*
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
{
/* Set the IDLE stack to the stack coloration value then jump to
* nx_start(). We take extreme care here because were currently
* executing on this stack.
*
* We want to avoid sneak stack access generated by the compiler.
*/
__asm__ __volatile__
(
"\tmov r1, r1, lsr #2\n" /* R1 = nwords = nbytes >> 2 */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tbeq 2f\n" /* (should not happen) */
"\tbic r0, r0, #3\n" /* R0 = Aligned stackptr */
"\tmovw r2, #0xbeef\n" /* R2 = STACK_COLOR = 0xdeadbeef */
"\tmovt r2, #0xdead\n"
"1:\n" /* Top of the loop */
"\tsub r1, r1, #1\n" /* R1 nwords-- */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tstr r2, [r0], #4\n" /* Save stack color word, increment stackptr */
"\tbne 1b\n" /* Bottom of the loop */
"2:\n"
"\tmov r14, #0\n" /* LR = return address (none) */
"\tb nx_start\n" /* Branch to nx_start */
);
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -385,17 +335,9 @@ void __start(void)
CURRENT_REGS = NULL;
#ifdef CONFIG_STACK_COLORATION
/* Set the IDLE stack to the coloration value and jump into nx_start() */
go_nx_start((FAR void *)&_ebss, CONFIG_IDLETHREAD_STACKSIZE);
#else
/* Call nx_start() */
nx_start();
/* Shouldn't get here */
for (; ; );
#endif
}

View File

@ -72,11 +72,6 @@
void __start(void) __attribute__ ((no_instrument_function));
#endif
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
__attribute__ ((naked, no_instrument_function, noreturn));
#endif
/****************************************************************************
* Name: nrf52_fpuconfig
*
@ -164,47 +159,6 @@ static inline void nrf52_fpuconfig(void)
# define nrf52_fpuconfig()
#endif
/****************************************************************************
* Name: go_nx_start
*
* Description:
* Set the IDLE stack to the coloration value and jump into nx_start()
*
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
{
/* Set the IDLE stack to the stack coloration value then jump to
* nx_start(). We take extreme care here because were currently
* executing on this stack.
*
* We want to avoid sneak stack access generated by the compiler.
*/
__asm__ __volatile__
(
"\tmovs r1, r1, lsr #2\n" /* R1 = nwords = nbytes >> 2 */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tbeq 2f\n" /* (should not happen) */
"\tbic r0, r0, #3\n" /* R0 = Aligned stackptr */
"\tmovw r2, #0xbeef\n" /* R2 = STACK_COLOR = 0xdeadbeef */
"\tmovt r2, #0xdead\n"
"1:\n" /* Top of the loop */
"\tsub r1, r1, #1\n" /* R1 nwords-- */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tstr r2, [r0], #4\n" /* Save stack color word, increment stackptr */
"\tbne 1b\n" /* Bottom of the loop */
"2:\n"
"\tmov r14, #0\n" /* LR = return address (none) */
"\tb nx_start\n" /* Branch to nx_start */
);
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -311,15 +265,9 @@ void __start(void)
showprogress('\r');
showprogress('\n');
#ifdef CONFIG_STACK_COLORATION
/* Set the IDLE stack to the coloration value and jump into nx_start() */
go_nx_start((FAR void *)&_ebss, CONFIG_IDLETHREAD_STACKSIZE);
#else
nx_start();
/* Shouldn't get here */
for (; ; );
#endif
}

View File

@ -51,14 +51,6 @@
const uintptr_t g_idle_topstack = IDLE_STACK;
/****************************************************************************
* Private Function prototypes
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static inline void go_nx_start(void *pv, unsigned int nbytes);
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
@ -77,51 +69,6 @@ static inline void go_nx_start(void *pv, unsigned int nbytes);
# define showprogress(c)
#endif
/****************************************************************************
* Name: go_nx_start
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static inline void go_nx_start(void *pv, unsigned int nbytes)
{
/* Set the IDLE stack to the stack coloration value then jump to
* nx_start(). We take extreme care here because were currently
* executing on this stack.
*
* We want to avoid sneak stack access generated by the compiler.
* NOTE: this function must be inlined so that SRAM boot can work.
*/
__asm__ __volatile__
(
"\t.global nx_start\n"
"\tlsr %1, %1, #2\n" /* %1 = nwords = nbytes >> 2 */
"\tcmp %1, #0\n" /* Check (nwords == 0) */
"\tbeq 2f\n" /* (should not happen) */
"\tmov r2, #3\n"
"\tadd %0, %0, #3\n"
"\tbic %0, r2\n" /* %0 = Aligned stackptr */
"\tldr r2, =0xdeadbeef\n" /* R2 = STACK_COLOR = 0xdeadbeef */
"1:\n" /* Top of the loop */
"\tstr r2, [%0, #0]\n" /* Save stack color word */
"\tadd %0, %0, #4\n" /* Increment stackptr */
"\tsub %1, %1, #1\n" /* %1 nwords-- */
"\tcmp %1, #0\n" /* Check (nwords == 0) */
"\tbne 1b\n" /* Bottom of the loop */
"2:\n"
"\tmov r2, #0\n"
"\tmov r14, r2\n" /* LR = return address (none) */
"\tbl nx_start\n" /* Branch to nx_start */
:
: "r" (pv), "r" (nbytes)
: "r2"
);
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -223,13 +170,7 @@ void __start(void)
showprogress('\r');
showprogress('\n');
#ifdef CONFIG_STACK_COLORATION
/* Set the IDLE stack to the coloration value and jump into nx_start() */
go_nx_start((FAR void *)&_ebss, CONFIG_IDLETHREAD_STACKSIZE);
#else
nx_start();
#endif
/* Shouldn't get here */

View File

@ -75,10 +75,6 @@ const uintptr_t g_idle_topstack = HEAP_BASE;
#ifdef CONFIG_ARCH_FPU
static inline void sam_fpuconfig(void);
#endif
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
__attribute__ ((naked, no_instrument_function, noreturn));
#endif
#ifdef CONFIG_ARMV7M_STACKCHECK
/* We need to get r10 set before we can allow instrumentation calls */
@ -194,47 +190,6 @@ static inline void sam_fpuconfig(void)
# define sam_fpuconfig()
#endif
/****************************************************************************
* Name: go_nx_start
*
* Description:
* Set the IDLE stack to the coloration value and jump into nx_start()
*
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
{
/* Set the IDLE stack to the stack coloration value then jump to
* nx_start(). We take extreme care here because were currently
* executing on this stack.
*
* We want to avoid sneak stack access generated by the compiler.
*/
__asm__ __volatile__
(
"\tmovs r1, r1, lsr #2\n" /* R1 = nwords = nbytes >> 2 */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tbeq 2f\n" /* (should not happen) */
"\tbic r0, r0, #3\n" /* R0 = Aligned stackptr */
"\tmovw r2, #0xbeef\n" /* R2 = STACK_COLOR = 0xdeadbeef */
"\tmovt r2, #0xdead\n"
"1:\n" /* Top of the loop */
"\tsub r1, r1, #1\n" /* R1 nwords-- */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tstr r2, [r0], #4\n" /* Save stack color word, increment stackptr */
"\tbne 1b\n" /* Bottom of the loop */
"2:\n"
"\tmov r14, #0\n" /* LR = return address (none) */
"\tb nx_start\n" /* Branch to nx_start */
);
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -346,18 +301,9 @@ void __start(void)
showprogress('\r');
showprogress('\n');
#ifdef CONFIG_STACK_COLORATION
/* Set the IDLE stack to the coloration value and jump into nx_start() */
go_nx_start((FAR void *)&_ebss, CONFIG_IDLETHREAD_STACKSIZE);
#else
/* Call nx_start() */
nx_start();
/* Shouldn't get here */
for (; ; );
#endif
}

View File

@ -77,10 +77,6 @@ const uintptr_t g_idle_topstack = HEAP_BASE;
#ifdef CONFIG_ARCH_FPU
static inline void sam_fpu_configure(void);
#endif
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
__attribute__ ((naked, no_instrument_function, noreturn));
#endif
#ifdef CONFIG_ARMV7M_STACKCHECK
/* We need to get r10 set before we can allow instrumentation calls */
@ -196,47 +192,6 @@ static inline void sam_fpu_configure(void)
# define sam_fpu_configure()
#endif
/****************************************************************************
* Name: go_nx_start
*
* Description:
* Set the IDLE stack to the coloration value and jump into nx_start()
*
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
{
/* Set the IDLE stack to the stack coloration value then jump to
* nx_start(). We take extreme care here because were currently
* executing on this stack.
*
* We want to avoid sneak stack access generated by the compiler.
*/
__asm__ __volatile__
(
"\tmovs r1, r1, lsr #2\n" /* R1 = nwords = nbytes >> 2 */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tbeq 2f\n" /* (should not happen) */
"\tbic r0, r0, #3\n" /* R0 = Aligned stackptr */
"\tmovw r2, #0xbeef\n" /* R2 = STACK_COLOR = 0xdeadbeef */
"\tmovt r2, #0xdead\n"
"1:\n" /* Top of the loop */
"\tsub r1, r1, #1\n" /* R1 nwords-- */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tstr r2, [r0], #4\n" /* Save stack color word, increment stackptr */
"\tbne 1b\n" /* Bottom of the loop */
"2:\n"
"\tmov r14, #0\n" /* LR = return address (none) */
"\tb nx_start\n" /* Branch to nx_start */
);
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -342,18 +297,9 @@ void __start(void)
showprogress('\r');
showprogress('\n');
#ifdef CONFIG_STACK_COLORATION
/* Set the IDLE stack to the coloration value and jump into nx_start() */
go_nx_start((FAR void *)&_ebss, CONFIG_IDLETHREAD_STACKSIZE);
#else
/* Call nx_start() */
nx_start();
/* Shouldn't get here */
for (; ; );
#endif
}

View File

@ -86,10 +86,6 @@ const uintptr_t g_idle_topstack = HEAP_BASE;
#ifdef CONFIG_ARCH_FPU
static inline void sam_fpuconfig(void);
#endif
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
__attribute__ ((naked, no_instrument_function, noreturn));
#endif
/****************************************************************************
* Private Functions
@ -240,47 +236,6 @@ static inline void sam_tcmenable(void)
#endif
}
/****************************************************************************
* Name: go_nx_start
*
* Description:
* Set the IDLE stack to the coloration value and jump into nx_start()
*
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
{
/* Set the IDLE stack to the stack coloration value then jump to
* nx_start(). We take extreme care here because were currently
* executing on this stack.
*
* We want to avoid sneak stack access generated by the compiler.
*/
__asm__ __volatile__
(
"\tmovs r1, r1, lsr #2\n" /* R1 = nwords = nbytes >> 2 */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tbeq 2f\n" /* (should not happen) */
"\tbic r0, r0, #3\n" /* R0 = Aligned stackptr */
"\tmovw r2, #0xbeef\n" /* R2 = STACK_COLOR = 0xdeadbeef */
"\tmovt r2, #0xdead\n"
"1:\n" /* Top of the loop */
"\tsub r1, r1, #1\n" /* R1 nwords-- */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tstr r2, [r0], #4\n" /* Save stack color word, increment stackptr */
"\tbne 1b\n" /* Bottom of the loop */
"2:\n"
"\tmov r14, #0\n" /* LR = return address (none) */
"\tb nx_start\n" /* Branch to nx_start */
);
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -386,17 +341,9 @@ void __start(void)
/* Then start NuttX */
#ifdef CONFIG_STACK_COLORATION
/* Set the IDLE stack to the coloration value and jump into nx_start() */
go_nx_start((FAR void *)&_ebss, CONFIG_IDLETHREAD_STACKSIZE);
#else
/* Call nx_start() */
nx_start();
/* Shouldn't get here */
for (; ; );
#endif
}

View File

@ -74,10 +74,6 @@ const uintptr_t g_idle_topstack = HEAP_BASE;
#ifdef CONFIG_ARCH_FPU
static inline void stm32_fpuconfig(void);
#endif
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
__attribute__ ((naked, no_instrument_function, noreturn));
#endif
/****************************************************************************
* Private Functions
@ -197,47 +193,6 @@ static inline void stm32_fpuconfig(void)
# define stm32_fpuconfig()
#endif
/****************************************************************************
* Name: go_nx_start
*
* Description:
* Set the IDLE stack to the coloration value and jump into nx_start()
*
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
{
/* Set the IDLE stack to the stack coloration value then jump to
* nx_start(). We take extreme care here because were currently
* executing on this stack.
*
* We want to avoid sneak stack access generated by the compiler.
*/
__asm__ __volatile__
(
"\tmovs r1, r1, lsr #2\n" /* R1 = nwords = nbytes >> 2 */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tbeq 2f\n" /* (should not happen) */
"\tbic r0, r0, #3\n" /* R0 = Aligned stackptr */
"\tmovw r2, #0xbeef\n" /* R2 = STACK_COLOR = 0xdeadbeef */
"\tmovt r2, #0xdead\n"
"1:\n" /* Top of the loop */
"\tsub r1, r1, #1\n" /* R1 nwords-- */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tstr r2, [r0], #4\n" /* Save stack color word, increment stackptr */
"\tbne 1b\n" /* Bottom of the loop */
"2:\n"
"\tmov r14, #0\n" /* LR = return address (none) */
"\tb nx_start\n" /* Branch to nx_start */
);
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -328,17 +283,9 @@ void __start(void)
showprogress('\r');
showprogress('\n');
#ifdef CONFIG_STACK_COLORATION
/* Set the IDLE stack to the coloration value and jump into nx_start() */
go_nx_start((FAR void *)&_ebss, CONFIG_IDLETHREAD_STACKSIZE);
#else
/* Call nx_start() */
nx_start();
/* Shouldn't get here */
for (; ; );
#endif
}

View File

@ -86,10 +86,6 @@ const uintptr_t g_idle_topstack = HEAP_BASE;
#ifdef CONFIG_ARCH_FPU
static inline void stm32_fpuconfig(void);
#endif
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
__attribute__ ((naked, no_instrument_function, noreturn));
#endif
/****************************************************************************
* Private Functions
@ -241,47 +237,6 @@ static inline void stm32_tcmenable(void)
#endif
}
/****************************************************************************
* Name: go_nx_start
*
* Description:
* Set the IDLE stack to the coloration value and jump into nx_start()
*
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
{
/* Set the IDLE stack to the stack coloration value then jump to
* nx_start(). We take extreme care here because were currently
* executing on this stack.
*
* We want to avoid sneak stack access generated by the compiler.
*/
__asm__ __volatile__
(
"\tmovs r1, r1, lsr #2\n" /* R1 = nwords = nbytes >> 2 */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tbeq 2f\n" /* (should not happen) */
"\tbic r0, r0, #3\n" /* R0 = Aligned stackptr */
"\tmovw r2, #0xbeef\n" /* R2 = STACK_COLOR = 0xdeadbeef */
"\tmovt r2, #0xdead\n"
"1:\n" /* Top of the loop */
"\tsub r1, r1, #1\n" /* R1 nwords-- */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tstr r2, [r0], #4\n" /* Save stack color word, increment stackptr */
"\tbne 1b\n" /* Bottom of the loop */
"2:\n"
"\tmov r14, #0\n" /* LR = return address (none) */
"\tb nx_start\n" /* Branch to nx_start */
);
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -383,17 +338,9 @@ void __start(void)
/* Then start NuttX */
#ifdef CONFIG_STACK_COLORATION
/* Set the IDLE stack to the coloration value and jump into nx_start() */
go_nx_start((FAR void *)&_ebss, CONFIG_IDLETHREAD_STACKSIZE);
#else
/* Call nx_start() */
nx_start();
/* Shouldn't get here */
for (; ; );
#endif
}

View File

@ -87,10 +87,6 @@ const uintptr_t g_idle_topstack = HEAP_BASE;
#ifdef CONFIG_ARCH_FPU
static inline void stm32_fpuconfig(void);
#endif
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
__attribute__ ((naked, no_instrument_function, noreturn));
#endif
/****************************************************************************
* Name: showprogress
@ -256,47 +252,6 @@ static inline void stm32_tcmenable(void)
#endif
}
/****************************************************************************
* Name: go_nx_start
*
* Description:
* Set the IDLE stack to the coloration value and jump into nx_start()
*
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
{
/* Set the IDLE stack to the stack coloration value then jump to
* nx_start(). We take extreme care here because were currently
* executing on this stack.
*
* We want to avoid sneak stack access generated by the compiler.
*/
__asm__ __volatile__
(
"\tmovs r1, r1, lsr #2\n" /* R1 = nwords = nbytes >> 2 */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tbeq 2f\n" /* (should not happen) */
"\tbic r0, r0, #3\n" /* R0 = Aligned stackptr */
"\tmovw r2, #0xbeef\n" /* R2 = STACK_COLOR = 0xdeadbeef */
"\tmovt r2, #0xdead\n"
"1:\n" /* Top of the loop */
"\tsub r1, r1, #1\n" /* R1 nwords-- */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tstr r2, [r0], #4\n" /* Save stack color word, increment stackptr */
"\tbne 1b\n" /* Bottom of the loop */
"2:\n"
"\tmov r14, #0\n" /* LR = return address (none) */
"\tb nx_start\n" /* Branch to nx_start */
);
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -400,17 +355,9 @@ void __start(void)
showprogress('\r');
showprogress('\n');
#ifdef CONFIG_STACK_COLORATION
/* Set the IDLE stack to the coloration value and jump into nx_start() */
go_nx_start((FAR void *)&_ebss, CONFIG_IDLETHREAD_STACKSIZE);
#else
/* Call nx_start() */
nx_start();
/* Shouldn't get here */
for (; ; );
#endif
}

View File

@ -83,10 +83,6 @@ const uintptr_t g_idle_topstack = HEAP_BASE;
#ifdef CONFIG_ARCH_FPU
static inline void stm32l4_fpuconfig(void);
#endif
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
__attribute__ ((naked, no_instrument_function, noreturn));
#endif
/****************************************************************************
* Private Functions
@ -206,47 +202,6 @@ static inline void stm32l4_fpuconfig(void)
# define stm32l4_fpuconfig()
#endif
/****************************************************************************
* Name: go_nx_start
*
* Description:
* Set the IDLE stack to the coloration value and jump into nx_start()
*
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
{
/* Set the IDLE stack to the stack coloration value then jump to
* nx_start(). We take extreme care here because were currently
* executing on this stack.
*
* We want to avoid sneak stack access generated by the compiler.
*/
__asm__ __volatile__
(
"\tmovs r1, r1, lsr #2\n" /* R1 = nwords = nbytes >> 2 */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tbeq 2f\n" /* (should not happen) */
"\tbic r0, r0, #3\n" /* R0 = Aligned stackptr */
"\tmovw r2, #0xbeef\n" /* R2 = STACK_COLOR = 0xdeadbeef */
"\tmovt r2, #0xdead\n"
"1:\n" /* Top of the loop */
"\tsub r1, r1, #1\n" /* R1 nwords-- */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tstr r2, [r0], #4\n" /* Save stack color word, increment stackptr */
"\tbne 1b\n" /* Bottom of the loop */
"2:\n"
"\tmov r14, #0\n" /* LR = return address (none) */
"\tb nx_start\n" /* Branch to nx_start */
);
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -349,17 +304,9 @@ void __start(void)
showprogress('\r');
showprogress('\n');
#ifdef CONFIG_STACK_COLORATION
/* Set the IDLE stack to the coloration value and jump into nx_start() */
go_nx_start((FAR void *)&_ebss, CONFIG_IDLETHREAD_STACKSIZE);
#else
/* Call nx_start() */
nx_start();
/* Shouldn't get here */
for (; ; );
#endif
}

View File

@ -85,10 +85,6 @@ const uintptr_t g_idle_topstack = HEAP_BASE;
#ifdef CONFIG_ARCH_FPU
static inline void stm32l5_fpuconfig(void);
#endif
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
__attribute__ ((naked, no_instrument_function, noreturn));
#endif
/****************************************************************************
* Private Functions
@ -209,47 +205,6 @@ static inline void stm32l5_fpuconfig(void)
# define stm32l5_fpuconfig()
#endif
/****************************************************************************
* Name: go_nx_start
*
* Description:
* Set the IDLE stack to the coloration value and jump into nx_start()
*
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
{
/* Set the IDLE stack to the stack coloration value then jump to
* nx_start(). We take extreme care here because were currently
* executing on this stack.
*
* We want to avoid sneak stack access generated by the compiler.
*/
__asm__ __volatile__
(
"\tmovs r1, r1, lsr #2\n" /* R1 = nwords = nbytes >> 2 */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tbeq 2f\n" /* (should not happen) */
"\tbic r0, r0, #3\n" /* R0 = Aligned stackptr */
"\tmovw r2, #0xbeef\n" /* R2 = STACK_COLOR = 0xdeadbeef */
"\tmovt r2, #0xdead\n"
"1:\n" /* Top of the loop */
"\tsub r1, r1, #1\n" /* R1 nwords-- */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tstr r2, [r0], #4\n" /* Save stack color word, increment stackptr */
"\tbne 1b\n" /* Bottom of the loop */
"2:\n"
"\tmov r14, #0\n" /* LR = return address (none) */
"\tb nx_start\n" /* Branch to nx_start */
);
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -352,17 +307,9 @@ void __start(void)
showprogress('\r');
showprogress('\n');
#ifdef CONFIG_STACK_COLORATION
/* Set the IDLE stack to the coloration value and jump into nx_start() */
go_nx_start((FAR void *)&_ebss, CONFIG_IDLETHREAD_STACKSIZE);
#else
/* Call nx_start() */
nx_start();
/* Shoulnd't get here */
for (; ; );
#endif
}

View File

@ -203,69 +203,6 @@ static void tms570_memory_initialize(uint32_t ramset)
putreg32(SYS_MINITGCR_DISABLE, TMS570_SYS_MINITGCR);
}
/****************************************************************************
* Name: go_nx_start
*
* Description:
* Re-initialize the stack and frame pointers and branch to OS start.
*
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
naked_function noreturn_function;
static void go_nx_start(void *pv, unsigned int nbytes)
{
/* Set the IDLE stack to the stack coloration value then jump to
* nx_start(). We take extreme care here because were currently
* executing on this stack.
*
* We want to avoid sneak stack access generated by the compiler.
*/
__asm__ __volatile__
(
"\tmovs r1, r1, lsr #2\n" /* R1 = nwords = nbytes >> 2 */
"\tbeq 2f\n" /* (should not happen) */
"\tbic r0, r0, #3\n" /* R0 = Aligned stackptr */
"\tmovw r2, #0xbeef\n" /* R2 = STACK_COLOR = 0xdeadbeef */
"\tmovt r2, #0xdead\n"
"1:\n" /* Top of the loop */
"\tsub r1, r1, #1\n" /* R1 nwords-- */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tstr r2, [r0], #4\n" /* Save stack color word, increment stackptr */
"\tbne 1b\n" /* Bottom of the loop */
"2:\n"
"\tldr ip, =g_idle_topstack\n" /* IP=address of g_idle_topstack */
"\tldr sp, [ip]\n" /* Reset the stack pointer */
"\tmov fp, #0\n" /* Reset the frame pointer */
"\tmov r14, #0\n" /* LR = return address (none) */
"\tb nx_start\n" /* Branch to nx_start */
);
}
#else
static void go_nx_start(void) naked_function noreturn_function;
static void go_nx_start(void)
{
/* Reset the stack/frame pointer and jump to nx_start(). */
__asm__ __volatile__
(
"\tldr ip, =g_idle_topstack\n" /* IP=address of g_idle_topstack */
"\tldr sp, [ip]\n" /* Reset the stack pointer */
"\tmov fp, #0\n" /* Reset the frame pointer */
"\tmov r14, #0\n" /* LR = return address (none) */
"\tb nx_start\n" /* Branch to nx_start */
);
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -478,13 +415,5 @@ void arm_boot(void)
/* Then start NuttX */
#ifdef CONFIG_STACK_COLORATION
/* Set the IDLE stack to the coloration value and jump into nx_start() */
go_nx_start((FAR void *)&_ebss, CONFIG_IDLETHREAD_STACKSIZE);
#else
/* Branch to nx_start(), resetting the stack and frame pointers. */
go_nx_start();
#endif
nx_start();
}

View File

@ -50,10 +50,6 @@ static inline void xmc4_fpu_config(void);
#endif
static inline void xmc4_unaligned(void);
static inline void xmc4_flash_waitstates(void);
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
__attribute__ ((naked, no_instrument_function, noreturn));
#endif
/****************************************************************************
* Pre-processor Definitions
@ -250,47 +246,6 @@ static inline void xmc4_flash_waitstates(void)
putreg32(regval, XMC4_FLASH_FCON);
}
/****************************************************************************
* Name: go_nx_start
*
* Description:
* Set the IDLE stack to the coloration value and jump into nx_start()
*
****************************************************************************/
#ifdef CONFIG_STACK_COLORATION
static void go_nx_start(void *pv, unsigned int nbytes)
{
/* Set the IDLE stack to the stack coloration value then jump to
* nx_start(). We take extreme care here because were currently
* executing on this stack.
*
* We want to avoid sneak stack access generated by the compiler.
*/
__asm__ __volatile__
(
"\tmovs r1, r1, lsr #2\n" /* R1 = nwords = nbytes >> 2 */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tbeq 2f\n" /* (should not happen) */
"\tbic r0, r0, #3\n" /* R0 = Aligned stackptr */
"\tmovw r2, #0xbeef\n" /* R2 = STACK_COLOR = 0xdeadbeef */
"\tmovt r2, #0xdead\n"
"1:\n" /* Top of the loop */
"\tsub r1, r1, #1\n" /* R1 nwords-- */
"\tcmp r1, #0\n" /* Check (nwords == 0) */
"\tstr r2, [r0], #4\n" /* Save stack color word, increment stackptr */
"\tbne 1b\n" /* Bottom of the loop */
"2:\n"
"\tmov r14, #0\n" /* LR = return address (none) */
"\tb nx_start\n" /* Branch to nx_start */
);
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -405,17 +360,9 @@ void __start(void)
/* Then start NuttX */
#ifdef CONFIG_STACK_COLORATION
/* Set the IDLE stack to the coloration value and jump into nx_start() */
go_nx_start((FAR void *)&_ebss, CONFIG_IDLETHREAD_STACKSIZE);
#else
/* Call nx_start() */
nx_start();
/* Shouldn't get here */
for (; ; );
#endif
}

View File

@ -37,14 +37,6 @@
* Pre-processor Definitions
****************************************************************************/
/* This is the value used to mark the stack for subsequent stack monitoring
* logic.
*/
#define STACK_COLOR 0xdeadbeef
#define INTSTACK_COLOR 0xdeadbeef
#define HEAP_COLOR 'h'
/* In the LM32 model, the state is copied from the stack to the TCB, but
* only a referenced is passed to get the state from the TCB.
*/

View File

@ -37,14 +37,6 @@
* Pre-processor Definitions
****************************************************************************/
/* This is the value used to mark the stack for subsequent stack monitoring
* logic.
*/
#define STACK_COLOR 0xdeadbeef
#define INTSTACK_COLOR 0xdeadbeef
#define HEAP_COLOR 'h'
/* In the MINERVA model, the state is copied from the stack to the TCB, but
* only a referenced is passed to get the state from the TCB.
*/

View File

@ -51,16 +51,6 @@ bl602_start:
add sp, sp, t0
andi sp, sp, ~0xF
la t0, g_idle_stack
li t1, CONFIG_IDLETHREAD_STACKSIZE
li t2, 0xdeadbeef
color_idle_stack:
addi t1, t1, -4
add t3, t1, t0
sw t2, 0(t3)
bnez t1, color_idle_stack
#ifndef RUN_IN_RAM
/* Load boot2 partition address */

View File

@ -93,33 +93,6 @@ __start:
la t0, __trap_vec
csrw mtvec, t0
#ifdef CONFIG_STACK_COLORATION
/* Write a known value to the IDLE thread stack to support stack
* monitoring logic
*/
lui t0, %hi(C906_IDLESTACK_BASE)
addi t0, t0, %lo(C906_IDLESTACK_BASE)
lui t1, %hi(C906_IDLESTACK_TOP)
addi t1, t1, %lo(C906_IDLESTACK_TOP)
lui t2, %hi(STACK_COLOR)
addi t2, t2, %lo(STACK_COLOR)
bgeu t0, t1, 2f
/* t0 = start of IDLE stack; t1 = Size of tack; t2 = coloration */
1:
sw t2, 0(t0)
addi t0, t0, 4
bne t0, t1, 1b
2:
#endif
/* Jump to __c906_start with mhartid */
j __c906_start

View File

@ -57,19 +57,6 @@ __start:
la t0, __trap_vec
csrw mtvec, t0
#ifdef CONFIG_STACK_COLORATION
/* t0 = start of IDLE stack; t1 = top of the stack; t2 = coloration */
la t0, FE310_IDLESTACK_BASE
la t1, FE310_IDLESTACK_TOP
li t2, STACK_COLOR
1:
sw t2, 0(t0)
addi t0, t0, 4
bne t0, t1, 1b
#endif
/* Jump to __fe310_start */
jal x1, __fe310_start

View File

@ -72,25 +72,6 @@ __start:
la t0, __trap_vec
csrw mtvec, t0
#ifdef CONFIG_STACK_COLORATION
/* t0 = start of IDLE stack; t1 = top of the stack; t2 = coloration */
bnez a0, 3f /* a0: hartid */
la t0, K210_IDLESTACK0_BASE
j 4f
3:
la t0, K210_IDLESTACK1_BASE
4:
mv t1, sp
li t2, STACK_COLOR
5:
sw t2, 0(t0)
addi t0, t0, 4
bne t0, t1, 5b
#endif
/* Jump to __k210_start with mhartid */
j __k210_start

View File

@ -147,27 +147,6 @@ __start_mpfs:
.option pop
#ifdef CONFIG_STACK_COLORATION
/* Write a known value to the IDLE thread stack to support stack
* monitoring logic
*/
la t0, MPFS_IDLESTACK_BASE
la t1, MPFS_IDLESTACK_TOP
li t2, STACK_COLOR
bgeu t0, t1, 2f
/* t0 = start of IDLE stack; t1 = top of stack; t2 = coloration */
1:
sw t2, 0(t0)
addi t0, t0, 4
bne t0, t1, 1b
2:
#endif
/* Jump to __mpfs_start with mhartid in a0 */
j __mpfs_start

View File

@ -100,22 +100,6 @@ void IRAM_ATTR __start(void)
up_irq_disable();
#ifdef CONFIG_STACK_COLORATION
{
register uint32_t *ptr;
register int i;
/* If stack debug is enabled, then fill the stack with a recognizable
* value that we can use later to test for high water marks.
*/
for (i = 0, ptr = g_idlestack; i < IDLETHREAD_STACKWORDS; i++)
{
*ptr++ = STACK_COLOR;
}
}
#endif
/* Move the stack to a known location. Although we were given a stack
* pointer at start-up, we don't know where that stack pointer is
* positioned with respect to our memory map. The only safe option is to

View File

@ -108,22 +108,6 @@ void IRAM_ATTR __start(void)
xtensa_earlyserialinit();
#endif
#ifdef CONFIG_STACK_COLORATION
{
register uint32_t *ptr;
register int i;
/* If stack debug is enabled, then fill the stack with a recognizable
* value that we can use later to test for high water marks.
*/
for (i = 0, ptr = g_idlestack; i < IDLETHREAD_STACKWORDS; i++)
{
*ptr++ = STACK_COLOR;
}
}
#endif
/* Move the stack to a known location. Although we were given a stack
* pointer at start-up, we don't know where that stack pointer is
* positioned with respect to our memory map. The only safe option is to