xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Roy Franz <roy.franz@linaro.org>,
	xen-devel@lists.xen.org, ian.campbell@citrix.com,
	stefano.stabellini@citrix.com, tim@xen.org, jbeulich@suse.com,
	keir@xen.org
Cc: fu.wei@linaro.org
Subject: Re: [PATCH for-4.5 V6 14/14] Add ARM EFI boot support
Date: Wed, 24 Sep 2014 17:11:40 +0100	[thread overview]
Message-ID: <5422ED3C.3090608@linaro.org> (raw)
In-Reply-To: <1411534992-27443-15-git-send-email-roy.franz@linaro.org>

Hi Roy,

On 09/24/2014 06:03 AM, Roy Franz wrote:
> +static int __init fdt_set_reg(void *fdt, int node, int addr_cells,
> +                              int size_cells, uint64_t addr, uint64_t len)
> +{
> +    uint8_t data[16]; /* at most 2 64 bit words */
> +    void *p = data;
> +
> +    /* Make sure that the values provided can be represented in
> +     * the reg property.
> +     */
> +    if ( addr_cells == 1 && (addr >> 32) )
> +        return -1;
> +    if ( size_cells == 1 && (len >> 32) )
> +        return -1;
> +
> +    if ( addr_cells == 1 )
> +    {
> +        *(uint32_t *)p = cpu_to_fdt32(addr);
> +        p += sizeof(uint32_t);
> +    }
> +    else if ( addr_cells == 2 )
> +    {
> +        *(uint64_t *)p = cpu_to_fdt64(addr);
> +        p += sizeof(uint64_t);
> +    }
> +    else
> +        return -1;
> +
> +    if ( size_cells == 1 )
> +    {
> +        *(uint32_t *)p = cpu_to_fdt32(len);
> +        p += sizeof(uint32_t);
> +    }
> +    else if ( size_cells == 2 )
> +    {
> +        *(uint64_t *)p = cpu_to_fdt64(len);
> +        p += sizeof(uint64_t);
> +    }
> +    else
> +        return -1;

You could give a look to dt_set_cell (xen/common/device_tree.c). I think
it will fit to your usage and avoid open coding size in this function.

> diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
> index 166852d..ac9deae 100644
> --- a/xen/common/efi/runtime.c
> +++ b/xen/common/efi/runtime.c
> @@ -4,17 +4,21 @@
>  #include <xen/guest_access.h>
>  #include <xen/irq.h>
>  #include <xen/time.h>
> -#include <asm/mc146818rtc.h>

NIT: Missing a blank line here.

Regards,

-- 
Julien Grall

  reply	other threads:[~2014-09-24 16:11 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-24  5:02 [PATCH for-4.5 V6 00/14] arm64 EFI stub Roy Franz
2014-09-24  5:02 ` [PATCH for-4.5 V6 01/14] move x86 EFI boot/runtime code to common/efi Roy Franz
2014-09-24 15:50   ` Jan Beulich
2014-09-24 19:41     ` Roy Franz
2014-09-24  5:03 ` [PATCH for-4.5 V6 02/14] Move x86 specific funtions/variables to arch header Roy Franz
2014-09-24 15:56   ` Jan Beulich
2014-09-24 19:45     ` Roy Franz
2014-09-25  8:12       ` Jan Beulich
2014-09-24  5:03 ` [PATCH for-4.5 V6 03/14] create arch functions to allocate memory for and process EFI memory map Roy Franz
2014-09-24 15:57   ` Jan Beulich
2014-09-24  5:03 ` [PATCH for-4.5 V6 04/14] Add architecture functions for pre/post ExitBootServices Roy Franz
2014-09-24  5:03 ` [PATCH for-4.5 V6 05/14] Add efi_arch_cfg_file_early/late() to handle arch specific cfg file fields Roy Franz
2014-09-24  5:03 ` [PATCH for-4.5 V6 06/14] Add efi_arch_handle_cmdline() for processing commandline Roy Franz
2014-09-24  5:03 ` [PATCH for-4.5 V6 07/14] Move x86 specific disk probing code Roy Franz
2014-09-24  5:03 ` [PATCH for-4.5 V6 08/14] Create arch functions for console and video init Roy Franz
2014-09-24  5:03 ` [PATCH for-4.5 V6 09/14] Add efi_arch_memory() for arch specific memory setup Roy Franz
2014-09-24  5:03 ` [PATCH for-4.5 V6 10/14] Add arch specific module handling to read_file() Roy Franz
2014-09-24 16:02   ` Jan Beulich
2014-09-24  5:03 ` [PATCH for-4.5 V6 11/14] Add several misc. arch functions for EFI boot code Roy Franz
2014-09-24  5:03 ` [PATCH for-4.5 V6 12/14] Add efi_arch_use_config_file() function to control use of config file Roy Franz
2014-09-24  5:03 ` [PATCH for-4.5 V6 13/14] Fix freeing of uninitialized pointer Roy Franz
2014-09-24  9:07   ` Jan Beulich
2014-09-24 19:22     ` Roy Franz
2014-09-25  8:13       ` Jan Beulich
2014-09-25 15:46         ` Roy Franz
2014-09-24  5:03 ` [PATCH for-4.5 V6 14/14] Add ARM EFI boot support Roy Franz
2014-09-24 16:11   ` Julien Grall [this message]
2014-09-24 19:53     ` Roy Franz
2014-09-24  8:55 ` [PATCH for-4.5 V6 00/14] arm64 EFI stub Jan Beulich
2014-09-24 19:37   ` Roy Franz

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=5422ED3C.3090608@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=fu.wei@linaro.org \
    --cc=ian.campbell@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --cc=roy.franz@linaro.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).