From 625eef20f00fbe9bdb4995ad9dfb24b71227e954 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Fri, 23 Oct 2020 11:47:51 +0800 Subject: [PATCH] arch: Remove the special check for idle thread in up_use_stack since the idle thread don't call up_use_stack anymore Signed-off-by: Xiang Xiao --- arch/arm/src/common/arm_usestack.c | 7 ++----- arch/avr/src/avr/up_usestack.c | 5 +---- arch/avr/src/avr32/up_usestack.c | 5 +---- arch/hc/src/common/up_usestack.c | 5 +---- arch/mips/src/common/mips_usestack.c | 5 +---- arch/misoc/src/lm32/lm32_usestack.c | 5 +---- arch/misoc/src/minerva/minerva_usestack.c | 5 +---- arch/or1k/src/common/up_usestack.c | 5 +---- arch/renesas/src/common/up_usestack.c | 5 +---- arch/risc-v/src/common/riscv_usestack.c | 9 +++------ arch/sim/src/sim/up_usestack.c | 9 +++------ arch/x86/src/i486/up_usestack.c | 5 +---- arch/x86_64/src/intel64/up_usestack.c | 5 +---- arch/xtensa/src/common/xtensa_usestack.c | 9 +++------ arch/z16/src/common/z16_usestack.c | 5 +---- arch/z80/src/common/z80_usestack.c | 5 +---- 16 files changed, 23 insertions(+), 71 deletions(-) diff --git a/arch/arm/src/common/arm_usestack.c b/arch/arm/src/common/arm_usestack.c index 45e28d72db..e8f5269ffa 100644 --- a/arch/arm/src/common/arm_usestack.c +++ b/arch/arm/src/common/arm_usestack.c @@ -156,11 +156,8 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) * water marks. */ - if (tcb->pid != 0) - { - arm_stack_color((FAR void *)((uintptr_t)tcb->adj_stack_ptr - - tcb->adj_stack_size), tcb->adj_stack_size); - } + arm_stack_color((FAR void *)((uintptr_t)tcb->adj_stack_ptr - + tcb->adj_stack_size), tcb->adj_stack_size); #endif /* CONFIG_STACK_COLORATION */ return OK; diff --git a/arch/avr/src/avr/up_usestack.c b/arch/avr/src/avr/up_usestack.c index 6a4eee6a30..691f288926 100644 --- a/arch/avr/src/avr/up_usestack.c +++ b/arch/avr/src/avr/up_usestack.c @@ -111,10 +111,7 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) */ #ifdef CONFIG_STACK_COLORATION - if (tcb->pid != 0) - { - memset(tcb->stack_alloc_ptr, STACK_COLOR, stack_size); - } + memset(tcb->stack_alloc_ptr, STACK_COLOR, stack_size); #endif /* The AVR uses a push-down stack: the stack grows toward loweraddresses diff --git a/arch/avr/src/avr32/up_usestack.c b/arch/avr/src/avr32/up_usestack.c index c30163e60d..727afe2387 100644 --- a/arch/avr/src/avr32/up_usestack.c +++ b/arch/avr/src/avr32/up_usestack.c @@ -111,10 +111,7 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) */ #ifdef CONFIG_STACK_COLORATION - if (tcb->pid != 0) - { - memset(tcb->stack_alloc_ptr, STACK_COLOR, stack_size); - } + memset(tcb->stack_alloc_ptr, STACK_COLOR, stack_size); #endif /* The AVR32 uses a push-down stack: the stack grows diff --git a/arch/hc/src/common/up_usestack.c b/arch/hc/src/common/up_usestack.c index beaf299bff..b01c93af56 100644 --- a/arch/hc/src/common/up_usestack.c +++ b/arch/hc/src/common/up_usestack.c @@ -110,10 +110,7 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) */ #ifdef CONFIG_STACK_COLORATION - if (tcb->pid != 0) - { - memset(tcb->stack_alloc_ptr, 0xaa, stack_size); - } + memset(tcb->stack_alloc_ptr, 0xaa, stack_size); #endif /* The CPU12 uses a push-down stack: the stack grows diff --git a/arch/mips/src/common/mips_usestack.c b/arch/mips/src/common/mips_usestack.c index aa7071df37..353c5e7501 100644 --- a/arch/mips/src/common/mips_usestack.c +++ b/arch/mips/src/common/mips_usestack.c @@ -131,10 +131,7 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) */ #ifdef CONFIG_STACK_COLORATION - if (tcb->pid != 0) - { - memset(tcb->stack_alloc_ptr, 0xaa, stack_size); - } + memset(tcb->stack_alloc_ptr, 0xaa, stack_size); #endif /* MIPS uses a push-down stack: the stack grows toward loweraddresses in diff --git a/arch/misoc/src/lm32/lm32_usestack.c b/arch/misoc/src/lm32/lm32_usestack.c index ee4189cff4..d1ef6a6e48 100644 --- a/arch/misoc/src/lm32/lm32_usestack.c +++ b/arch/misoc/src/lm32/lm32_usestack.c @@ -94,10 +94,7 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) */ #ifdef CONFIG_STACK_COLORATION - if (tcb->pid != 0) - { - memset(tcb->stack_alloc_ptr, 0xaa, stack_size); - } + memset(tcb->stack_alloc_ptr, 0xaa, stack_size); #endif /* The i486 uses a push-down stack: the stack grows toward loweraddresses diff --git a/arch/misoc/src/minerva/minerva_usestack.c b/arch/misoc/src/minerva/minerva_usestack.c index 782177defc..2f2662f711 100644 --- a/arch/misoc/src/minerva/minerva_usestack.c +++ b/arch/misoc/src/minerva/minerva_usestack.c @@ -94,10 +94,7 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) */ #ifdef CONFIG_STACK_COLORATION - if (tcb->pid != 0) - { - memset(tcb->stack_alloc_ptr, 0xaa, stack_size); - } + memset(tcb->stack_alloc_ptr, 0xaa, stack_size); #endif /* The i486 uses a push-down stack: the stack grows toward loweraddresses diff --git a/arch/or1k/src/common/up_usestack.c b/arch/or1k/src/common/up_usestack.c index 782177defc..2f2662f711 100644 --- a/arch/or1k/src/common/up_usestack.c +++ b/arch/or1k/src/common/up_usestack.c @@ -94,10 +94,7 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) */ #ifdef CONFIG_STACK_COLORATION - if (tcb->pid != 0) - { - memset(tcb->stack_alloc_ptr, 0xaa, stack_size); - } + memset(tcb->stack_alloc_ptr, 0xaa, stack_size); #endif /* The i486 uses a push-down stack: the stack grows toward loweraddresses diff --git a/arch/renesas/src/common/up_usestack.c b/arch/renesas/src/common/up_usestack.c index 68b9d52b8c..4420a0e002 100644 --- a/arch/renesas/src/common/up_usestack.c +++ b/arch/renesas/src/common/up_usestack.c @@ -96,10 +96,7 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) */ #ifdef CONFIG_STACK_COLORATION - if (tcb->pid != 0) - { - memset(tcb->stack_alloc_ptr, 0xaa, stack_size); - } + memset(tcb->stack_alloc_ptr, 0xaa, stack_size); #endif /* The SH family uses a push-down stack: the stack grows toward lower diff --git a/arch/risc-v/src/common/riscv_usestack.c b/arch/risc-v/src/common/riscv_usestack.c index 81dffd0f23..474aa322fe 100644 --- a/arch/risc-v/src/common/riscv_usestack.c +++ b/arch/risc-v/src/common/riscv_usestack.c @@ -157,12 +157,9 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) * water marks. */ - if (tcb->pid != 0) - { - up_stack_color((FAR void *)((uintptr_t)tcb->stack_alloc_ptr + - sizeof(struct tls_info_s)), - size_of_stack - sizeof(struct tls_info_s)); - } + up_stack_color((FAR void *)((uintptr_t)tcb->stack_alloc_ptr + + sizeof(struct tls_info_s)), + size_of_stack - sizeof(struct tls_info_s)); #endif return OK; diff --git a/arch/sim/src/sim/up_usestack.c b/arch/sim/src/sim/up_usestack.c index b6e84802d6..5d9a884ccf 100644 --- a/arch/sim/src/sim/up_usestack.c +++ b/arch/sim/src/sim/up_usestack.c @@ -136,12 +136,9 @@ int up_use_stack(FAR struct tcb_s *tcb, FAR void *stack, size_t stack_size) * water marks. */ - if (tcb->pid != 0) - { - up_stack_color((FAR void *)((uintptr_t)tcb->stack_alloc_ptr + - sizeof(struct tls_info_s)), - adj_stack_size - sizeof(struct tls_info_s)); - } + up_stack_color((FAR void *)((uintptr_t)tcb->stack_alloc_ptr + + sizeof(struct tls_info_s)), + adj_stack_size - sizeof(struct tls_info_s)); #endif return OK; diff --git a/arch/x86/src/i486/up_usestack.c b/arch/x86/src/i486/up_usestack.c index 89760e8155..7be16614ea 100644 --- a/arch/x86/src/i486/up_usestack.c +++ b/arch/x86/src/i486/up_usestack.c @@ -111,10 +111,7 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) */ #ifdef CONFIG_STACK_COLORATION - if (tcb->pid != 0) - { - memset(tcb->stack_alloc_ptr, 0xaa, stack_size); - } + memset(tcb->stack_alloc_ptr, 0xaa, stack_size); #endif /* The i486 uses a push-down stack: the stack grows toward loweraddresses diff --git a/arch/x86_64/src/intel64/up_usestack.c b/arch/x86_64/src/intel64/up_usestack.c index eb5d72771a..b4c37e3de2 100644 --- a/arch/x86_64/src/intel64/up_usestack.c +++ b/arch/x86_64/src/intel64/up_usestack.c @@ -96,10 +96,7 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) */ #ifdef CONFIG_STACK_COLORATION - if (tcb->pid != 0) - { - memset(tcb->stack_alloc_ptr, 0xaa, stack_size); - } + memset(tcb->stack_alloc_ptr, 0xaa, stack_size); #endif /* The intel64 uses a push-down stack: the stack grows toward lower diff --git a/arch/xtensa/src/common/xtensa_usestack.c b/arch/xtensa/src/common/xtensa_usestack.c index 7330b55e0a..c5dda5cc56 100644 --- a/arch/xtensa/src/common/xtensa_usestack.c +++ b/arch/xtensa/src/common/xtensa_usestack.c @@ -150,12 +150,9 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) * water marks. */ - if (tcb->pid != 0) - { - up_stack_color((FAR void *)((uintptr_t)tcb->stack_alloc_ptr + - sizeof(struct tls_info_s)), - size_of_stack - sizeof(struct tls_info_s)); - } + up_stack_color((FAR void *)((uintptr_t)tcb->stack_alloc_ptr + + sizeof(struct tls_info_s)), + size_of_stack - sizeof(struct tls_info_s)); #endif return OK; diff --git a/arch/z16/src/common/z16_usestack.c b/arch/z16/src/common/z16_usestack.c index 3c5612537c..f6fbe275ac 100644 --- a/arch/z16/src/common/z16_usestack.c +++ b/arch/z16/src/common/z16_usestack.c @@ -96,10 +96,7 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) */ #ifdef CONFIG_STACK_COLORATION - if (tcb->pid != 0) - { - memset(tcb->stack_alloc_ptr, 0xaa, stack_size); - } + memset(tcb->stack_alloc_ptr, 0xaa, stack_size); #endif /* The ZNEO uses a push-down stack: the stack grows toward lower diff --git a/arch/z80/src/common/z80_usestack.c b/arch/z80/src/common/z80_usestack.c index a3fb4eba3d..b224247140 100644 --- a/arch/z80/src/common/z80_usestack.c +++ b/arch/z80/src/common/z80_usestack.c @@ -95,10 +95,7 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) */ #ifdef CONFIG_STACK_COLORATION - if (tcb->pid != 0) - { - memset(tcb->stack_alloc_ptr, 0xaa, stack_size); - } + memset(tcb->stack_alloc_ptr, 0xaa, stack_size); #endif /* The Z80 uses a push-down stack: the stack grows toward lower