xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Michal Orzel <michal.orzel@amd.com>
Subject: [PATCH v6 8/9] xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h
Date: Mon, 19 Sep 2022 11:12:37 +0200	[thread overview]
Message-ID: <20220919091238.2068052-9-jens.wiklander@linaro.org> (raw)
In-Reply-To: <20220919091238.2068052-1-jens.wiklander@linaro.org>

Moves the two helper functions regpair_to_uint64() and
uint64_to_regpair() from xen/arch/arm/tee/optee.c to the common arm
specific regs.h. This enables reuse of these functions in the FF-A
mediator in a subsequent patch.

Reviewed-by: Michal Orzel <michal.orzel@amd.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/include/asm/regs.h | 12 ++++++++++++
 xen/arch/arm/tee/optee.c        | 11 -----------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/include/asm/regs.h b/xen/arch/arm/include/asm/regs.h
index 0693a681315f..aa39e83ee5f4 100644
--- a/xen/arch/arm/include/asm/regs.h
+++ b/xen/arch/arm/include/asm/regs.h
@@ -60,6 +60,18 @@ static inline bool guest_mode(const struct cpu_user_regs *r)
 register_t get_user_reg(struct cpu_user_regs *regs, int reg);
 void set_user_reg(struct cpu_user_regs *regs, int reg, register_t val);
 
+static inline uint64_t regpair_to_uint64(register_t reg0, register_t reg1)
+{
+    return ((uint64_t)reg0 << 32) | (uint32_t)reg1;
+}
+
+static inline void uint64_to_regpair(register_t *reg0, register_t *reg1,
+                                     uint64_t val)
+{
+    *reg0 = val >> 32;
+    *reg1 = (uint32_t)val;
+}
+
 #endif
 
 #endif /* __ARM_REGS_H__ */
diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
index 9cb9f16d43cb..47027ecef47c 100644
--- a/xen/arch/arm/tee/optee.c
+++ b/xen/arch/arm/tee/optee.c
@@ -268,17 +268,6 @@ static int optee_domain_init(struct domain *d)
     return 0;
 }
 
-static uint64_t regpair_to_uint64(register_t reg0, register_t reg1)
-{
-    return ((uint64_t)reg0 << 32) | (uint32_t)reg1;
-}
-
-static void uint64_to_regpair(register_t *reg0, register_t *reg1, uint64_t val)
-{
-    *reg0 = val >> 32;
-    *reg1 = (uint32_t)val;
-}
-
 static struct page_info *get_domain_ram_page(gfn_t gfn)
 {
     struct page_info *page;
-- 
2.31.1



  parent reply	other threads:[~2022-09-19  9:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19  9:12 [PATCH v6 0/9] Xen FF-A mediator Jens Wiklander
2022-09-19  9:12 ` [PATCH v6 1/9] xen/arm: smccc: add support for SMCCCv1.2 extended input/output registers Jens Wiklander
2022-09-19  9:12 ` [PATCH v6 2/9] xen/arm: add a primitive FF-A mediator Jens Wiklander
2022-09-19  9:12 ` [PATCH v6 3/9] xen/arm: ffa: add direct request support Jens Wiklander
2022-09-19  9:12 ` [PATCH v6 4/9] xen/arm: ffa: map SPMC rx/tx buffers Jens Wiklander
2022-09-19  9:12 ` [PATCH v6 5/9] xen/arm: ffa: send guest events to Secure Partitions Jens Wiklander
2022-09-19  9:12 ` [PATCH v6 6/9] xen/arm: ffa: support mapping guest RX/TX buffers Jens Wiklander
2022-09-19  9:12 ` [PATCH v6 7/9] xen/arm: ffa: support guest FFA_PARTITION_INFO_GET Jens Wiklander
2022-09-19  9:12 ` Jens Wiklander [this message]
2022-09-19  9:12 ` [PATCH v6 9/9] xen/arm: ffa: support sharing memory Jens Wiklander
2022-10-14 10:53 ` [PATCH v6 0/9] Xen FF-A mediator Jens Wiklander

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=20220919091238.2068052-9-jens.wiklander@linaro.org \
    --to=jens.wiklander@linaro.org \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=achin.gupta@arm.com \
    --cc=anthony.perard@citrix.com \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=marc.bonnici@arm.com \
    --cc=michal.orzel@amd.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).