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==--