summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorryo <ryo@NetBSD.org>2022-06-07 04:12:10 +0000
committerryo <ryo@NetBSD.org>2022-06-07 04:12:10 +0000
commit3f08055e009ce0c4d15ee83f3743e0e3dcdf74ca (patch)
tree4686ace2d9d440d70abcec4dc7e202176b635520
parenta62ae41246a0b2141de5eb43734129dd10318c94 (diff)
use stp if possible.
-rw-r--r--sys/arch/aarch64/aarch64/cpuswitch.S13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/arch/aarch64/aarch64/cpuswitch.S b/sys/arch/aarch64/aarch64/cpuswitch.S
index 51607892881..962cda5af40 100644
--- a/sys/arch/aarch64/aarch64/cpuswitch.S
+++ b/sys/arch/aarch64/aarch64/cpuswitch.S
@@ -1,4 +1,4 @@
-/* $NetBSD: cpuswitch.S,v 1.36 2022/06/03 19:59:59 ryo Exp $ */
+/* $NetBSD: cpuswitch.S,v 1.37 2022/06/07 04:12:10 ryo Exp $ */
/*-
* Copyright (c) 2014, 2020 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
#include "opt_ddb.h"
#include "opt_kasan.h"
-RCSID("$NetBSD: cpuswitch.S,v 1.36 2022/06/03 19:59:59 ryo Exp $")
+RCSID("$NetBSD: cpuswitch.S,v 1.37 2022/06/07 04:12:10 ryo Exp $")
ARMV8_DEFINE_OPTIONS
@@ -61,8 +61,13 @@ ENTRY_NP(cpu_switchto)
stp x27, x28, [sp, #TF_X27]
stp x29, x30, [sp, #TF_X29]
#ifdef DDB
- str lr, [sp, #TF_PC] /* for backtrace */
- str xzr, [sp, #TF_SP] /* mark as switchframe */
+ /* mark as switchframe for backtrace */
+ .if TF_SP + 8 == TF_PC
+ stp xzr, lr, [sp, #TF_SP]
+ .else
+ str xzr, [sp, #TF_SP]
+ str lr, [sp, #TF_PC]
+ .endif
#endif
/*