ARM: Set EABI stack alignment for all ARM architectures (remove OABI code)

This commit is contained in:
David Cabecinhas
2017-03-16 19:58:50 +08:00
parent 08e92abb0b
commit 4b65817e99
4 changed files with 18 additions and 62 deletions
+6 -17
View File
@@ -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);
+3 -14
View File
@@ -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 */
+6 -17
View File
@@ -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);
+3 -14
View File
@@ -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