[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4bd2d474-ad5a-d7ea-c667-fa5a716fc115@codeaurora.org>
Date: Fri, 11 Aug 2017 16:36:44 -0700
From: Stephen Boyd <sboyd@...eaurora.org>
To: Bjorn Andersson <bjorn.andersson@...aro.org>,
Andy Gross <andy.gross@...aro.org>,
David Brown <david.brown@...aro.org>
Cc: Arun Kumar Neelakantam <aneela@...eaurora.org>,
linux-arm-msm@...r.kernel.org, linux-soc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] soc: qcom: smem: Support getting cached entries
On 08/10/2017 12:37 PM, Bjorn Andersson wrote:
> @@ -252,6 +257,14 @@ phdr_to_last_uncached_entry(struct smem_partition_header *phdr)
> return p + le32_to_cpu(phdr->offset_free_uncached);
> }
>
> +static void *phdr_to_first_cached_entry(struct smem_partition_header *phdr,
> + size_t cacheline)
> +{
> + void *p = phdr;
> +
> + return p + phdr->size - ALIGN(sizeof(*phdr), cacheline);
le32_to_cpu(phrd->size) ?
> +}
> +
> static void *phdr_to_last_cached_entry(struct smem_partition_header *phdr)
> {
> void *p = phdr;
> @@ -276,6 +289,14 @@ uncached_entry_next(struct smem_private_entry *e)
> le32_to_cpu(e->size);
> }
>
> +static struct smem_private_entry *
> +cached_entry_next(struct smem_private_entry *e, size_t cacheline)
> +{
> + void *p = e;
> +
> + return p - le32_to_cpu(e->size) - ALIGN(sizeof(*e), cacheline);
> +}
> +
> static void *uncached_entry_to_item(struct smem_private_entry *e)
> {
> void *p = e;
> @@ -283,6 +304,13 @@ static void *uncached_entry_to_item(struct smem_private_entry *e)
> return p + sizeof(*e) + le16_to_cpu(e->padding_hdr);
> }
>
> +static void *cached_entry_to_item(struct smem_private_entry *e)
> +{
> + void *p = e;
> +
> + return p - le16_to_cpu(e->size);
But it's a le32?
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
Powered by blists - more mailing lists