From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: fu.wei@linaro.org, grub-devel@gnu.org, arvidjaar@gmail.com
Cc: xen-devel@lists.xensource.com, Ian.Campbell@citrix.com,
stefano.stabellini@eu.citrix.com, jcm@redhat.com,
leif.lindholm@linaro.org, ryan.harkin@linaro.org,
linaro-uefi@lists.linaro.org
Subject: Re: [PATCH v3 1/4] arm64: Add and export some accessor functions for xen boot
Date: Thu, 29 Oct 2015 13:03:07 +0100 [thread overview]
Message-ID: <56320AFB.6060305@gmail.com> (raw)
In-Reply-To: <1437628583-23667-2-git-send-email-fu.wei@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 2408 bytes --]
On 23.07.2015 07:16, fu.wei@linaro.org wrote:
> From: Fu Wei <fu.wei@linaro.org>
>
> Add accessor functions of "loaded" flag in
> grub-core/loader/arm64/linux.c.
>
> Export accessor functions of "loaded" flag and
> grub_linux_get_fdt function in include/grub/arm64/linux.h.
>
> Purpose: Reuse the existing code of devicetree in linux module.
>
> Signed-off-by: Fu Wei <fu.wei@linaro.org>
> ---
> grub-core/loader/arm64/linux.c | 13 +++++++++++++
> include/grub/arm64/linux.h | 6 +++++-
> 2 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c
> index 987f5b9..cf6026e 100644
> --- a/grub-core/loader/arm64/linux.c
> +++ b/grub-core/loader/arm64/linux.c
> @@ -48,6 +48,19 @@ static grub_addr_t initrd_end;
> static void *loaded_fdt;
> static void *fdt;
>
> +/* The accessor functions for "loaded" flag */
> +int
> +grub_linux_get_loaded (void)
> +{
> + return loaded;
> +}
> +
> +void
> +grub_linux_set_loaded (int loaded_flag)
> +{
> + loaded = loaded_flag;
> +}
> +
Accessor functions are usually useless in GRUB. We have no public API to
respect. So it only adds clutter. Also "loaded" flag is static for а
good reason: it's specific to linux.c. I'm going to move fdt part to
fdt.c and have uniform interface for both linux and xen.
> static void *
> get_firmware_fdt (void)
> {
> diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h
> index 65796d9..20058f3 100644
> --- a/include/grub/arm64/linux.h
> +++ b/include/grub/arm64/linux.h
> @@ -43,10 +43,14 @@ struct grub_arm64_linux_kernel_header
> };
>
> /* Declare the functions for getting dtb and checking/booting image */
> -void *grub_linux_get_fdt (void);
> grub_err_t grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header
> *lh);
> grub_err_t grub_arm64_uefi_boot_image (grub_addr_t addr, grub_size_t size,
> char *args);
>
> +/* Export the accessor functions for gettin dtb and "loaded" flag */
> +void EXPORT_FUNC (*grub_linux_get_fdt) (void);
> +int EXPORT_FUNC (grub_linux_get_loaded) (void);
> +void EXPORT_FUNC (grub_linux_set_loaded) (int loaded_flag);
> +
EXPORT_* are necessary only for core. Not for modules.
> #endif /* ! GRUB_LINUX_CPU_HEADER */
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]
next prev parent reply other threads:[~2015-10-29 12:03 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <=fu.wei@linaro.org>
2015-07-13 8:53 ` [PATCH v2 0/3] arm64: Add multiboot support (via fdt) for Xen boot fu.wei
2015-07-13 8:53 ` [PATCH v2 1/3] arm64: Add Xen boot support file fu.wei
2015-07-15 16:18 ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-07-16 16:46 ` Ian Campbell
2015-07-23 10:16 ` Fu Wei
2015-07-13 8:53 ` [PATCH v2 2/3] util/grub.d/20_linux_xen.in: Add arm64 support fu.wei
2015-07-14 3:53 ` Andrei Borzenkov
2015-07-14 9:41 ` Ian Campbell
2015-07-14 15:23 ` [Xen-devel] " Konrad Rzeszutek Wilk
2015-07-14 13:09 ` Fu Wei
2015-07-15 16:24 ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-07-13 8:54 ` [PATCH v2 3/3] arm64: Add the introduction of Xen boot command fu.wei
2015-07-14 9:29 ` [Xen-devel] [PATCH v2 0/3] arm64: Add multiboot support (via fdt) for Xen boot Ian Campbell
2015-07-14 11:56 ` Fu Wei
2015-07-15 15:56 ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-07-23 5:16 ` [PATCH v3 0/4] arm64: Add Xen boot support (via fdt) fu.wei
2015-07-23 5:16 ` [PATCH v3 1/4] arm64: Add and export some accessor functions for xen boot fu.wei
2015-10-29 12:03 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2015-10-30 7:11 ` Fu Wei
2015-07-23 5:16 ` [PATCH v3 2/4] arm64: Add xen_boot module file fu.wei
2015-10-29 14:27 ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-10-30 8:08 ` Fu Wei
2015-11-03 14:57 ` Fu Wei
2015-11-03 15:22 ` Ian Campbell
2015-11-05 9:46 ` Fu Wei
2015-07-23 5:16 ` [PATCH v3 3/4] * util/grub.d/20_linux_xen.in: Add support of the XEN boot on aarch64 fu.wei
2015-10-29 15:25 ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-10-29 19:53 ` Andrei Borzenkov
2015-10-30 8:44 ` Fu Wei
2015-10-30 9:50 ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-10-30 10:07 ` Andrei Borzenkov
[not found] ` <CAEaD8JOHR9QXa=ySc36a-ECF-7MUBgvaSVFw_BZxrXrvZA5u_A@mail.gmail.com>
[not found] ` <CAA91j0XKvpgVVWuv79AEv6bguxrQrV4q+eG5Xtw+UBvMSmDF-w@mail.gmail.com>
2015-11-12 10:43 ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-07-23 5:16 ` [PATCH v3 4/4] arm64: Add the introduction of xen boot commands in docs/grub.texi fu.wei
2015-08-04 8:34 ` [PATCH v3 0/4] arm64: Add Xen boot support (via fdt) Fu Wei
2015-09-08 3:38 ` Fu Wei
2015-09-30 16:00 ` Stefano Stabellini
2015-10-01 16:19 ` Stefano Stabellini
2015-10-29 2:43 ` Fu Wei
2015-10-29 6:06 ` Fu Wei
2015-10-29 11:00 ` Stefano Stabellini
2016-02-25 6:50 ` [PATCH v2 0/4] arm64,xen: add xen_boot support into grup-mkconfig fu.wei
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=56320AFB.6060305@gmail.com \
--to=phcoder@gmail.com \
--cc=Ian.Campbell@citrix.com \
--cc=arvidjaar@gmail.com \
--cc=fu.wei@linaro.org \
--cc=grub-devel@gnu.org \
--cc=jcm@redhat.com \
--cc=leif.lindholm@linaro.org \
--cc=linaro-uefi@lists.linaro.org \
--cc=ryan.harkin@linaro.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/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).