xtensa: merge stack alignment definitions
authorMax Filippov <jcmvbkbc@gmail.com>
Sat, 19 Mar 2022 18:06:30 +0000 (11:06 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Sat, 19 Mar 2022 20:08:11 +0000 (13:08 -0700)
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>
arch/xtensa/include/asm/asmmacro.h
arch/xtensa/include/asm/core.h
arch/xtensa/include/asm/processor.h

index 3190157..e3474ca 100644 (file)
 #endif
        .endm
 
-#define XTENSA_STACK_ALIGNMENT         16
-
 #if defined(__XTENSA_WINDOWED_ABI__)
 
 /* Assembly instructions for windowed kernel ABI. */
index 9138077..f856d2b 100644 (file)
 #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
index 37d3e98..ba62bbc 100644 (file)
 #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.