lkml.org 
[lkml]   [2017]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/2] soc: qcom: smem: Support getting cached entries
From
Date
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

\
 
 \ /
  Last update: 2017-08-12 01:37    [W:0.034 / U:1.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site