summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-01-24 06:49:51 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-01-24 06:49:51 -0600
commit0b34d78f7f3cf30969bdf12ad24f64aaa2dd28e0 (patch)
tree6c121a2ca991c45b2f33b0ae190da802c5b0cce3
parent7b8e6ff54398eab1bc9f205ca7e9719228ef4526 (diff)
downloadpx4-nuttx-0b34d78f7f3cf30969bdf12ad24f64aaa2dd28e0.tar.gz
px4-nuttx-0b34d78f7f3cf30969bdf12ad24f64aaa2dd28e0.tar.bz2
px4-nuttx-0b34d78f7f3cf30969bdf12ad24f64aaa2dd28e0.zip
Remove CONFIG_DEBUG_STACK. Adding CONFIG_STACK_COLORATION makes this configuration option pointless
-rw-r--r--nuttx/Kconfig7
-rw-r--r--nuttx/arch/arm/src/a1x/Make.defs4
-rw-r--r--nuttx/arch/arm/src/a1x/a1x_irq.c3
-rw-r--r--nuttx/arch/arm/src/arm/up_assert.c12
-rw-r--r--nuttx/arch/arm/src/arm/up_head.S4
-rw-r--r--nuttx/arch/arm/src/arm/up_nommuhead.S4
-rw-r--r--nuttx/arch/arm/src/armv6-m/up_assert.c12
-rw-r--r--nuttx/arch/arm/src/armv7-a/arm_assert.c10
-rw-r--r--nuttx/arch/arm/src/armv7-a/arm_head.S4
-rw-r--r--nuttx/arch/arm/src/armv7-a/arm_pghead.S4
-rw-r--r--nuttx/arch/arm/src/armv7-m/up_assert.c12
-rw-r--r--nuttx/arch/arm/src/c5471/Make.defs4
-rw-r--r--nuttx/arch/arm/src/calypso/Make.defs4
-rw-r--r--nuttx/arch/arm/src/common/up_checkstack.c8
-rw-r--r--nuttx/arch/arm/src/common/up_createstack.c12
-rw-r--r--nuttx/arch/arm/src/common/up_initialize.c2
-rw-r--r--nuttx/arch/arm/src/common/up_internal.h2
-rw-r--r--nuttx/arch/arm/src/dm320/Make.defs4
-rw-r--r--nuttx/arch/arm/src/efm32/Make.defs4
-rw-r--r--nuttx/arch/arm/src/efm32/efm32_irq.c2
-rw-r--r--nuttx/arch/arm/src/efm32/efm32_start.c6
-rw-r--r--nuttx/arch/arm/src/imx/Make.defs4
-rw-r--r--nuttx/arch/arm/src/kl/Make.defs4
-rw-r--r--nuttx/arch/arm/src/lpc214x/Make.defs4
-rw-r--r--nuttx/arch/arm/src/lpc2378/Make.defs4
-rw-r--r--nuttx/arch/arm/src/lpc31xx/Make.defs4
-rw-r--r--nuttx/arch/arm/src/lpc43xx/Make.defs4
-rw-r--r--nuttx/arch/arm/src/nuc1xx/Make.defs4
-rw-r--r--nuttx/arch/arm/src/sam34/Make.defs4
-rw-r--r--nuttx/arch/arm/src/sama5/Make.defs4
-rw-r--r--nuttx/arch/arm/src/sama5/sam_irq.c2
-rw-r--r--nuttx/arch/arm/src/samd/Make.defs4
-rw-r--r--nuttx/arch/arm/src/stm32/Make.defs4
-rw-r--r--nuttx/arch/arm/src/stm32/stm32_irq.c2
-rw-r--r--nuttx/arch/arm/src/stm32/stm32_start.c7
-rw-r--r--nuttx/arch/arm/src/str71x/Make.defs4
-rw-r--r--nuttx/arch/arm/src/tiva/Make.defs4
-rw-r--r--nuttx/arch/avr/src/at90usb/Make.defs4
-rw-r--r--nuttx/arch/avr/src/atmega/Make.defs4
-rw-r--r--nuttx/arch/avr/src/avr/up_checkstack.c8
-rw-r--r--nuttx/arch/avr/src/avr/up_createstack.c6
-rw-r--r--nuttx/arch/avr/src/avr/up_dumpstate.c12
-rw-r--r--nuttx/arch/avr/src/avr/up_usestack.c2
-rw-r--r--nuttx/arch/avr/src/avr32/up_createstack.c10
-rw-r--r--nuttx/arch/avr/src/avr32/up_dumpstate.c12
-rw-r--r--nuttx/arch/avr/src/avr32/up_usestack.c2
-rw-r--r--nuttx/arch/avr/src/common/up_initialize.c2
-rw-r--r--nuttx/arch/hc/src/common/up_createstack.c10
-rw-r--r--nuttx/arch/mips/src/common/up_createstack.c10
-rw-r--r--nuttx/arch/sh/src/common/up_createstack.c10
-rw-r--r--nuttx/arch/x86/src/i486/up_createstack.c10
-rw-r--r--nuttx/arch/z16/src/common/up_createstack.c6
-rw-r--r--nuttx/arch/z80/src/common/up_createstack.c10
-rw-r--r--nuttx/configs/spark/README.txt2
-rw-r--r--nuttx/fs/procfs/fs_procfsproc.c2
-rw-r--r--nuttx/include/nuttx/arch.h2
-rw-r--r--nuttx/tools/mkconfig.c1
57 files changed, 59 insertions, 253 deletions
diff --git a/nuttx/Kconfig b/nuttx/Kconfig
index 82a3f4b73..6f895eb0f 100644
--- a/nuttx/Kconfig
+++ b/nuttx/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
diff --git a/nuttx/arch/arm/src/a1x/Make.defs b/nuttx/arch/arm/src/a1x/Make.defs
index 177b423fd..dc7a61b5a 100644
--- a/nuttx/arch/arm/src/a1x/Make.defs
+++ b/nuttx/arch/arm/src/a1x/Make.defs
@@ -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 =
diff --git a/nuttx/arch/arm/src/a1x/a1x_irq.c b/nuttx/arch/arm/src/a1x/a1x_irq.c
index 6dbee9c32..bce61765f 100644
--- a/nuttx/arch/arm/src/a1x/a1x_irq.c
+++ b/nuttx/arch/arm/src/a1x/a1x_irq.c
@@ -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),
diff --git a/nuttx/arch/arm/src/arm/up_assert.c b/nuttx/arch/arm/src/arm/up_assert.c
index 21fe668dc..c4319b934 100644
--- a/nuttx/arch/arm/src/arm/up_assert.c
+++ b/nuttx/arch/arm/src/arm/up_assert.c
@@ -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
diff --git a/nuttx/arch/arm/src/arm/up_head.S b/nuttx/arch/arm/src/arm/up_head.S
index 3f2dc57a8..b4176823f 100644
--- a/nuttx/arch/arm/src/arm/up_head.S
+++ b/nuttx/arch/arm/src/arm/up_head.S
@@ -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 */
diff --git a/nuttx/arch/arm/src/arm/up_nommuhead.S b/nuttx/arch/arm/src/arm/up_nommuhead.S
index ef5608b17..69855c0b0 100644
--- a/nuttx/arch/arm/src/arm/up_nommuhead.S
+++ b/nuttx/arch/arm/src/arm/up_nommuhead.S
@@ -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 */
diff --git a/nuttx/arch/arm/src/armv6-m/up_assert.c b/nuttx/arch/arm/src/armv6-m/up_assert.c
index a8ccbfe16..d26a43798 100644
--- a/nuttx/arch/arm/src/armv6-m/up_assert.c
+++ b/nuttx/arch/arm/src/armv6-m/up_assert.c
@@ -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
diff --git a/nuttx/arch/arm/src/armv7-a/arm_assert.c b/nuttx/arch/arm/src/armv7-a/arm_assert.c
index adcb48f46..a809f6658 100644
--- a/nuttx/arch/arm/src/armv7-a/arm_assert.c
+++ b/nuttx/arch/arm/src/armv7-a/arm_assert.c
@@ -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
diff --git a/nuttx/arch/arm/src/armv7-a/arm_head.S b/nuttx/arch/arm/src/armv7-a/arm_head.S
index 44418de0d..88b1ffee5 100644
--- a/nuttx/arch/arm/src/armv7-a/arm_head.S
+++ b/nuttx/arch/arm/src/armv7-a/arm_head.S
@@ -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
diff --git a/nuttx/arch/arm/src/armv7-a/arm_pghead.S b/nuttx/arch/arm/src/armv7-a/arm_pghead.S
index 1b4f41bf4..3f6abcb5a 100644
--- a/nuttx/arch/arm/src/armv7-a/arm_pghead.S
+++ b/nuttx/arch/arm/src/armv7-a/arm_pghead.S
@@ -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
diff --git a/nuttx/arch/arm/src/armv7-m/up_assert.c b/nuttx/arch/arm/src/armv7-m/up_assert.c
index 6b3b86d59..eb72b0573 100644
--- a/nuttx/arch/arm/src/armv7-m/up_assert.c
+++ b/nuttx/arch/arm/src/armv7-m/up_assert.c
@@ -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
diff --git a/nuttx/arch/arm/src/c5471/Make.defs b/nuttx/arch/arm/src/c5471/Make.defs
index 3e20a54a5..b1c64bed3 100644
--- a/nuttx/arch/arm/src/c5471/Make.defs
+++ b/nuttx/arch/arm/src/c5471/Make.defs
@@ -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
diff --git a/nuttx/arch/arm/src/calypso/Make.defs b/nuttx/arch/arm/src/calypso/Make.defs
index 35eb161a8..07145d053 100644
--- a/nuttx/arch/arm/src/calypso/Make.defs
+++ b/nuttx/arch/arm/src/calypso/Make.defs
@@ -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
diff --git a/nuttx/arch/arm/src/common/up_checkstack.c b/nuttx/arch/arm/src/common/up_checkstack.c
index 006ee535f..bec4d07dd 100644
--- a/nuttx/arch/arm/src/common/up_checkstack.c
+++ b/nuttx/arch/arm/src/common/up_checkstack.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 */
diff --git a/nuttx/arch/arm/src/common/up_createstack.c b/nuttx/arch/arm/src/common/up_createstack.c
index 73bf01b86..a7a49a9b7 100644
--- a/nuttx/arch/arm/src/common/up_createstack.c
+++ b/nuttx/arch/arm/src/common/up_createstack.c
@@ -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 */
diff --git a/nuttx/arch/arm/src/common/up_initialize.c b/nuttx/arch/arm/src/common/up_initialize.c
index 2ee43572f..69e1f2cf8 100644
--- a/nuttx/arch/arm/src/common/up_initialize.c
+++ b/nuttx/arch/arm/src/common/up_initialize.c
@@ -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;
diff --git a/nuttx/arch/arm/src/common/up_internal.h b/nuttx/arch/arm/src/common/up_internal.h
index be261e117..9c274dcaf 100644
--- a/nuttx/arch/arm/src/common/up_internal.h
+++ b/nuttx/arch/arm/src/common/up_internal.h
@@ -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
diff --git a/nuttx/arch/arm/src/dm320/Make.defs b/nuttx/arch/arm/src/dm320/Make.defs
index a7d1ff636..530d70bd2 100644
--- a/nuttx/arch/arm/src/dm320/Make.defs
+++ b/nuttx/arch/arm/src/dm320/Make.defs
@@ -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
diff --git a/nuttx/arch/arm/src/efm32/Make.defs b/nuttx/arch/arm/src/efm32/Make.defs
index c83f165bc..6a3ebac4a 100644
--- a/nuttx/arch/arm/src/efm32/Make.defs
+++ b/nuttx/arch/arm/src/efm32/Make.defs
@@ -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
diff --git a/nuttx/arch/arm/src/efm32/efm32_irq.c b/nuttx/arch/arm/src/efm32/efm32_irq.c
index 6ba7b13bb..3b7c386ef 100644
--- a/nuttx/arch/arm/src/efm32/efm32_irq.c
+++ b/nuttx/arch/arm/src/efm32/efm32_irq.c
@@ -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 */
{
diff --git a/nuttx/arch/arm/src/efm32/efm32_start.c b/nuttx/arch/arm/src/efm32/efm32_start.c
index be439c27d..08d0d3bf6 100644
--- a/nuttx/arch/arm/src/efm32/efm32_start.c
+++ b/nuttx/arch/arm/src/efm32/efm32_start.c
@@ -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);
diff --git a/nuttx/arch/arm/src/imx/Make.defs b/nuttx/arch/arm/src/imx/Make.defs
index 6a31844a7..46d16d414 100644
--- a/nuttx/arch/arm/src/imx/Make.defs
+++ b/nuttx/arch/arm/src/imx/Make.defs
@@ -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
diff --git a/nuttx/arch/arm/src/kl/Make.defs b/nuttx/arch/arm/src/kl/Make.defs
index 55a837769..20d5a64f5 100644
--- a/nuttx/arch/arm/src/kl/Make.defs
+++ b/nuttx/arch/arm/src/kl/Make.defs
@@ -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
diff --git a/nuttx/arch/arm/src/lpc214x/Make.defs b/nuttx/arch/arm/src/lpc214x/Make.defs
index 6d4695d50..364c2c52e 100644
--- a/nuttx/arch/arm/src/lpc214x/Make.defs
+++ b/nuttx/arch/arm/src/lpc214x/Make.defs
@@ -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
diff --git a/nuttx/arch/arm/src/lpc2378/Make.defs b/nuttx/arch/arm/src/lpc2378/Make.defs
index df38c1c3e..4df2d7eb3 100644
--- a/nuttx/arch/arm/src/lpc2378/Make.defs
+++ b/nuttx/arch/arm/src/lpc2378/Make.defs
@@ -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
diff --git a/nuttx/arch/arm/src/lpc31xx/Make.defs b/nuttx/arch/arm/src/lpc31xx/Make.defs
index 45e24630e..a8bbcb508 100644
--- a/nuttx/arch/arm/src/lpc31xx/Make.defs
+++ b/nuttx/arch/arm/src/lpc31xx/Make.defs
@@ -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
diff --git a/nuttx/arch/arm/src/lpc43xx/Make.defs b/nuttx/arch/arm/src/lpc43xx/Make.defs
index a55f1d926..1ab24e84e 100644
--- a/nuttx/arch/arm/src/lpc43xx/Make.defs
+++ b/nuttx/arch/arm/src/lpc43xx/Make.defs
@@ -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
diff --git a/nuttx/arch/arm/src/nuc1xx/Make.defs b/nuttx/arch/arm/src/nuc1xx/Make.defs
index 4ba3d6f05..753322fb3 100644
--- a/nuttx/arch/arm/src/nuc1xx/Make.defs
+++ b/nuttx/arch/arm/src/nuc1xx/Make.defs
@@ -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
diff --git a/nuttx/arch/arm/src/sam34/Make.defs b/nuttx/arch/arm/src/sam34/Make.defs
index cc439da76..cfe342e0f 100644
--- a/nuttx/arch/arm/src/sam34/Make.defs
+++ b/nuttx/arch/arm/src/sam34/Make.defs
@@ -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 =
diff --git a/nuttx/arch/arm/src/sama5/Make.defs b/nuttx/arch/arm/src/sama5/Make.defs
index dcb62de05..29265802f 100644
--- a/nuttx/arch/arm/src/sama5/Make.defs
+++ b/nuttx/arch/arm/src/sama5/Make.defs
@@ -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 =
diff --git a/nuttx/arch/arm/src/sama5/sam_irq.c b/nuttx/arch/arm/src/sama5/sam_irq.c
index 55e2046ed..8c39503ab 100644
--- a/nuttx/arch/arm/src/sama5/sam_irq.c
+++ b/nuttx/arch/arm/src/sama5/sam_irq.c
@@ -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),
diff --git a/nuttx/arch/arm/src/samd/Make.defs b/nuttx/arch/arm/src/samd/Make.defs
index 4d1340674..36fd5afbd 100644
--- a/nuttx/arch/arm/src/samd/Make.defs
+++ b/nuttx/arch/arm/src/samd/Make.defs
@@ -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
diff --git a/nuttx/arch/arm/src/stm32/Make.defs b/nuttx/arch/arm/src/stm32/Make.defs
index 8a3935190..4369d9d74 100644
--- a/nuttx/arch/arm/src/stm32/Make.defs
+++ b/nuttx/arch/arm/src/stm32/Make.defs
@@ -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
diff --git a/nuttx/arch/arm/src/stm32/stm32_irq.c b/nuttx/arch/arm/src/stm32/stm32_irq.c
index 6942ac1dd..3318caa36 100644
--- a/nuttx/arch/arm/src/stm32/stm32_irq.c
+++ b/nuttx/arch/arm/src/stm32/stm32_irq.c
@@ -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),
diff --git a/nuttx/arch/arm/src/stm32/stm32_start.c b/nuttx/arch/arm/src/stm32/stm32_start.c
index d9bc5d3b2..df155392f 100644
--- a/nuttx/arch/arm/src/stm32/stm32_start.c
+++ b/nuttx/arch/arm/src/stm32/stm32_start.c
@@ -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);
diff --git a/nuttx/arch/arm/src/str71x/Make.defs b/nuttx/arch/arm/src/str71x/Make.defs
index 41ee1144e..00ce4a362 100644
--- a/nuttx/arch/arm/src/str71x/Make.defs
+++ b/nuttx/arch/arm/src/str71x/Make.defs
@@ -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
diff --git a/nuttx/arch/arm/src/tiva/Make.defs b/nuttx/arch/arm/src/tiva/Make.defs
index 2d9773d89..fc43be234 100644
--- a/nuttx/arch/arm/src/tiva/Make.defs
+++ b/nuttx/arch/arm/src/tiva/Make.defs
@@ -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)
diff --git a/nuttx/arch/avr/src/at90usb/Make.defs b/nuttx/arch/avr/src/at90usb/Make.defs
index a7e1526ac..50245c338 100644
--- a/nuttx/arch/avr/src/at90usb/Make.defs
+++ b/nuttx/arch/avr/src/at90usb/Make.defs
@@ -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
diff --git a/nuttx/arch/avr/src/atmega/Make.defs b/nuttx/arch/avr/src/atmega/Make.defs
index e61ef3ecc..c2d679b7d 100644
--- a/nuttx/arch/avr/src/atmega/Make.defs
+++ b/nuttx/arch/avr/src/atmega/Make.defs
@@ -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
diff --git a/nuttx/arch/avr/src/avr/up_checkstack.c b/nuttx/arch/avr/src/avr/up_checkstack.c
index da7697be4..eb5f22d74 100644
--- a/nuttx/arch/avr/src/avr/up_checkstack.c
+++ b/nuttx/arch/avr/src/avr/up_checkstack.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
@@ -199,4 +195,4 @@ size_t up_check_intstack_remain(void)
}
#endif
-#endif /* CONFIG_DEBUG_STACK || CONFIG_STACK_COLORATION */
+#endif /* CONFIG_STACK_COLORATION */
diff --git a/nuttx/arch/avr/src/avr/up_createstack.c b/nuttx/arch/avr/src/avr/up_createstack.c
index ff3d26d01..0b5e4ab93 100644
--- a/nuttx/arch/avr/src/avr/up_createstack.c
+++ b/nuttx/arch/avr/src/avr/up_createstack.c
@@ -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
diff --git a/nuttx/arch/avr/src/avr/up_dumpstate.c b/nuttx/arch/avr/src/avr/up_dumpstate.c
index 1049c1fac..1f77c899a 100644
--- a/nuttx/arch/avr/src/avr/up_dumpstate.c
+++ b/nuttx/arch/avr/src/avr/up_dumpstate.c
@@ -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
diff --git a/nuttx/arch/avr/src/avr/up_usestack.c b/nuttx/arch/avr/src/avr/up_usestack.c
index 7113971a4..84817e356 100644
--- a/nuttx/arch/avr/src/avr/up_usestack.c
+++ b/nuttx/arch/avr/src/avr/up_usestack.c
@@ -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
diff --git a/nuttx/arch/avr/src/avr32/up_createstack.c b/nuttx/arch/avr/src/avr32/up_createstack.c
index be5e37e7e..2956dd451 100644
--- a/nuttx/arch/avr/src/avr32/up_createstack.c
+++ b/nuttx/arch/avr/src/avr32/up_createstack.c
@@ -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
diff --git a/nuttx/arch/avr/src/avr32/up_dumpstate.c b/nuttx/arch/avr/src/avr32/up_dumpstate.c
index 6884a037d..4bba418b8 100644
--- a/nuttx/arch/avr/src/avr32/up_dumpstate.c
+++ b/nuttx/arch/avr/src/avr32/up_dumpstate.c
@@ -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
diff --git a/nuttx/arch/avr/src/avr32/up_usestack.c b/nuttx/arch/avr/src/avr32/up_usestack.c
index 5c43c54d6..8e7f398c0 100644
--- a/nuttx/arch/avr/src/avr32/up_usestack.c
+++ b/nuttx/arch/avr/src/avr32/up_usestack.c
@@ -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
diff --git a/nuttx/arch/avr/src/common/up_initialize.c b/nuttx/arch/avr/src/common/up_initialize.c
index 92297d066..991e0a084 100644
--- a/nuttx/arch/avr/src/common/up_initialize.c
+++ b/nuttx/arch/avr/src/common/up_initialize.c
@@ -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;
diff --git a/nuttx/arch/hc/src/common/up_createstack.c b/nuttx/arch/hc/src/common/up_createstack.c
index 50c2c4626..21bbe7690 100644
--- a/nuttx/arch/hc/src/common/up_createstack.c
+++ b/nuttx/arch/hc/src/common/up_createstack.c
@@ -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
diff --git a/nuttx/arch/mips/src/common/up_createstack.c b/nuttx/arch/mips/src/common/up_createstack.c
index 36754d546..a5f4483ca 100644
--- a/nuttx/arch/mips/src/common/up_createstack.c
+++ b/nuttx/arch/mips/src/common/up_createstack.c
@@ -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
diff --git a/nuttx/arch/sh/src/common/up_createstack.c b/nuttx/arch/sh/src/common/up_createstack.c
index 52e311b76..c36dcaa76 100644
--- a/nuttx/arch/sh/src/common/up_createstack.c
+++ b/nuttx/arch/sh/src/common/up_createstack.c
@@ -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
diff --git a/nuttx/arch/x86/src/i486/up_createstack.c b/nuttx/arch/x86/src/i486/up_createstack.c
index a0731d9f7..167b4a7d5 100644
--- a/nuttx/arch/x86/src/i486/up_createstack.c
+++ b/nuttx/arch/x86/src/i486/up_createstack.c
@@ -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
diff --git a/nuttx/arch/z16/src/common/up_createstack.c b/nuttx/arch/z16/src/common/up_createstack.c
index 42df4d0c2..493078580 100644
--- a/nuttx/arch/z16/src/common/up_createstack.c
+++ b/nuttx/arch/z16/src/common/up_createstack.c
@@ -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
diff --git a/nuttx/arch/z80/src/common/up_createstack.c b/nuttx/arch/z80/src/common/up_createstack.c
index 96119a7e8..25bd615f9 100644
--- a/nuttx/arch/z80/src/common/up_createstack.c
+++ b/nuttx/arch/z80/src/common/up_createstack.c
@@ -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
diff --git a/nuttx/configs/spark/README.txt b/nuttx/configs/spark/README.txt
index 334a2edb5..67f247283 100644
--- a/nuttx/configs/spark/README.txt
+++ b/nuttx/configs/spark/README.txt
@@ -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
diff --git a/nuttx/fs/procfs/fs_procfsproc.c b/nuttx/fs/procfs/fs_procfsproc.c
index cd3976286..071ace89f 100644
--- a/nuttx/fs/procfs/fs_procfsproc.c
+++ b/nuttx/fs/procfs/fs_procfsproc.c
@@ -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;
diff --git a/nuttx/include/nuttx/arch.h b/nuttx/include/nuttx/arch.h
index 987e67dff..a703d2806 100644
--- a/nuttx/include/nuttx/arch.h
+++ b/nuttx/include/nuttx/arch.h
@@ -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);
diff --git a/nuttx/tools/mkconfig.c b/nuttx/tools/mkconfig.c
index d21930101..93dc7e314 100644
--- a/nuttx/tools/mkconfig.c
+++ b/nuttx/tools/mkconfig.c
@@ -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");