arch: Move STACK_ALIGNMENT definition to up_internal.h

to avoid the same macro duplicate to many place

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2022-02-16 00:59:06 +08:00
committed by archer
parent f42b56b1c4
commit 3bf416e8b8
59 changed files with 236 additions and 743 deletions
-16
View File
@@ -35,22 +35,6 @@
#include "up_internal.h"
/****************************************************************************
* Pre-processor Macros
****************************************************************************/
/* Use a stack alignment of 16 bytes. If necessary frame_size must be
* rounded up to the next boundary
*/
#define STACK_ALIGNMENT 16
/* Stack alignment macros */
#define STACK_ALIGN_MASK (STACK_ALIGNMENT-1)
#define STACK_ALIGN_DOWN(a) ((a) & ~STACK_ALIGN_MASK)
#define STACK_ALIGN_UP(a) (((a) + STACK_ALIGN_MASK) & ~STACK_ALIGN_MASK)
/****************************************************************************
* Public Functions
****************************************************************************/
+12
View File
@@ -55,6 +55,18 @@
# endif
#endif
/* Use a stack alignment of 16 bytes. If necessary frame_size must be
* rounded up to the next boundary
*/
#define STACK_ALIGNMENT 16
/* Stack alignment macros */
#define STACK_ALIGN_MASK (STACK_ALIGNMENT - 1)
#define STACK_ALIGN_DOWN(a) ((a) & ~STACK_ALIGN_MASK)
#define STACK_ALIGN_UP(a) (((a) + STACK_ALIGN_MASK) & ~STACK_ALIGN_MASK)
/* Simulated Heap Definitions ***********************************************/
/* Size of the simulated heap */
+2 -16
View File
@@ -32,21 +32,7 @@
#include <nuttx/arch.h>
#include <arch/irq.h>
/****************************************************************************
* Pre-processor Macros
****************************************************************************/
/* Use a stack alignment of 16 bytes. If necessary frame_size must be
* rounded up to the next boundary
*/
#define STACK_ALIGNMENT 16
/* Stack alignment macros */
#define STACK_ALIGN_MASK (STACK_ALIGNMENT-1)
#define STACK_ALIGN_DOWN(a) ((a) & ~STACK_ALIGN_MASK)
#define STACK_ALIGN_UP(a) (((a) + STACK_ALIGN_MASK) & ~STACK_ALIGN_MASK)
#include "up_internal.h"
/****************************************************************************
* Public Functions
@@ -103,7 +89,7 @@ FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
/* Save the adjusted stack values in the struct tcb_s */
tcb->stack_base_ptr = (FAR uint8_t *)tcb->stack_base_ptr + frame_size;
tcb->stack_base_ptr = (FAR uint8_t *)tcb->stack_base_ptr + frame_size;
tcb->adj_stack_size -= frame_size;
/* And return a pointer to the allocated memory */
-16
View File
@@ -34,22 +34,6 @@
#include "up_internal.h"
/****************************************************************************
* Pre-processor Macros
****************************************************************************/
/* Use a stack alignment of 16 bytes. If necessary frame_size must be
* rounded up to the next boundary
*/
#define STACK_ALIGNMENT 16
/* Stack alignment macros */
#define STACK_ALIGN_MASK (STACK_ALIGNMENT-1)
#define STACK_ALIGN_DOWN(a) ((a) & ~STACK_ALIGN_MASK)
#define STACK_ALIGN_UP(a) (((a) + STACK_ALIGN_MASK) & ~STACK_ALIGN_MASK)
/****************************************************************************
* Public Functions
****************************************************************************/