From d6d5f19e21d98c0607ff029e4e2e508d4cdd1d5a Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Sun, 12 May 2019 20:28:25 -0700 Subject: xtensa: abstract 'entry' and 'retw' in assembly code Provide abi_entry, abi_entry_default, abi_ret and abi_ret_default macros that allocate aligned stack frame in windowed and call0 ABIs. Provide XTENSA_SPILL_STACK_RESERVE macro that specifies required stack frame size when register spilling is involved. Replace all uses of 'entry' and 'retw' with the above macros. This makes most of the xtensa assembly code ready for XEA3 and call0 ABI. Signed-off-by: Max Filippov --- arch/xtensa/lib/strncpy_user.S | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'arch/xtensa/lib/strncpy_user.S') diff --git a/arch/xtensa/lib/strncpy_user.S b/arch/xtensa/lib/strncpy_user.S index c4c6c8578d59..4faf46fe3f38 100644 --- a/arch/xtensa/lib/strncpy_user.S +++ b/arch/xtensa/lib/strncpy_user.S @@ -50,7 +50,7 @@ .text ENTRY(__strncpy_user) - entry sp, 16 # minimal stack frame + abi_entry_default # a2/ dst, a3/ src, a4/ len mov a11, a2 # leave dst in return value register beqz a4, .Lret # if len is zero @@ -93,7 +93,7 @@ EX(10f) s8i a9, a11, 0 # store byte 0 bnez a4, .Lsrcaligned # if len is nonzero .Lret: sub a2, a11, a2 # compute strlen - retw + abi_ret_default /* * dst is word-aligned, src is word-aligned @@ -148,14 +148,14 @@ EX(10f) s8i a9, a11, 0 .Lz3: # byte 3 is zero addi a11, a11, 3 # advance dst pointer sub a2, a11, a2 # compute strlen - retw + abi_ret_default .Lz0: # byte 0 is zero #ifdef __XTENSA_EB__ movi a9, 0 #endif /* __XTENSA_EB__ */ EX(10f) s8i a9, a11, 0 sub a2, a11, a2 # compute strlen - retw + abi_ret_default .Lz1: # byte 1 is zero #ifdef __XTENSA_EB__ extui a9, a9, 16, 16 @@ -163,7 +163,7 @@ EX(10f) s8i a9, a11, 0 EX(10f) s16i a9, a11, 0 addi a11, a11, 1 # advance dst pointer sub a2, a11, a2 # compute strlen - retw + abi_ret_default .Lz2: # byte 2 is zero #ifdef __XTENSA_EB__ extui a9, a9, 16, 16 @@ -173,7 +173,7 @@ EX(10f) s16i a9, a11, 0 EX(10f) s8i a9, a11, 2 addi a11, a11, 2 # advance dst pointer sub a2, a11, a2 # compute strlen - retw + abi_ret_default .align 4 # 1 mod 4 alignment for LOOPNEZ .byte 0 # (0 mod 4 alignment for LBEG) @@ -199,7 +199,7 @@ EX(10f) s8i a9, a11, 0 .Lunalignedend: sub a2, a11, a2 # compute strlen - retw + abi_ret_default ENDPROC(__strncpy_user) @@ -214,4 +214,4 @@ ENDPROC(__strncpy_user) 10: 11: movi a2, -EFAULT - retw + abi_ret_default -- cgit v1.2.3