Remove CONFIG_DEBUG_STACK. Adding CONFIG_STACK_COLORATION makes this configuration option pointless
This commit is contained in:
parent
1b822bda8d
commit
7e46e94546
57 changed files with 59 additions and 253 deletions
7
Kconfig
7
Kconfig
|
@ -522,13 +522,6 @@ config DEBUG_PAGING
|
|||
---help---
|
||||
Enable demand paging debug SYSLOG output (disabled by default)
|
||||
|
||||
config DEBUG_STACK
|
||||
bool "Stack usage debug hooks"
|
||||
default n
|
||||
depends on ARCH_HAVE_STACKCHECK
|
||||
---help---
|
||||
Enable hooks to check stack usage. Only supported by a few architectures.
|
||||
|
||||
comment "Driver Debug Options"
|
||||
|
||||
config DEBUG_LCD
|
||||
|
|
|
@ -123,10 +123,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
# A1x-specific assembly language files
|
||||
|
||||
CHIP_ASRCS =
|
||||
|
|
|
@ -165,7 +165,8 @@ void up_irqinitialize(void)
|
|||
}
|
||||
|
||||
/* Colorize the interrupt stack for debug purposes */
|
||||
#if (defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)) && CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||
|
||||
#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||
{
|
||||
size_t intstack_size = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
||||
up_stack_color((FAR void *)((uintptr_t)&g_intstackbase - intstack_size),
|
||||
|
|
|
@ -76,12 +76,6 @@
|
|||
# undef CONFIG_ARCH_USBDUMP
|
||||
#endif
|
||||
|
||||
/* Check if we can dump stack usage information */
|
||||
|
||||
#ifndef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_STACK
|
||||
#endif
|
||||
|
||||
/* The following is just intended to keep some ugliness out of the mainline
|
||||
* code. We are going to print the task name if:
|
||||
*
|
||||
|
@ -237,7 +231,7 @@ static void up_dumpstate(void)
|
|||
lldbg("IRQ stack:\n");
|
||||
lldbg(" base: %08x\n", istackbase);
|
||||
lldbg(" size: %08x\n", istacksize);
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_intstack());
|
||||
#endif
|
||||
|
||||
|
@ -264,7 +258,7 @@ static void up_dumpstate(void)
|
|||
lldbg("User stack:\n");
|
||||
lldbg(" base: %08x\n", ustackbase);
|
||||
lldbg(" size: %08x\n", ustacksize);
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_tcbstack(rtcb));
|
||||
#endif
|
||||
|
||||
|
@ -272,7 +266,7 @@ static void up_dumpstate(void)
|
|||
lldbg("sp: %08x\n", sp);
|
||||
lldbg("stack base: %08x\n", ustackbase);
|
||||
lldbg("stack size: %08x\n", ustacksize);
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg("stack used: %08x\n", up_check_tcbstack(rtcb));
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -611,7 +611,7 @@ __start:
|
|||
|
||||
bl up_boot
|
||||
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
/* Write a known value to the IDLE thread stack to support stack
|
||||
* monitoring logic
|
||||
*/
|
||||
|
@ -678,7 +678,7 @@ __start:
|
|||
.long _edata
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
.type .Lstkinit, %object
|
||||
.Lstkinit:
|
||||
.long _ebss /* Beginning of the IDLE stack, then words of IDLE stack */
|
||||
|
|
|
@ -128,7 +128,7 @@ __start:
|
|||
bl board_led_initialize
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
/* Write a known value to the IDLE thread stack to support stack
|
||||
* monitoring logic
|
||||
*/
|
||||
|
@ -170,7 +170,7 @@ __start:
|
|||
.long _edata
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
.type .Lstkinit, %object
|
||||
.Lstkinit:
|
||||
.long _ebss /* Beginning of the IDLE stack, then words of IDLE stack */
|
||||
|
|
|
@ -75,12 +75,6 @@
|
|||
# undef CONFIG_ARCH_USBDUMP
|
||||
#endif
|
||||
|
||||
/* Check if we can dump stack usage information */
|
||||
|
||||
#ifndef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_STACK
|
||||
#endif
|
||||
|
||||
/* The following is just intended to keep some ugliness out of the mainline
|
||||
* code. We are going to print the task name if:
|
||||
*
|
||||
|
@ -243,7 +237,7 @@ static void up_dumpstate(void)
|
|||
lldbg("IRQ stack:\n");
|
||||
lldbg(" base: %08x\n", istackbase);
|
||||
lldbg(" size: %08x\n", istacksize);
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_intstack());
|
||||
#endif
|
||||
|
||||
|
@ -272,7 +266,7 @@ static void up_dumpstate(void)
|
|||
lldbg("User stack:\n");
|
||||
lldbg(" base: %08x\n", ustackbase);
|
||||
lldbg(" size: %08x\n", ustacksize);
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_tcbstack(rtcb));
|
||||
#endif
|
||||
|
||||
|
@ -289,7 +283,7 @@ static void up_dumpstate(void)
|
|||
lldbg("sp: %08x\n", sp);
|
||||
lldbg("stack base: %08x\n", ustackbase);
|
||||
lldbg("stack size: %08x\n", ustacksize);
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg("stack used: %08x\n", up_check_tcbstack(rtcb));
|
||||
#endif
|
||||
|
||||
|
|
|
@ -74,12 +74,6 @@
|
|||
# undef CONFIG_ARCH_USBDUMP
|
||||
#endif
|
||||
|
||||
/* Check if we can dump stack usage information */
|
||||
|
||||
#ifndef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_STACK
|
||||
#endif
|
||||
|
||||
/* The following is just intended to keep some ugliness out of the mainline
|
||||
* code. We are going to print the task name if:
|
||||
*
|
||||
|
@ -239,7 +233,7 @@ static void up_dumpstate(void)
|
|||
lldbg("Interrupt stack:\n");
|
||||
lldbg(" base: %08x\n", istackbase);
|
||||
lldbg(" size: %08x\n", istacksize);
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_intstack());
|
||||
#endif
|
||||
#endif
|
||||
|
@ -249,7 +243,7 @@ static void up_dumpstate(void)
|
|||
lldbg("User stack:\n");
|
||||
lldbg(" base: %08x\n", ustackbase);
|
||||
lldbg(" size: %08x\n", ustacksize);
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_tcbstack(rtcb));
|
||||
#endif
|
||||
|
||||
|
|
|
@ -631,7 +631,7 @@ __start:
|
|||
|
||||
bl up_boot
|
||||
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
/* Write a known value to the IDLE thread stack to support stack
|
||||
* monitoring logic
|
||||
*/
|
||||
|
@ -748,7 +748,7 @@ arm_data_initialize:
|
|||
.size .Ldatainit, . -.Ldatainit
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
.type .Lstkinit, %object
|
||||
.Lstkinit:
|
||||
#ifdef CONFIG_BOOT_SDRAM_DATA
|
||||
|
|
|
@ -675,7 +675,7 @@ __start:
|
|||
|
||||
bl up_boot
|
||||
|
||||
#if defined(CONFIG_DEBUG_STACK)) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
/* Write a known value to the IDLE thread stack to support stack
|
||||
* monitoring logic
|
||||
*/
|
||||
|
@ -797,7 +797,7 @@ arm_data_initialize:
|
|||
.long _edata
|
||||
.size .Ldatainit, . -.Ldatainit
|
||||
|
||||
#if defined(CONFIG_DEBUG_STACK)) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
.type .Lstkinit, %object
|
||||
.Lstkinit:
|
||||
#ifdef CONFIG_BOOT_SDRAM_DATA
|
||||
|
|
|
@ -74,12 +74,6 @@
|
|||
# undef CONFIG_ARCH_USBDUMP
|
||||
#endif
|
||||
|
||||
/* Check if we can dump stack usage information */
|
||||
|
||||
#ifndef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_STACK
|
||||
#endif
|
||||
|
||||
/* The following is just intended to keep some ugliness out of the mainline
|
||||
* code. We are going to print the task name if:
|
||||
*
|
||||
|
@ -248,7 +242,7 @@ static void up_dumpstate(void)
|
|||
lldbg("IRQ stack:\n");
|
||||
lldbg(" base: %08x\n", istackbase);
|
||||
lldbg(" size: %08x\n", istacksize);
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_intstack());
|
||||
#endif
|
||||
|
||||
|
@ -277,7 +271,7 @@ static void up_dumpstate(void)
|
|||
lldbg("User stack:\n");
|
||||
lldbg(" base: %08x\n", ustackbase);
|
||||
lldbg(" size: %08x\n", ustacksize);
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_tcbstack(rtcb));
|
||||
#endif
|
||||
|
||||
|
@ -297,7 +291,7 @@ static void up_dumpstate(void)
|
|||
lldbg("sp: %08x\n", sp);
|
||||
lldbg("stack base: %08x\n", ustackbase);
|
||||
lldbg("stack size: %08x\n", ustacksize);
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg("stack used: %08x\n", up_check_tcbstack(rtcb));
|
||||
#endif
|
||||
|
||||
|
|
|
@ -53,10 +53,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
CHIP_ASRCS = c5471_lowputc.S c5471_vectors.S
|
||||
CHIP_CSRCS = c5471_irq.c c5471_serial.c c5471_watchdog.c c5471_ethernet.c
|
||||
|
||||
|
|
|
@ -56,10 +56,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
CHIP_ASRCS = calypso_lowputc.S
|
||||
CHIP_CSRCS = calypso_irq.c calypso_heap.c calypso_serial.c calypso_spi.c
|
||||
CHIP_CSRCS += clock.c calypso_uwire.c calypso_armio.c calypso_keypad.c
|
||||
|
|
|
@ -53,11 +53,7 @@
|
|||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_DEBUG)
|
||||
# undef CONFIG_DEBUG_STACK
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
|
@ -203,4 +199,4 @@ size_t up_check_intstack_remain(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_DEBUG_STACK || CONFIG_STACK_COLORATION */
|
||||
#endif /* CONFIG_STACK_COLORATION */
|
||||
|
|
|
@ -162,22 +162,14 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
|
||||
if (ttype == TCB_FLAG_TTYPE_KERNEL)
|
||||
{
|
||||
#if defined(CONFIG_DEBUG) && !(defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION))
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* Use the user-space allocator if this is a task or pthread */
|
||||
|
||||
#if defined(CONFIG_DEBUG) && !(defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION))
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kumm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kumm_malloc(stack_size);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
|
@ -230,7 +222,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
* water marks.
|
||||
*/
|
||||
|
||||
#if (defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_STACK)) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
up_stack_color(tcb->stack_alloc_ptr, tcb->adj_stack_size);
|
||||
#endif
|
||||
|
||||
|
@ -249,7 +241,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if (defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_STACK)) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
void up_stack_color(FAR void *stackbase, size_t nbytes)
|
||||
{
|
||||
/* Take extra care that we do not write outsize the stack boundaries */
|
||||
|
|
|
@ -96,7 +96,7 @@ static void up_calibratedelay(void)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if (defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)) && CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||
#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||
static inline void up_color_intstack(void)
|
||||
{
|
||||
uint32_t *ptr = (uint32_t *)&g_intstackalloc;
|
||||
|
|
|
@ -519,7 +519,7 @@ void up_rnginitialize(void);
|
|||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
#if (defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_STACK)) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
void up_stack_color(FAR void *stackbase, size_t nbytes);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -54,10 +54,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
CHIP_ASRCS = dm320_lowputc.S dm320_restart.S
|
||||
|
||||
CHIP_CSRCS = dm320_allocateheap.c dm320_boot.c dm320_decodeirq.c
|
||||
|
|
|
@ -75,10 +75,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ELF),y)
|
||||
CMN_CSRCS += up_elf.c
|
||||
endif
|
||||
|
|
|
@ -353,7 +353,7 @@ void up_irqinitialize(void)
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if (defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)) && CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||
#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||
/* Colorize the interrupt stack for debug purposes */
|
||||
|
||||
{
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
#ifdef CONFIG_ARCH_FPU
|
||||
static inline void efm32_fpuconfig(void);
|
||||
#endif
|
||||
#if defined(CONFIG_DEBUG_STACK)) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
static void go_os_start(void *pv, unsigned int nbytes)
|
||||
__attribute__ ((naked,no_instrument_function,noreturn));
|
||||
#endif
|
||||
|
@ -195,7 +195,7 @@ static inline void efm32_fpuconfig(void)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_DEBUG_STACK)) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
static void go_os_start(void *pv, unsigned int nbytes)
|
||||
{
|
||||
/* Set the IDLE stack to the stack coloration value then jump to
|
||||
|
@ -301,7 +301,7 @@ void __start(void)
|
|||
showprogress('\r');
|
||||
showprogress('\n');
|
||||
|
||||
#if defined(CONFIG_DEBUG_STACK)) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
/* Set the IDLE stack to the coloration value and jump into os_start() */
|
||||
|
||||
go_os_start((FAR void *)&_ebss, CONFIG_IDLETHREAD_STACKSIZE);
|
||||
|
|
|
@ -53,10 +53,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
CHIP_ASRCS = imx_lowputc.S
|
||||
CHIP_CSRCS = imx_boot.c imx_gpio.c imx_allocateheap.c imx_irq.c
|
||||
CHIP_CSRCS += imx_serial.c imx_decodeirq.c imx_spi.c
|
||||
|
|
|
@ -59,10 +59,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ELF),y)
|
||||
CMN_CSRCS += up_elf.c
|
||||
endif
|
||||
|
|
|
@ -58,10 +58,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
CHIP_ASRCS = lpc214x_lowputc.S
|
||||
CHIP_CSRCS = lpc214x_decodeirq.c lpc214x_irq.c lpc214x_serial.c
|
||||
|
||||
|
|
|
@ -62,10 +62,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
CHIP_ASRCS = lpc23xx_lowputc.S
|
||||
CHIP_CSRCS += lpc23xx_pllsetup.c lpc23xx_decodeirq.c lpc23xx_irq.c
|
||||
CHIP_CSRCS += lpc23xx_serial.c lpc23xx_io.c
|
||||
|
|
|
@ -59,10 +59,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
CGU_ASRCS =
|
||||
|
||||
CGU_CSRCS = lpc31_bcrndx.c lpc31_clkdomain.c lpc31_clkexten.c
|
||||
|
|
|
@ -72,10 +72,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ELF),y)
|
||||
CMN_CSRCS += up_elf.c
|
||||
endif
|
||||
|
|
|
@ -59,10 +59,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ELF),y)
|
||||
CMN_CSRCS += up_elf.c
|
||||
endif
|
||||
|
|
|
@ -78,10 +78,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
# Required SAM3/4 files
|
||||
|
||||
CHIP_ASRCS =
|
||||
|
|
|
@ -125,10 +125,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
# SAMA5-specific assembly language files
|
||||
|
||||
CHIP_ASRCS =
|
||||
|
|
|
@ -427,7 +427,7 @@ void up_irqinitialize(void)
|
|||
|
||||
/* Colorize the interrupt stack for debug purposes */
|
||||
|
||||
#if (defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)) && CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||
#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||
{
|
||||
size_t intstack_size = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
||||
up_stack_color((FAR void *)((uintptr_t)&g_intstackbase - intstack_size),
|
||||
|
|
|
@ -59,10 +59,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ELF),y)
|
||||
CMN_CSRCS += up_elf.c
|
||||
endif
|
||||
|
|
|
@ -83,10 +83,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ELF),y)
|
||||
CMN_CSRCS += up_elf.c
|
||||
endif
|
||||
|
|
|
@ -308,7 +308,7 @@ void up_irqinitialize(void)
|
|||
|
||||
/* Colorize the interrupt stack for debug purposes */
|
||||
|
||||
#if (defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)) && CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||
#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||
{
|
||||
size_t intstack_size = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
||||
up_stack_color((FAR void *)((uintptr_t)&g_intstackbase - intstack_size),
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
#ifdef CONFIG_ARCH_FPU
|
||||
static inline void stm32_fpuconfig(void);
|
||||
#endif
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
static void go_os_start(void *pv, unsigned int nbytes)
|
||||
__attribute__ ((naked,no_instrument_function,noreturn));
|
||||
#endif
|
||||
|
@ -195,7 +195,8 @@ static inline void stm32_fpuconfig(void)
|
|||
* Set the IDLE stack to the
|
||||
*
|
||||
****************************************************************************/
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
static void go_os_start(void *pv, unsigned int nbytes)
|
||||
{
|
||||
/* Set the IDLE stack to the stack coloration value then jump to
|
||||
|
@ -310,7 +311,7 @@ void __start(void)
|
|||
showprogress('\r');
|
||||
showprogress('\n');
|
||||
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
/* Set the IDLE stack to the coloration value and jump into os_start() */
|
||||
|
||||
go_os_start((FAR void *)&_ebss, CONFIG_IDLETHREAD_STACKSIZE);
|
||||
|
|
|
@ -58,10 +58,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
CHIP_ASRCS =
|
||||
CHIP_CSRCS = str71x_prccu.c str71x_lowputc.c str71x_decodeirq.c str71x_irq.c
|
||||
CHIP_CSRCS += str71x_serial.c
|
||||
|
|
|
@ -59,10 +59,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BUILD_PROTECTED),y)
|
||||
CMN_CSRCS += up_mpu.c up_task_start.c up_pthread_start.c
|
||||
ifneq ($(CONFIG_DISABLE_SIGNALS),y)
|
||||
|
|
|
@ -62,10 +62,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ARCH_ROMGETC),y)
|
||||
CMN_CSRCS += up_romgetc.c
|
||||
endif
|
||||
|
|
|
@ -62,10 +62,6 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
|
|||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_STACK),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ARCH_ROMGETC),y)
|
||||
CMN_CSRCS += up_romgetc.c
|
||||
endif
|
||||
|
|
|
@ -53,11 +53,7 @@
|
|||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_DEBUG)
|
||||
# undef CONFIG_DEBUG_STACK
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_DEBUG_STACK)) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
|
@ -199,4 +195,4 @@ size_t up_check_intstack_remain(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_DEBUG_STACK || CONFIG_STACK_COLORATION */
|
||||
#endif /* CONFIG_STACK_COLORATION */
|
||||
|
|
|
@ -120,11 +120,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
* then create a zeroed stack to make stack dumps easier to trace.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_DEBUG) && !(defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION))
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kumm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kumm_malloc(stack_size);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
/* Was the allocation successful? */
|
||||
|
@ -147,7 +143,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
* water marks.
|
||||
*/
|
||||
|
||||
#if (defined(CONFIG_DEBUG_STACK)) || defined(CONFIG_STACK_COLORATION))
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
memset(tcb->stack_alloc_ptr, STACK_COLOR, stack_size);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -65,12 +65,6 @@
|
|||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Check if we can dump stack usage information */
|
||||
|
||||
#ifndef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_STACK
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
@ -208,7 +202,7 @@ void up_dumpstate(void)
|
|||
lldbg("IRQ stack:\n");
|
||||
lldbg(" base: %04x\n", istackbase);
|
||||
lldbg(" size: %04x\n", istacksize);
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_intstack());
|
||||
#endif
|
||||
|
||||
|
@ -237,7 +231,7 @@ void up_dumpstate(void)
|
|||
lldbg("User stack:\n");
|
||||
lldbg(" base: %04x\n", ustackbase);
|
||||
lldbg(" size: %04x\n", ustacksize);
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_tcbstack(rtcb));
|
||||
#endif
|
||||
|
||||
|
@ -253,7 +247,7 @@ void up_dumpstate(void)
|
|||
lldbg("sp: %04x\n", sp);
|
||||
lldbg("stack base: %04x\n", ustackbase);
|
||||
lldbg("stack size: %04x\n", ustacksize);
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg("stack used: %08x\n", up_check_tcbstack(rtcb));
|
||||
#endif
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
|
|||
* that we can use later to test for high water marks.
|
||||
*/
|
||||
|
||||
#if (defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_STACK)) || defined(CONFIG_STACK_COLORATION))
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
memset(tcb->stack_alloc_ptr, STACK_COLOR, stack_size);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -129,22 +129,14 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
|
||||
if (ttype == TCB_FLAG_TTYPE_KERNEL)
|
||||
{
|
||||
#if defined(CONFIG_DEBUG) && !(defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION))
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* Use the user-space allocator if this is a task or pthread */
|
||||
|
||||
#if defined(CONFIG_DEBUG) && !(defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION))
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kumm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kumm_malloc(stack_size);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
|
@ -169,7 +161,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
* water marks.
|
||||
*/
|
||||
|
||||
#if (defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_STACK)) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
memset(tcb->stack_alloc_ptr, STACK_COLOR, stack_size);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -65,12 +65,6 @@
|
|||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Check if we can dump stack usage information */
|
||||
|
||||
#ifndef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_STACK
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
@ -185,7 +179,7 @@ void up_dumpstate(void)
|
|||
lldbg("IRQ stack:\n");
|
||||
lldbg(" base: %08x\n", istackbase);
|
||||
lldbg(" size: %08x\n", istacksize);
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_intstack());
|
||||
#endif
|
||||
|
||||
|
@ -214,7 +208,7 @@ void up_dumpstate(void)
|
|||
lldbg("User stack:\n");
|
||||
lldbg(" base: %08x\n", ustackbase);
|
||||
lldbg(" size: %08x\n", ustacksize);
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_tcbstack(rtcb));
|
||||
#endif
|
||||
|
||||
|
@ -230,7 +224,7 @@ void up_dumpstate(void)
|
|||
lldbg("sp: %08x\n", sp);
|
||||
lldbg("stack base: %08x\n", ustackbase);
|
||||
lldbg("stack size: %08x\n", ustacksize);
|
||||
#if defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg("stack used: %08x\n", up_check_tcbstack(rtcb));
|
||||
#endif
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
|
|||
* that we can use later to test for high water marks.
|
||||
*/
|
||||
|
||||
#if (defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_STACK)) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
memset(tcb->stack_alloc_ptr, STACK_COLOR, stack_size);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@ static void up_calibratedelay(void)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if (defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)) && CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||
#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||
static inline void up_color_intstack(void)
|
||||
{
|
||||
uint8_t *ptr = (uint8_t *)&g_intstackalloc;
|
||||
|
|
|
@ -126,22 +126,14 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
|
||||
if (ttype == TCB_FLAG_TTYPE_KERNEL)
|
||||
{
|
||||
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* Use the user-space allocator if this is a task or pthread */
|
||||
|
||||
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kumm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kumm_malloc(stack_size);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
|
@ -166,7 +158,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
* water marks.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_STACK)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
memset(tcb->stack_alloc_ptr, 0xaa, stack_size);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -147,22 +147,14 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
|
||||
if (ttype == TCB_FLAG_TTYPE_KERNEL)
|
||||
{
|
||||
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* Use the user-space allocator if this is a task or pthread */
|
||||
|
||||
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kumm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kumm_malloc(stack_size);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
|
@ -187,7 +179,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
* water marks.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_STACK)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
memset(tcb->stack_alloc_ptr, 0xaa, stack_size);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -126,22 +126,14 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
|
||||
if (ttype == TCB_FLAG_TTYPE_KERNEL)
|
||||
{
|
||||
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* Use the user-space allocator if this is a task or pthread */
|
||||
|
||||
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kumm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kumm_malloc(stack_size);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
|
@ -166,7 +158,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
* water marks.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_STACK)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
memset(tcb->stack_alloc_ptr, 0xaa, stack_size);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -128,22 +128,14 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
|
||||
if (ttype == TCB_FLAG_TTYPE_KERNEL)
|
||||
{
|
||||
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* Use the user-space allocator if this is a task or pthread */
|
||||
|
||||
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kumm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kumm_malloc(stack_size);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
|
@ -168,7 +160,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
* water marks.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_STACK)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
memset(tcb->stack_alloc_ptr, 0xaa, stack_size);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -117,11 +117,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
* then create a zeroed stack to make stack dumps easier to trace.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kumm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kumm_malloc(stack_size);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
/* Was the allocation successful? */
|
||||
|
@ -145,7 +141,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
* water marks.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_STACK)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
memset(tcb->stack_alloc_ptr, 0xaa, stack_size);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -126,22 +126,14 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
|
||||
if (ttype == TCB_FLAG_TTYPE_KERNEL)
|
||||
{
|
||||
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* Use the user-space allocator if this is a task or pthread */
|
||||
|
||||
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kumm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kumm_malloc(stack_size);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
|
@ -166,7 +158,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
* water marks.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_STACK)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
memset(tcb->stack_alloc_ptr, 0xaa, stack_size);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -548,7 +548,7 @@ Configurations
|
|||
in the top level Make.degs or the code will not fit.
|
||||
|
||||
Stack space has been hand optimized using the stack coloring by enabling
|
||||
"Stack usage debug hooks" (CONFIG_DEBUG_STACK) in Build Setup-> Debug
|
||||
"Stack coloration" (CONFIG_STACK_COLORATION) in Build Setup-> Debug
|
||||
Options. I have selected values that have 8-16 bytes of headroom with
|
||||
network debugging on. If you enable more debugging and get a hard fault
|
||||
or any weirdness like commands hanging. Then the Idle, main or Interrupt
|
||||
|
|
|
@ -631,7 +631,7 @@ static ssize_t proc_stack(FAR struct proc_file_s *procfile,
|
|||
buffer += copysize;
|
||||
remaining -= copysize;
|
||||
|
||||
#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_STACK)
|
||||
#ifdef CONFIG_DEBUG_COLORATION
|
||||
if (totalsize >= buflen)
|
||||
{
|
||||
return totalsize;
|
||||
|
|
|
@ -1729,7 +1729,7 @@ void irq_dispatch(int irq, FAR void *context);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_STACK) || defined(CONFIG_STACK_COLORATION)
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
struct tcb_s;
|
||||
size_t up_check_tcbstack(FAR struct tcb_s *tcb);
|
||||
ssize_t up_check_tcbstack_remain(FAR struct tcb_s *tcb);
|
||||
|
|
|
@ -269,7 +269,6 @@ int main(int argc, char **argv, char **envp)
|
|||
printf("# undef CONFIG_DEBUG_GRAPHICS\n");
|
||||
printf("# undef CONFIG_DEBUG_GPIO\n");
|
||||
printf("# undef CONFIG_DEBUG_SPI\n");
|
||||
printf("# undef CONFIG_DEBUG_STACK\n");
|
||||
printf("# undef CONFIG_DEBUG_HEAP\n");
|
||||
printf("#endif\n\n");
|
||||
printf("/* User entry point. This is provided as a fall-back to keep compatibility\n");
|
||||
|
|
Loading…
Reference in a new issue