mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
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:
@@ -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
|
||||
****************************************************************************/
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
****************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user