Re: [PATCH 2/2] soc: qcom: smem: Support getting cached entries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux