Skip to contentSkip to conversation

xtensa: merge stack alignment definitions

PATCH New Max Filippov 1 participant 1 message Mar 19, 2022 Tensilica Xtensa port (xtensa)

lore
Share & tools
lore

Max Filippov

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 arch/xtensa/include/asm/asmmacro.h  | 2 --
 arch/xtensa/include/asm/core.h      | 7 +++++++
 arch/xtensa/include/asm/processor.h | 6 +-----
 3 files changed, 8 insertions(+), 7 deletions(-)
arch/xtensa/include/asm/asmmacro.h +0 -2
index 3190157950fa..e3474ca411ff 100644
@@ -225,8 +225,6 @@
 #endif
 	.endm
 
-#define XTENSA_STACK_ALIGNMENT		16
-
 #if defined(__XTENSA_WINDOWED_ABI__)
 
 /* Assembly instructions for windowed kernel ABI. */
arch/xtensa/include/asm/core.h +7 -0
index 9138077e567d..f856d2bcb9f3 100644
@@ -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
arch/xtensa/include/asm/processor.h +1 -5
index 37d3e9887fe7..ba62bbcea160 100644
@@ -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.
Signature · 1 line
2.30.2