mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 21:36:28 +08:00
ARM: Set EABI stack alignment for all ARM architectures (remove OABI code)
This commit is contained in:
@@ -66,22 +66,11 @@
|
|||||||
# define HAVE_KERNEL_HEAP 1
|
# define HAVE_KERNEL_HEAP 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ARM requires at least a 4-byte stack alignment. For use with EABI and
|
/* For use with EABI and floating point, the stack must be aligned to 8-byte
|
||||||
* floating point, the stack must be aligned to 8-byte addresses.
|
* addresses.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_STACK_ALIGNMENT
|
#define CONFIG_STACK_ALIGNMENT 8
|
||||||
|
|
||||||
/* The symbol __ARM_EABI__ is defined by GCC if EABI is being used. If you
|
|
||||||
* are not using GCC, make sure that CONFIG_STACK_ALIGNMENT is set correctly!
|
|
||||||
*/
|
|
||||||
|
|
||||||
# ifdef __ARM_EABI__
|
|
||||||
# define CONFIG_STACK_ALIGNMENT 8
|
|
||||||
# else
|
|
||||||
# define CONFIG_STACK_ALIGNMENT 4
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Stack alignment macros */
|
/* Stack alignment macros */
|
||||||
|
|
||||||
@@ -233,9 +222,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||||||
|
|
||||||
top_of_stack = (uint32_t)tcb->stack_alloc_ptr + stack_size - 4;
|
top_of_stack = (uint32_t)tcb->stack_alloc_ptr + stack_size - 4;
|
||||||
|
|
||||||
/* The ARM stack must be aligned; 4 byte alignment for OABI and
|
/* The ARM stack must be aligned to 8-byte alignment for EABI.
|
||||||
* 8-byte alignment for EABI. If necessary top_of_stack must be
|
* If necessary top_of_stack must be rounded down to the next
|
||||||
* rounded down to the next boundary
|
* boundary
|
||||||
*/
|
*/
|
||||||
|
|
||||||
top_of_stack = STACK_ALIGN_DOWN(top_of_stack);
|
top_of_stack = STACK_ALIGN_DOWN(top_of_stack);
|
||||||
|
|||||||
@@ -53,22 +53,11 @@
|
|||||||
* Pre-processor Macros
|
* Pre-processor Macros
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* ARM requires at least a 4-byte stack alignment. For use with EABI and
|
/* For use with EABI and floating point, the stack must be aligned to 8-byte
|
||||||
* floating point, the stack must be aligned to 8-byte addresses.
|
* addresses.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_STACK_ALIGNMENT
|
#define CONFIG_STACK_ALIGNMENT 8
|
||||||
|
|
||||||
/* The symbol __ARM_EABI__ is defined by GCC if EABI is being used. If you
|
|
||||||
* are not using GCC, make sure that CONFIG_STACK_ALIGNMENT is set correctly!
|
|
||||||
*/
|
|
||||||
|
|
||||||
# ifdef __ARM_EABI__
|
|
||||||
# define CONFIG_STACK_ALIGNMENT 8
|
|
||||||
# else
|
|
||||||
# define CONFIG_STACK_ALIGNMENT 4
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Stack alignment macros */
|
/* Stack alignment macros */
|
||||||
|
|
||||||
|
|||||||
@@ -56,22 +56,11 @@
|
|||||||
* Pre-processor Macros
|
* Pre-processor Macros
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* ARM requires at least a 4-byte stack alignment. For use with EABI and
|
/* For use with EABI and floating point, the stack must be aligned to 8-byte
|
||||||
* floating point, the stack must be aligned to 8-byte addresses.
|
* addresses.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_STACK_ALIGNMENT
|
#define CONFIG_STACK_ALIGNMENT 8
|
||||||
|
|
||||||
/* The symbol __ARM_EABI__ is defined by GCC if EABI is being used. If you
|
|
||||||
* are not using GCC, make sure that CONFIG_STACK_ALIGNMENT is set correctly!
|
|
||||||
*/
|
|
||||||
|
|
||||||
# ifdef __ARM_EABI__
|
|
||||||
# define CONFIG_STACK_ALIGNMENT 8
|
|
||||||
# else
|
|
||||||
# define CONFIG_STACK_ALIGNMENT 4
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Stack alignment macros */
|
/* Stack alignment macros */
|
||||||
|
|
||||||
@@ -143,9 +132,9 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
|
|||||||
|
|
||||||
top_of_stack = (uint32_t)tcb->stack_alloc_ptr + stack_size - 4;
|
top_of_stack = (uint32_t)tcb->stack_alloc_ptr + stack_size - 4;
|
||||||
|
|
||||||
/* The ARM stack must be aligned; 4 byte alignment for OABI and 8-byte
|
/* The ARM stack must be aligned to 8-byte alignment for EABI.
|
||||||
* alignment for EABI. If necessary top_of_stack must be rounded down
|
* If necessary top_of_stack must be rounded down to the next
|
||||||
* to the next boundary
|
* boundary
|
||||||
*/
|
*/
|
||||||
|
|
||||||
top_of_stack = STACK_ALIGN_DOWN(top_of_stack);
|
top_of_stack = STACK_ALIGN_DOWN(top_of_stack);
|
||||||
|
|||||||
@@ -56,22 +56,11 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* ARM requires at least a 4-byte stack alignment. For use with EABI and
|
/* For use with EABI and floating point, the stack must be aligned to 8-byte
|
||||||
* floating point, the stack must be aligned to 8-byte addresses.
|
* addresses.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_STACK_ALIGNMENT
|
#define CONFIG_STACK_ALIGNMENT 8
|
||||||
|
|
||||||
/* The symbol __ARM_EABI__ is defined by GCC if EABI is being used. If you
|
|
||||||
* are not using GCC, make sure that CONFIG_STACK_ALIGNMENT is set correctly!
|
|
||||||
*/
|
|
||||||
|
|
||||||
# ifdef __ARM_EABI__
|
|
||||||
# define CONFIG_STACK_ALIGNMENT 8
|
|
||||||
# else
|
|
||||||
# define CONFIG_STACK_ALIGNMENT 4
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
|
|||||||
Reference in New Issue
Block a user