From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Vladimir_'=cf=86-coder/phcoder'_Serbinenko?= 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 Message-ID: <56320AFB.6060305@gmail.com> References: <=fu.wei@linaro.org> <1437628583-23667-1-git-send-email-fu.wei@linaro.org> <1437628583-23667-2-git-send-email-fu.wei@linaro.org> Reply-To: The development of GNU GRUB Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5594589397256489929==" Return-path: In-Reply-To: <1437628583-23667-2-git-send-email-fu.wei@linaro.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: grub-devel-bounces+gcbgd-grub-devel=m.gmane.org@gnu.org Sender: grub-devel-bounces+gcbgd-grub-devel=m.gmane.org@gnu.org 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 List-Id: xen-devel@lists.xenproject.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --===============5594589397256489929== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jBgTTkdpBqkNNOfLkTLr55l6eouv1Xt1g" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --jBgTTkdpBqkNNOfLkTLr55l6eouv1Xt1g Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 23.07.2015 07:16, fu.wei@linaro.org wrote: > From: Fu Wei >=20 > Add accessor functions of "loaded" flag in > grub-core/loader/arm64/linux.c. >=20 > Export accessor functions of "loaded" flag and > grub_linux_get_fdt function in include/grub/arm64/linux.h. >=20 > Purpose: Reuse the existing code of devicetree in linux module. >=20 > Signed-off-by: Fu Wei > --- > grub-core/loader/arm64/linux.c | 13 +++++++++++++ > include/grub/arm64/linux.h | 6 +++++- > 2 files changed, 18 insertions(+), 1 deletion(-) >=20 > diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/li= nux.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; > =20 > +/* The accessor functions for "loaded" flag */ > +int > +grub_linux_get_loaded (void) > +{ > + return loaded; > +} > + > +void > +grub_linux_set_loaded (int loaded_flag) > +{ > + loaded =3D 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 =D0=B0= 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 > }; > =20 > /* 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 s= ize, > char *args); > =20 > +/* 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 */ >=20 --jBgTTkdpBqkNNOfLkTLr55l6eouv1Xt1g Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREKAAYFAlYyCwAACgkQmBXlbbo5nOtWlgD+Oh2LvR8twmMSF1zp0wAZx7os R2sDojwnZWxgAcF2AZUBAKtfx0A6dZnfBO6Tvcy/OHJzQ9QnIN/LlYGHt962Cy90 =6mTe -----END PGP SIGNATURE----- --jBgTTkdpBqkNNOfLkTLr55l6eouv1Xt1g-- --===============5594589397256489929== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel --===============5594589397256489929==-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZrlvL-0003bt-QF for mharc-grub-devel@gnu.org; Thu, 29 Oct 2015 08:03:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrlvJ-0003bl-1G for grub-devel@gnu.org; Thu, 29 Oct 2015 08:03:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZrlvI-0003Sd-2E for grub-devel@gnu.org; Thu, 29 Oct 2015 08:03:16 -0400 Received: from mail-wi0-x244.google.com ([2a00:1450:400c:c05::244]:36158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrlvH-0003SE-Si for grub-devel@gnu.org; Thu, 29 Oct 2015 08:03:15 -0400 Received: by wibvt6 with SMTP id vt6so7407967wib.3 for ; Thu, 29 Oct 2015 05:03:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type; bh=tLPwC184NjWbLszKW7fCxVNA3ZGQZ+1rmrZ92mNazzs=; b=BucYLtSgI0sOSPVAB6zZ2zOOeyOySWrc5lrSLQUxyr5tpn/9Xbs6oLEkNNP4GKaKmx HBdV3GlUjmWGzv3MKiGdwTKJO9JV3DsSFfFAallVzM15ffS4kOWWI6jN18KwwvV9TDL8 pb74mliCZvh+2rFamYzuTHUvAXg69xdx7BBwGFeioupIry8TcESphv2qiL4BdqC27E5F tUzYoY0uZTPCYzsY7P4f9/agq6+VsvKiIfzllTVSw/SOOPtoHbimXgZHJ5hklnrg5vXT heJ8xblALip1QfRnWoaH/VTYniqbgtUxdgkVRVY9xfDSYWK8JFykWI5zSTQQdTjjm9k6 fgEw== X-Received: by 10.194.190.19 with SMTP id gm19mr2025086wjc.0.1446120194820; Thu, 29 Oct 2015 05:03:14 -0700 (PDT) Received: from ?IPv6:2620:0:105f:fd00:863a:4bff:fe50:abc4? ([2620:0:105f:fd00:863a:4bff:fe50:abc4]) by smtp.gmail.com with ESMTPSA id s127sm3196415wmb.8.2015.10.29.05.03.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Oct 2015 05:03:13 -0700 (PDT) Subject: Re: [PATCH v3 1/4] arm64: Add and export some accessor functions for xen boot To: fu.wei@linaro.org, grub-devel@gnu.org, arvidjaar@gmail.com References: <=fu.wei@linaro.org> <1437628583-23667-1-git-send-email-fu.wei@linaro.org> <1437628583-23667-2-git-send-email-fu.wei@linaro.org> From: =?UTF-8?Q?Vladimir_'=cf=86-coder/phcoder'_Serbinenko?= Message-ID: <56320AFB.6060305@gmail.com> Date: Thu, 29 Oct 2015 13:03:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.3.0 MIME-Version: 1.0 In-Reply-To: <1437628583-23667-2-git-send-email-fu.wei@linaro.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jBgTTkdpBqkNNOfLkTLr55l6eouv1Xt1g" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::244 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 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Oct 2015 12:03:18 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --jBgTTkdpBqkNNOfLkTLr55l6eouv1Xt1g Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 23.07.2015 07:16, fu.wei@linaro.org wrote: > From: Fu Wei >=20 > Add accessor functions of "loaded" flag in > grub-core/loader/arm64/linux.c. >=20 > Export accessor functions of "loaded" flag and > grub_linux_get_fdt function in include/grub/arm64/linux.h. >=20 > Purpose: Reuse the existing code of devicetree in linux module. >=20 > Signed-off-by: Fu Wei > --- > grub-core/loader/arm64/linux.c | 13 +++++++++++++ > include/grub/arm64/linux.h | 6 +++++- > 2 files changed, 18 insertions(+), 1 deletion(-) >=20 > diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/li= nux.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; > =20 > +/* The accessor functions for "loaded" flag */ > +int > +grub_linux_get_loaded (void) > +{ > + return loaded; > +} > + > +void > +grub_linux_set_loaded (int loaded_flag) > +{ > + loaded =3D 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 =D0=B0= 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 > }; > =20 > /* 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 s= ize, > char *args); > =20 > +/* 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 */ >=20 --jBgTTkdpBqkNNOfLkTLr55l6eouv1Xt1g Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREKAAYFAlYyCwAACgkQmBXlbbo5nOtWlgD+Oh2LvR8twmMSF1zp0wAZx7os R2sDojwnZWxgAcF2AZUBAKtfx0A6dZnfBO6Tvcy/OHJzQ9QnIN/LlYGHt962Cy90 =6mTe -----END PGP SIGNATURE----- --jBgTTkdpBqkNNOfLkTLr55l6eouv1Xt1g--