Remove not needed stack growth direction defines
All supported platforms have descending stack (growth direction is down). To avoid confusion just remove not needed stack direction defines. If new platform with stack direction up is added is should be configured by adding Kconfig option eg STACK_GROWS_UP and CONFIG_STACK_GROWS_UP should be used in code that depends on stack growth direction. Change-Id: I786ff1ab28d8f8bad3f6d1bbe64defc0e81d1707 Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This commit is contained in:
parent
31c12f811b
commit
83e0faf19f
4 changed files with 0 additions and 24 deletions
|
@ -157,8 +157,6 @@ typedef struct firq_regs tFirqRegs;
|
||||||
|
|
||||||
/* stacks */
|
/* stacks */
|
||||||
|
|
||||||
#define STACK_GROWS_DOWN 0
|
|
||||||
#define STACK_GROWS_UP 1
|
|
||||||
#define STACK_ALIGN_SIZE 4
|
#define STACK_ALIGN_SIZE 4
|
||||||
|
|
||||||
#define STACK_ROUND_UP(x) ROUND_UP(x, STACK_ALIGN_SIZE)
|
#define STACK_ROUND_UP(x) ROUND_UP(x, STACK_ALIGN_SIZE)
|
||||||
|
|
|
@ -75,15 +75,6 @@ config STACK_ALIGN_DOUBLE_WORD
|
||||||
This is needed to conform to AAPCS, the procedure call standard for
|
This is needed to conform to AAPCS, the procedure call standard for
|
||||||
the ARM. It wastes stack space.
|
the ARM. It wastes stack space.
|
||||||
|
|
||||||
|
|
||||||
config STACK_GROWS_DOWN
|
|
||||||
bool
|
|
||||||
prompt "Stacks grow down"
|
|
||||||
default y
|
|
||||||
help
|
|
||||||
Stacks can grow either up or down. Down is the default. Don't change
|
|
||||||
this unless you have a very good reason to do so.
|
|
||||||
|
|
||||||
config NUM_IRQ_PRIO_BITS
|
config NUM_IRQ_PRIO_BITS
|
||||||
int
|
int
|
||||||
#hidden option, implemented by platform
|
#hidden option, implemented by platform
|
||||||
|
|
|
@ -41,12 +41,6 @@ Stack helper functions.
|
||||||
#include <nano_private.h>
|
#include <nano_private.h>
|
||||||
#include <asm_inline.h>
|
#include <asm_inline.h>
|
||||||
|
|
||||||
#ifdef CONFIG_STACK_GROWS_DOWN
|
|
||||||
#define STACK_DIR STACK_GROWS_DOWN
|
|
||||||
#else
|
|
||||||
#define STACK_DIR STACK_GROWS_UP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_STACK_ALIGN_DOUBLE_WORD
|
#ifdef CONFIG_STACK_ALIGN_DOUBLE_WORD
|
||||||
#define STACK_ALIGN_SIZE 8
|
#define STACK_ALIGN_SIZE 8
|
||||||
#else
|
#else
|
||||||
|
@ -59,12 +53,8 @@ Stack helper functions.
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if (STACK_DIR == STACK_GROWS_DOWN)
|
|
||||||
#define __GET_MSP() \
|
#define __GET_MSP() \
|
||||||
STACK_ROUND_DOWN(&_interrupt_stack[CONFIG_ISR_STACK_SIZE - 1])
|
STACK_ROUND_DOWN(&_interrupt_stack[CONFIG_ISR_STACK_SIZE - 1])
|
||||||
#else
|
|
||||||
#define __GET_MSP() STACK_ROUND_UP(&_interrupt_stack[0])
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern char _interrupt_stack[CONFIG_ISR_STACK_SIZE];
|
extern char _interrupt_stack[CONFIG_ISR_STACK_SIZE];
|
||||||
|
|
||||||
|
|
|
@ -114,9 +114,6 @@ typedef struct preempt tPreempt;
|
||||||
|
|
||||||
/* stacks */
|
/* stacks */
|
||||||
|
|
||||||
#define STACK_GROWS_DOWN 0
|
|
||||||
#define STACK_GROWS_UP 1
|
|
||||||
|
|
||||||
#define STACK_ROUND_UP(x) ROUND_UP(x, STACK_ALIGN_SIZE)
|
#define STACK_ROUND_UP(x) ROUND_UP(x, STACK_ALIGN_SIZE)
|
||||||
#define STACK_ROUND_DOWN(x) ROUND_DOWN(x, STACK_ALIGN_SIZE)
|
#define STACK_ROUND_DOWN(x) ROUND_DOWN(x, STACK_ALIGN_SIZE)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue