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/usercopy.S | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'arch/xtensa/lib/usercopy.S') diff --git a/arch/xtensa/lib/usercopy.S b/arch/xtensa/lib/usercopy.S index 228607e30bc2..a0aa4047f94a 100644 --- a/arch/xtensa/lib/usercopy.S +++ b/arch/xtensa/lib/usercopy.S @@ -60,7 +60,7 @@ .text ENTRY(__xtensa_copy_user) - entry sp, 16 # minimal stack frame + abi_entry_default # a2/ dst, a3/ src, a4/ len mov a5, a2 # copy dst so that a2 is return value mov a11, a4 # preserve original len for error case @@ -75,7 +75,7 @@ ENTRY(__xtensa_copy_user) __ssa8 a3 # set shift amount from byte offset bnez a4, .Lsrcunaligned movi a2, 0 # return success for len==0 - retw + abi_ret_default /* * Destination is unaligned @@ -127,7 +127,7 @@ EX(10f) s8i a6, a5, 0 #endif /* !XCHAL_HAVE_LOOPS */ .Lbytecopydone: movi a2, 0 # return success for len bytes copied - retw + abi_ret_default /* * Destination and source are word-aligned. @@ -187,7 +187,7 @@ EX(10f) l8ui a6, a3, 0 EX(10f) s8i a6, a5, 0 .L5: movi a2, 0 # return success for len bytes copied - retw + abi_ret_default /* * Destination is aligned, Source is unaligned @@ -264,7 +264,7 @@ EX(10f) l8ui a6, a3, 0 EX(10f) s8i a6, a5, 0 .L15: movi a2, 0 # return success for len bytes copied - retw + abi_ret_default ENDPROC(__xtensa_copy_user) @@ -281,4 +281,4 @@ ENDPROC(__xtensa_copy_user) 10: sub a2, a5, a2 /* a2 <-- bytes copied */ sub a2, a11, a2 /* a2 <-- bytes not copied */ - retw + abi_ret_default -- cgit v1.2.3