Skip to content

Commit

Permalink
xtensa: merge stack alignment definitions
Browse files Browse the repository at this point in the history
xtensa currently has two different definitions for stack alignment.
Replace it with single definition usable in both C and assembly.

Signed-off-by: Max Filippov <[email protected]>
  • Loading branch information
jcmvbkbc committed Mar 19, 2022
1 parent e85d29b commit e94dc6b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 0 additions & 2 deletions arch/xtensa/include/asm/asmmacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,6 @@
#endif
.endm

#define XTENSA_STACK_ALIGNMENT 16

#if defined(__XTENSA_WINDOWED_ABI__)

/* Assembly instructions for windowed kernel ABI. */
Expand Down
7 changes: 7 additions & 0 deletions arch/xtensa/include/asm/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,11 @@
#endif
#endif

/* Xtensa ABI requires stack alignment to be at least 16 */
#if XCHAL_DATA_WIDTH > 16
#define XTENSA_STACK_ALIGNMENT XCHAL_DATA_WIDTH
#else
#define XTENSA_STACK_ALIGNMENT 16
#endif

#endif
6 changes: 1 addition & 5 deletions arch/xtensa/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@
#include <asm/types.h>
#include <asm/regs.h>

/* Xtensa ABI requires stack alignment to be at least 16 */

#define STACK_ALIGN (XCHAL_DATA_WIDTH > 16 ? XCHAL_DATA_WIDTH : 16)

#define ARCH_SLAB_MINALIGN STACK_ALIGN
#define ARCH_SLAB_MINALIGN XTENSA_STACK_ALIGNMENT

/*
* User space process size: 1 GB.
Expand Down

0 comments on commit e94dc6b

Please sign in to comment.