All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: robh+dt@kernel.org, gregkh@linuxfoundation.org
Cc: devicetree@vger.kernel.org, ekangupt@qti.qualcomm.com,
	bkumar@qti.qualcomm.com, linux-kernel@vger.kernel.org,
	srini@kernel.org, bjorn.andersson@linaro.org,
	linux-arm-msm@vger.kernel.org,
	Vamsi Krishna Gattupalli <quic_vgattupa@quicinc.com>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Subject: [PATCH v4 09/12] misc: fastrpc: Add helper function to get list and page
Date: Mon, 14 Feb 2022 16:09:59 +0000	[thread overview]
Message-ID: <20220214161002.6831-10-srinivas.kandagatla@linaro.org> (raw)
In-Reply-To: <20220214161002.6831-1-srinivas.kandagatla@linaro.org>

From: Vamsi Krishna Gattupalli <quic_vgattupa@quicinc.com>

Add helper functions to get invoke buffer and page start pointers.

Signed-off-by: Vamsi Krishna Gattupalli <quic_vgattupa@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/misc/fastrpc.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index eb1e6d111c77..1cec85e8eaa1 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -833,6 +833,16 @@ static int fastrpc_create_maps(struct fastrpc_invoke_ctx *ctx)
 	return 0;
 }
 
+static struct fastrpc_invoke_buf *fastrpc_invoke_buf_start(union fastrpc_remote_arg *pra, int len)
+{
+	return (struct fastrpc_invoke_buf *)(&pra[len]);
+}
+
+static struct fastrpc_phy_page *fastrpc_phy_page_start(struct fastrpc_invoke_buf *buf, int len)
+{
+	return (struct fastrpc_phy_page *)(&buf[len]);
+}
+
 static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx)
 {
 	struct device *dev = ctx->fl->sctx->dev;
@@ -860,9 +870,8 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx)
 		return err;
 
 	rpra = ctx->buf->virt;
-	list = ctx->buf->virt + ctx->nscalars * sizeof(*rpra);
-	pages = ctx->buf->virt + ctx->nscalars * (sizeof(*list) +
-		sizeof(*rpra));
+	list = fastrpc_invoke_buf_start(rpra, ctx->nscalars);
+	pages = fastrpc_phy_page_start(list, ctx->nscalars);
 	args = (uintptr_t)ctx->buf->virt + metalen;
 	rlen = pkt_size - metalen;
 	ctx->rpra = rpra;
-- 
2.21.0


  parent reply	other threads:[~2022-02-14 16:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14 16:09 [PATCH v4 00/12] misc: fastrpc: Add more DSP FastRPC features Srinivas Kandagatla
2022-02-14 16:09 ` [PATCH v4 01/12] misc: fastrpc: separate fastrpc device from channel context Srinivas Kandagatla
2022-02-14 16:09 ` [PATCH v4 02/12] misc: fastrpc: add support for FASTRPC_IOCTL_MEM_MAP/UNMAP Srinivas Kandagatla
2022-02-14 16:09 ` [PATCH v4 03/12] misc: fastrpc: Add support to get DSP capabilities Srinivas Kandagatla
2022-02-14 16:09 ` [PATCH v4 04/12] dt-bindings: misc: add property to support non-secure DSP Srinivas Kandagatla
2022-02-14 16:09 ` [PATCH v4 05/12] misc: fastrpc: add secure domain support Srinivas Kandagatla
2022-02-14 16:09 ` [PATCH v4 06/12] misc: fastrpc: check before loading process to the DSP Srinivas Kandagatla
2022-02-14 16:09 ` [PATCH v4 07/12] dt-bindings: misc: add fastrpc domain vmid property Srinivas Kandagatla
2022-02-14 16:09 ` [PATCH v4 08/12] misc: fastrpc: Add support to secure memory map Srinivas Kandagatla
2022-02-14 16:09 ` Srinivas Kandagatla [this message]
2022-02-14 16:10 ` [PATCH v4 10/12] misc: fastrpc: Add fdlist implementation Srinivas Kandagatla
2022-02-14 16:10 ` [PATCH v4 11/12] misc: fastrpc: Add dma handle implementation Srinivas Kandagatla
2022-02-14 16:10 ` [PATCH v4 12/12] arm64: dts: qcom: add non-secure domain property to fastrpc nodes Srinivas Kandagatla

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=20220214161002.6831-10-srinivas.kandagatla@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=bkumar@qti.qualcomm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=ekangupt@qti.qualcomm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_vgattupa@quicinc.com \
    --cc=robh+dt@kernel.org \
    --cc=srini@kernel.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.