lkml.org 
[lkml]   [2012]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFCv2 09/11] remoteproc: Add operation to find resource table in memory
Hi Sjur,

On Fri, Dec 14, 2012 at 05:06:58PM +0100, Sjur Brændeland wrote:
> Add function find_rsc_table_va to firmware ops. This function
> returns the location of the resource table in shared memory
> after loading.
>
> Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
> ---
> drivers/remoteproc/remoteproc_elf_loader.c | 16 ++++++++++-
> drivers/remoteproc/remoteproc_internal.h | 13 ++++++++
> drivers/remoteproc/ste_modem_rproc.c | 43 +++++++++++++++++++---------
> 3 files changed, 57 insertions(+), 15 deletions(-)

Perhaps split this patch into two - one that adds the new firmware op
and another that modifies the ste driver?

>
> diff --git a/drivers/remoteproc/remoteproc_elf_loader.c b/drivers/remoteproc/remoteproc_elf_loader.c
> index 69832d9..3f6e315 100644
> --- a/drivers/remoteproc/remoteproc_elf_loader.c
> +++ b/drivers/remoteproc/remoteproc_elf_loader.c
> @@ -306,9 +306,23 @@ rproc_elf_find_rsc_table(struct rproc *rproc, const struct firmware *fw,
> return table;
> }
>
> +struct resource_table *rproc_elf_get_rsctab_addr(struct rproc *rproc,
> + const struct firmware *fw)
> +{
> + struct elf32_shdr *shdr;
> +
> + shdr = find_rsc_shdr(&rproc->dev, (struct elf32_hdr *)fw->data);
> + if (!shdr)
> + return NULL;

Instead of traversing the headers twice, perhaps we could save the
address and size in advance and use it here?

Thanks,
Ido.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-12-21 04:01    [W:0.170 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site