Skip to content

Commit e94dc6b

Browse files
committed
xtensa: merge stack alignment definitions
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 <jcmvbkbc@gmail.com>
1 parent e85d29b commit e94dc6b

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

arch/xtensa/include/asm/asmmacro.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,6 @@
225225
#endif
226226
.endm
227227

228-
#define XTENSA_STACK_ALIGNMENT 16
229-
230228
#if defined(__XTENSA_WINDOWED_ABI__)
231229

232230
/* Assembly instructions for windowed kernel ABI. */

arch/xtensa/include/asm/core.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,11 @@
3737
#endif
3838
#endif
3939

40+
/* Xtensa ABI requires stack alignment to be at least 16 */
41+
#if XCHAL_DATA_WIDTH > 16
42+
#define XTENSA_STACK_ALIGNMENT XCHAL_DATA_WIDTH
43+
#else
44+
#define XTENSA_STACK_ALIGNMENT 16
45+
#endif
46+
4047
#endif

arch/xtensa/include/asm/processor.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@
1818
#include <asm/types.h>
1919
#include <asm/regs.h>
2020

21-
/* Xtensa ABI requires stack alignment to be at least 16 */
22-
23-
#define STACK_ALIGN (XCHAL_DATA_WIDTH > 16 ? XCHAL_DATA_WIDTH : 16)
24-
25-
#define ARCH_SLAB_MINALIGN STACK_ALIGN
21+
#define ARCH_SLAB_MINALIGN XTENSA_STACK_ALIGNMENT
2622

2723
/*
2824
* User space process size: 1 GB.

0 commit comments

Comments
 (0)