Same comment as previous patch - not big enough to keep separate. Other comments inline.
On Wed, Oct 15, 2014 at 10:49:05PM +0800, Fu Wei wrote:
arm64: export some accessor functions of dtb and the "loaded" flag for sharing code to multiboot.c
Signed-off-by: Fu Wei fu.wei@linaro.org
grub-core/loader/arm64/linux.c | 19 +++++++++++++++++++ include/grub/arm64/linux.h | 7 +++++++ 2 files changed, 26 insertions(+)
diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c index 5050a82..44f6e3d 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -50,6 +50,25 @@ static grub_addr_t initrd_end; static void *loaded_fdt; static void *fdt; +/* The accessor functions for dtb and the "loaded" flag */
Do we really need accessors for these? You could just rename and export the variables themselves.
+static void get_fdt (void);
+int grub_arm64_linux_get_loaded (void) +{
- return (loaded);
+}
+void grub_arm64_linux_set_loaded (int loaded_flag) +{
- loaded = loaded_flag;
+}
+void *grub_arm64_linux_get_fdt (void) +{
- get_fdt ();
- return (fdt);
+}
static void * get_firmware_fdt (void) { diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h index 22ffbaa..a438840 100644 --- a/include/grub/arm64/linux.h +++ b/include/grub/arm64/linux.h @@ -42,4 +42,11 @@ struct grub_arm64_linux_kernel_header grub_uint32_t hdr_offset; /* Offset of PE/COFF header */ }; +/* Export the accessor functions for dtb and the "loaded" flag */ +void EXPORT_FUNC (*grub_arm64_linux_get_fdt) (void);
+int EXPORT_FUNC (grub_arm64_linux_get_loaded) (void);
+void EXPORT_FUNC (grub_arm64_linux_set_loaded) (int loaded_flag);
#endif /* ! GRUB_LINUX_CPU_HEADER */
Are these EXPORT statements really necessary? This is all part of the same module.
/ Leif