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 3190157950fae323b1441bb57109d525670625ef..e3474ca411ff29959f180c0104039a847c0db0cc 100644 (file)
 #endif
        .endm
 
-#define XTENSA_STACK_ALIGNMENT         16
-
 #if defined(__XTENSA_WINDOWED_ABI__)
 
 /* Assembly instructions for windowed kernel ABI. */
index 9138077e567ddc333b07f3266a01ad64e903e570..f856d2bcb9f3618d9b8025b438590f5bed687f76 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 37d3e9887fe7b8e3af67076160048529005d73a7..ba62bbcea160e1891267bddb9f1deae6c56122c9 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.