All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Anisov <andrii.anisov@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Andrii Anisov <andrii_anisov@epam.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [Xen-devel] [RFC 3/7] arm64:armds: ARM Compiler 6.6 does not accept `rx` registers naming for AArch64
Date: Wed,  6 Nov 2019 11:19:09 +0200	[thread overview]
Message-ID: <1573031953-12894-4-git-send-email-andrii.anisov@gmail.com> (raw)
In-Reply-To: <1573031953-12894-1-git-send-email-andrii.anisov@gmail.com>

From: Andrii Anisov <andrii_anisov@epam.com>

So get the code duplication with `x`-es.

Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
---
 xen/include/asm-arm/smccc.h | 60 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/xen/include/asm-arm/smccc.h b/xen/include/asm-arm/smccc.h
index 126399d..3fa1144 100644
--- a/xen/include/asm-arm/smccc.h
+++ b/xen/include/asm-arm/smccc.h
@@ -120,6 +120,8 @@ struct arm_smccc_res {
 #define __constraint_read_6 __constraint_read_5, "r" (r6)
 #define __constraint_read_7 __constraint_read_6, "r" (r7)
 
+#ifdef CONFIG_ARM_32
+
 #define __declare_arg_0(a0, res)                        \
     struct arm_smccc_res    *___res = res;              \
     register unsigned long  r0 asm("r0") = (uint32_t)a0;\
@@ -174,6 +176,64 @@ struct arm_smccc_res {
     __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res);           \
     register typeof(a7) r7 asm("r7") = __a7
 
+#else /* ARM_64 */
+
+#define __declare_arg_0(a0, res)                        \
+    struct arm_smccc_res    *___res = res;              \
+    register unsigned long  r0 asm("x0") = (uint32_t)a0;\
+    register unsigned long  r1 asm("x1");               \
+    register unsigned long  r2 asm("x2");               \
+    register unsigned long  r3 asm("x3")
+
+#define __declare_arg_1(a0, a1, res)                    \
+    typeof(a1) __a1 = a1;                               \
+    struct arm_smccc_res    *___res = res;              \
+    register unsigned long  r0 asm("x0") = (uint32_t)a0;\
+    register unsigned long  r1 asm("x1") = __a1;        \
+    register unsigned long  r2 asm("x2");               \
+    register unsigned long  r3 asm("x3")
+
+#define __declare_arg_2(a0, a1, a2, res)                \
+    typeof(a1) __a1 = a1;                               \
+    typeof(a2) __a2 = a2;                               \
+    struct arm_smccc_res    *___res = res;                              \
+    register unsigned long  r0 asm("x0") = (uint32_t)a0;\
+    register unsigned long  r1 asm("x1") = __a1;        \
+    register unsigned long  r2 asm("x2") = __a2;        \
+    register unsigned long  r3 asm("x3")
+
+#define __declare_arg_3(a0, a1, a2, a3, res)            \
+    typeof(a1) __a1 = a1;                               \
+    typeof(a2) __a2 = a2;                               \
+    typeof(a3) __a3 = a3;                               \
+    struct arm_smccc_res    *___res = res;              \
+    register unsigned long  r0 asm("x0") = (uint32_t)a0;\
+    register unsigned long  r1 asm("x1") = __a1;        \
+    register unsigned long  r2 asm("x2") = __a2;        \
+    register unsigned long  r3 asm("x3") = __a3
+
+#define __declare_arg_4(a0, a1, a2, a3, a4, res)        \
+    typeof(a4) __a4 = a4;                               \
+    __declare_arg_3(a0, a1, a2, a3, res);               \
+    register unsigned long r4 asm("x4") = __a4
+
+#define __declare_arg_5(a0, a1, a2, a3, a4, a5, res)    \
+    typeof(a5) __a5 = a5;                               \
+    __declare_arg_4(a0, a1, a2, a3, a4, res);           \
+    register typeof(a5) r5 asm("x5") = __a5
+
+#define __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res)    \
+    typeof(a6) __a6 = a6;                                   \
+    __declare_arg_5(a0, a1, a2, a3, a4, a5, res);           \
+    register typeof(a6) r6 asm("x6") = __a6
+
+#define __declare_arg_7(a0, a1, a2, a3, a4, a5, a6, a7, res)    \
+    typeof(a7) __a7 = a7;                                       \
+    __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res);           \
+    register typeof(a7) r7 asm("x7") = __a7
+
+#endif
+
 #define ___declare_args(count, ...) __declare_arg_ ## count(__VA_ARGS__)
 #define __declare_args(count, ...)  ___declare_args(count, __VA_ARGS__)
 
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-11-06  9:20 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06  9:19 [Xen-devel] [RFC 0/7] Build XEN with ARM Compiler 6.6.3 Andrii Anisov
2019-11-06  9:19 ` [Xen-devel] [RFC 1/7] xen: clang: Support correctly cross-compile Andrii Anisov
2019-11-06 11:07   ` Wei Liu
2019-11-06 15:24   ` Jan Beulich
2019-11-18  6:08   ` Julien Grall
2019-11-06  9:19 ` [Xen-devel] [RFC 2/7] WIP: Compilation with ARM DS-6 compiler Andrii Anisov
2019-11-06 15:28   ` Jan Beulich
2019-11-06 22:08     ` Artem Mygaiev
2019-11-07  7:31       ` Jan Beulich
2019-11-13 17:15         ` Artem Mygaiev
2019-11-13 23:19           ` Julien Grall
2019-11-14 14:12             ` Artem Mygaiev
2019-11-18  6:18               ` Julien Grall
2019-11-19 15:16                 ` Artem Mygaiev
2019-11-19 16:13                   ` Julien Grall
2019-11-06  9:19 ` Andrii Anisov [this message]
2019-11-06 15:32   ` [Xen-devel] [RFC 3/7] arm64:armds: ARM Compiler 6.6 does not accept `rx` registers naming for AArch64 Jan Beulich
2019-11-11 20:49     ` Stefano Stabellini
2019-11-13  5:56   ` Julien Grall
2019-11-06  9:19 ` [Xen-devel] [RFC 4/7] arm/gic: Drop pointless assertions Andrii Anisov
2019-11-11 20:52   ` Stefano Stabellini
2019-11-13  1:14     ` Julien Grall
2019-11-20 22:15       ` Stefano Stabellini
2019-11-06  9:19 ` [Xen-devel] [RFC 5/7] WIP:arm64:armds: Build XEN with ARM Compiler 6.6 Andrii Anisov
2019-11-11 21:26   ` Stefano Stabellini
2019-11-13  5:50     ` Julien Grall
2019-11-14 11:31       ` Andrii Anisov
2019-11-18  7:03         ` Julien Grall
2019-11-14 11:14     ` Andrii Anisov
2019-11-20 22:56       ` Stefano Stabellini
2019-11-06  9:19 ` [Xen-devel] [RFC 6/7] arm: Introduce dummy empty functions for data only C files Andrii Anisov
2019-11-11 20:57   ` Stefano Stabellini
2019-11-13 16:41     ` Andrii Anisov
2019-11-13 23:03     ` Julien Grall
2019-11-14 13:32       ` Artem Mygaiev
2019-11-20 22:20         ` Stefano Stabellini
2019-11-13  5:51   ` Julien Grall
2019-11-13 17:07     ` Andrii Anisov
2019-11-06  9:19 ` [Xen-devel] [RFC 7/7] arm/gic-v3: add GIC version suffix to iomem range variables Andrii Anisov
2019-11-11 20:59   ` Stefano Stabellini
2019-11-13  1:25     ` Julien Grall
2019-11-14  8:35     ` Andrii Anisov
2019-11-20 22:23       ` Stefano Stabellini
2019-11-21  9:05         ` Andrii Anisov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1573031953-12894-4-git-send-email-andrii.anisov@gmail.com \
    --to=andrii.anisov@gmail.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrii_anisov@epam.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.