summaryrefslogtreecommitdiffstats
path: root/arch/xtensa/kernel/head.S
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2021-05-01 15:32:58 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2021-10-18 22:19:35 -0700
commit0b5372570b1f3fcb35255d28e707846e613c27f2 (patch)
tree7f38b947b50ad051903ec2d251fb51f3c62bc706 /arch/xtensa/kernel/head.S
parent5cce39b6aaa02da77e071b2b0880bedfb903330f (diff)
downloadlinux-0b5372570b1f3fcb35255d28e707846e613c27f2.tar.gz
linux-0b5372570b1f3fcb35255d28e707846e613c27f2.tar.bz2
linux-0b5372570b1f3fcb35255d28e707846e613c27f2.zip
xtensa: implement call0 ABI support in assembly
Replace hardcoded register and opcode names with ABI-agnostic macros. Add register save/restore code where necessary. Conditionalize windowed only or call0 only code. Add stack initialization matching _switch_to epilogue to copy_thread. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/kernel/head.S')
-rw-r--r--arch/xtensa/kernel/head.S22
1 files changed, 12 insertions, 10 deletions
diff --git a/arch/xtensa/kernel/head.S b/arch/xtensa/kernel/head.S
index b9b81e76beea..8972d64e0b86 100644
--- a/arch/xtensa/kernel/head.S
+++ b/arch/xtensa/kernel/head.S
@@ -15,6 +15,7 @@
* Kevin Chea
*/
+#include <asm/asmmacro.h>
#include <asm/processor.h>
#include <asm/page.h>
#include <asm/cacheasm.h>
@@ -193,9 +194,10 @@ ENTRY(_startup)
movi a1, start_info
l32i a1, a1, 0
- movi a2, PS_WOE_MASK | LOCKLEVEL
- # WOE=1, INTLEVEL=LOCKLEVEL, UM=0
- wsr a2, ps # (enable reg-windows; progmode stack)
+ /* Disable interrupts. */
+ /* Enable window exceptions if kernel is built with windowed ABI. */
+ movi a2, KERNEL_PS_WOE_MASK | LOCKLEVEL
+ wsr a2, ps
rsync
#ifdef CONFIG_SMP
@@ -267,13 +269,13 @@ ENTRY(_startup)
l32i a1, a1, 0
#endif
- movi a6, 0
- xsr a6, excsave1
+ movi abi_arg0, 0
+ xsr abi_arg0, excsave1
/* init_arch kick-starts the linux kernel */
- call4 init_arch
- call4 start_kernel
+ abi_call init_arch
+ abi_call start_kernel
should_never_return:
j should_never_return
@@ -297,10 +299,10 @@ should_never_return:
s32i a3, a2, 0
memw
- movi a6, 0
- wsr a6, excsave1
+ movi abi_arg0, 0
+ wsr abi_arg0, excsave1
- call4 secondary_start_kernel
+ abi_call secondary_start_kernel
j should_never_return
#endif /* CONFIG_SMP */