Skip to contentSkip to conversation

arm64: Fix the bug in fdt module

PATCH In review [email protected] 2 participants 14 messages Nov 3, 2015 – Nov 9, 2015 6 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: Fix the bug in fdt module

From: Fu Wei <[email protected]>

This patch goes with commit:
4d0cb755387d6f109b901386ed4d3d475df239fe
arm64: Move FDT functions to separate module

linux and xen_boot modules can't work without this patch.

---
 grub-core/Makefile.core.def  | 1 +
 grub-core/loader/arm64/fdt.c | 5 +++++
 2 files changed, 6 insertions(+)
grub-core/Makefile.core.def +1 -0
index 2ef10d1..3ea4e49 100644
@@ -1674,6 +1674,7 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
+  fdt = lib/fdt.c;
   enable = arm64;
 };
 
grub-core/loader/arm64/fdt.c +5 -0
index 5202c14..d160ca0 100644
@@ -25,6 +25,10 @@
 #include <grub/file.h>
 #include <grub/efi/efi.h>
 
+GRUB_MOD_LICENSE ("GPLv3+");
+
+static grub_dl_t my_mod;
+
 static void *loaded_fdt;
 static void *fdt;
 
@@ -177,6 +181,7 @@ GRUB_MOD_INIT (fdt)
   cmd_devicetree =
     grub_register_command ("devicetree", grub_cmd_devicetree, 0,
 			   N_("Load DTB file."));
+  my_mod = mod;
 }
 
 GRUB_MOD_FINI (fdt)
Signature · 1 line
2.4.3

A message that is not in the archive (sent off-list or not yet received): CAEaD8JNT8g=UAo+mQ602Y=fRZkin1j0zKcD9DUa6tYFqZhJ9Nw@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): CADyBb7sdb-RyyJnaFc8fx4Rstsen2ZW9QEm1MPM7s-yow7A39Q@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): CAEaD8JPU81H+6qDaA4LxzWpb-upCdy7S3bdxrCnWi_U7GsCrBw@mail.gmail.com

#4 lore raw
Quoted 22 lines · Vladimir 'phcoder' Serbinenko
Quoted 19 lines · Fu Wei

Hi Vladimir,

Great thanks for your help :-)

Quoted 11 lines · Vladimir 'phcoder' Serbinenko
Quoted 9 lines · Le 3 nov. 2015 9:56 AM, <[email protected]> a écrit :

From: Fu Wei <[email protected]>

This patch goes with commit:
4d0cb755387d6f109b901386ed4d3d475df239fe
arm64: Move FDT functions to separate module

linux and xen_boot modules can't work without this patch.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Review

Quoted 7 lines
---
 grub-core/Makefile.core.def  | 1 +
 grub-core/loader/arm64/fdt.c | 5 +++++
 2 files changed, 6 insertions(+)
(quoted diff) +0 -0

b/grub-core/Makefile.core.def

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

index 2ef10d1..3ea4e49 100644

grub-core/Makefile.core.def +0 -0
@@ -1674,6 +1674,7 @@ module = {
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

grub-core/Makefile.core.def module = { · line 1680

Quoted 7 lines
grub-core/Makefile.core.def +1 -0
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
+  fdt = lib/fdt.c;
   enable = arm64;
 };
 

Please don't add same file to 2 different modules. Remove it from

Linux

Quoted 7 lines
Quoted 6 lines
Quoted 1 line

module

AFAIK, for now , only arm and arm64 are using lib/fdt.c So please allow me to separate all the fdt code from loader/arm/linux.c; just like arm64.

I don't think it's necessary at this point. Is xen_boot going to be

available for 32-bit arm as well?

Quoted 4 lines
Quoted 4 lines

This patch may become a patchset :-)

Quoted 1 line

Review

Quoted 1 line
(quoted diff) +0 -0

b/grub-core/loader/arm64/fdt.c

Quoted 13 lines
Quoted 13 lines
Quoted 12 lines

grub-core/loader/arm64/fdt.c line 31

Quoted 11 lines

index 5202c14..d160ca0 100644

grub-core/loader/arm64/fdt.c +4 -0
@@ -25,6 +25,10 @@
 #include <grub/file.h>
 #include <grub/efi/efi.h>
 
+GRUB_MOD_LICENSE ("GPLv3+");
+
+static grub_dl_t my_mod;
+

What's the reason for my_mod?

Quoted 5 lines
Quoted 4 lines

this is for grub_dl_unref and grub_dl_ref. but I forgot to check this again for this, sorry,
will add this later

Forget dl_ref and dl_unref. Linux module having a function reference is

already good enough

Quoted 29 lines
Quoted 29 lines
Quoted 11 lines
Quoted 11 lines
grub-core/loader/arm64/fdt.c +1 -0
 static void *loaded_fdt;
 static void *fdt;
 
@@ -177,6 +181,7 @@ GRUB_MOD_INIT (fdt)
   cmd_devicetree =
     grub_register_command ("devicetree", grub_cmd_devicetree, 0,
                           N_("Load DTB file."));
+  my_mod = mod;
 }
 
Quoted 4 lines
Quoted 4 lines
grub-core/loader/arm64/fdt.c +0 -1
 GRUB_MOD_FINI (fdt)
--

2.4.3

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

A message that is not in the archive (sent off-list or not yet received): CADyBb7tyfQ7MbuJjTBiGFm9s=aTJASsPJAxFPHFAC68DEPPz6A@mail.gmail.com

#6 lore raw
Quoted 27 lines · Fu Wei

Hi Vladimir,

Quoted 21 lines · Vladimir 'phcoder' Serbinenko
Quoted 19 lines · Fu Wei

Hi Vladimir,

Great thanks for your help :-)

Quoted 11 lines · Vladimir 'phcoder' Serbinenko
Quoted 9 lines · Le 3 nov. 2015 9:56 AM, <[email protected]> a écrit :

From: Fu Wei <[email protected]>

This patch goes with commit:
4d0cb755387d6f109b901386ed4d3d475df239fe
arm64: Move FDT functions to separate module

linux and xen_boot modules can't work without this patch.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Review

Quoted 7 lines
---
 grub-core/Makefile.core.def  | 1 +
 grub-core/loader/arm64/fdt.c | 5 +++++
 2 files changed, 6 insertions(+)
(quoted diff) +0 -0

b/grub-core/Makefile.core.def

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

index 2ef10d1..3ea4e49 100644

grub-core/Makefile.core.def +0 -0
@@ -1674,6 +1674,7 @@ module = {
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

grub-core/Makefile.core.def module = { · line 1680

Quoted 7 lines
grub-core/Makefile.core.def +1 -0
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
+  fdt = lib/fdt.c;
   enable = arm64;
 };
 

Please don't add same file to 2 different modules. Remove it from

Linux

Quoted 9 lines
Quoted 8 lines
Quoted 6 lines
Quoted 1 line

module

AFAIK, for now , only arm and arm64 are using lib/fdt.c So please allow me to separate all the fdt code from loader/arm/linux.c; just like arm64.

I don't think it's necessary at this point. Is xen_boot going to be available for 32-bit arm as well?

Quoted 7 lines

No, it's only about fdt code, if I don't add
fdt = lib/fdt.c;
in fdt module, linux and xen_boot support won't work, once you execute linux and xen_boot command on arm64, grub will crashdown. At least I have tested this on ARMv8 Foundation model

Did you try? Or maybe I did tests in the wrong way? If so, please correct

me.

Quoted 1 line

I understand your problem. I just mean than you should also change fdt = lib/fdt.c in linux module to arm = lib/fdt.c

Quoted 70 lines

Great thanks for your feedback :-)

Quoted 17 lines
Quoted 17 lines

This patch may become a patchset :-)

Quoted 14 lines

grub-core/loader/arm64/fdt.c line 31

Quoted 13 lines
grub-core/loader/arm64/fdt.c +4 -0
index 5202c14..d160ca0 100644
@@ -25,6 +25,10 @@
 #include <grub/file.h>
 #include <grub/efi/efi.h>
 
+GRUB_MOD_LICENSE ("GPLv3+");
+
+static grub_dl_t my_mod;
+

What's the reason for my_mod?

Quoted 6 lines
Quoted 4 lines

this is for grub_dl_unref and grub_dl_ref. but I forgot to check this again for this, sorry,
will add this later

Forget dl_ref and dl_unref. Linux module having a function reference is already good enough

OK, will delete it

Quoted 20 lines
Quoted 20 lines
Quoted 10 lines
Quoted 10 lines
grub-core/loader/arm64/fdt.c +1 -0
 static void *loaded_fdt;
 static void *fdt;
 
@@ -177,6 +181,7 @@ GRUB_MOD_INIT (fdt)
   cmd_devicetree =
     grub_register_command ("devicetree", grub_cmd_devicetree, 0,
                           N_("Load DTB file."));
+  my_mod = mod;
 }
 
Quoted 4 lines
Quoted 4 lines
grub-core/loader/arm64/fdt.c +0 -1
 GRUB_MOD_FINI (fdt)
--

2.4.3

--
Best regards,

Quoted 8 lines
Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

A message that is not in the archive (sent off-list or not yet received): CADyBb7uF8ekopnOn4XyXUmTecisLhhXqzdeX+cKKNm-S9gXGzg@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): CADyBb7v6XpVjntuUg2cdpbbKJR_9RuAwvrRODaees-wFE8VEXw@mail.gmail.com

#9 lore raw
Quoted 29 lines · Fu Wei

Hi Vladimir,

Quoted 25 lines · Fu Wei

Hi Vladimir,

Quoted 21 lines · Vladimir 'phcoder' Serbinenko
Quoted 19 lines · Fu Wei

Hi Vladimir,

Great thanks for your help :-)

Quoted 11 lines · Vladimir 'phcoder' Serbinenko
Quoted 9 lines · Le 3 nov. 2015 9:56 AM, <[email protected]> a écrit :

From: Fu Wei <[email protected]>

This patch goes with commit:
4d0cb755387d6f109b901386ed4d3d475df239fe
arm64: Move FDT functions to separate module

linux and xen_boot modules can't work without this patch.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Review

Quoted 7 lines
---
 grub-core/Makefile.core.def  | 1 +
 grub-core/loader/arm64/fdt.c | 5 +++++
 2 files changed, 6 insertions(+)
(quoted diff) +0 -0

b/grub-core/Makefile.core.def

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

index 2ef10d1..3ea4e49 100644

grub-core/Makefile.core.def +0 -0
@@ -1674,6 +1674,7 @@ module = {
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

grub-core/Makefile.core.def module = { · line 1680

Quoted 7 lines
grub-core/Makefile.core.def +1 -0
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
+  fdt = lib/fdt.c;
   enable = arm64;
 };
 

Please don't add same file to 2 different modules. Remove it from

Linux

Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 1 line

module

AFAIK, for now , only arm and arm64 are using lib/fdt.c So please allow me to separate all the fdt code from loader/arm/linux.c; just like arm64.

I don't think it's necessary at this point. Is xen_boot going to be available for 32-bit arm as well?

Quoted 9 lines

And I would like to help to sort out the code for your new fdt module , If you don't mind.

But according to my tests, I think we need "fdt = lib/fdt.c;" in module. If we don't separate fdt code from arm, we also need "fdt = lib/fdt.c;" in linux module.

Please correct me if I misunderstand something, thanks

We need arm = lib/fdt.c in linux if we don't restructure. There is no reason to include lib/fdt.c in 2 different modules on arm64. Fdt in first part just mean arm and arm64 in this context

Quoted 79 lines
Quoted 57 lines
Quoted 17 lines
Quoted 17 lines

This patch may become a patchset :-)

Quoted 14 lines

grub-core/loader/arm64/fdt.c line 31

Quoted 13 lines
grub-core/loader/arm64/fdt.c +4 -0
index 5202c14..d160ca0 100644
@@ -25,6 +25,10 @@
 #include <grub/file.h>
 #include <grub/efi/efi.h>
 
+GRUB_MOD_LICENSE ("GPLv3+");
+
+static grub_dl_t my_mod;
+

What's the reason for my_mod?

Quoted 34 lines
Quoted 4 lines

this is for grub_dl_unref and grub_dl_ref. but I forgot to check this again for this, sorry,
will add this later

Forget dl_ref and dl_unref. Linux module having a function reference is already good enough

Quoted 28 lines
Quoted 10 lines
Quoted 10 lines
grub-core/loader/arm64/fdt.c +1 -0
 static void *loaded_fdt;
 static void *fdt;
 
@@ -177,6 +181,7 @@ GRUB_MOD_INIT (fdt)
   cmd_devicetree =
     grub_register_command ("devicetree", grub_cmd_devicetree, 0,
                           N_("Load DTB file."));
+  my_mod = mod;
 }
 
Quoted 4 lines
Quoted 4 lines
grub-core/loader/arm64/fdt.c +0 -1
 GRUB_MOD_FINI (fdt)
--

2.4.3

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

#10 lore raw
Quoted 32 lines · Vladimir 'phcoder' Serbinenko
Quoted 29 lines · Fu Wei

Hi Vladimir,

Quoted 25 lines · Fu Wei

Hi Vladimir,

Quoted 21 lines · Vladimir 'phcoder' Serbinenko
Quoted 19 lines · Fu Wei

Hi Vladimir,

Great thanks for your help :-)

Quoted 11 lines · Vladimir 'phcoder' Serbinenko
Quoted 9 lines · Le 3 nov. 2015 9:56 AM, <[email protected]> a écrit :

From: Fu Wei <[email protected]>

This patch goes with commit:
4d0cb755387d6f109b901386ed4d3d475df239fe
arm64: Move FDT functions to separate module

linux and xen_boot modules can't work without this patch.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Review

Quoted 7 lines
---
 grub-core/Makefile.core.def  | 1 +
 grub-core/loader/arm64/fdt.c | 5 +++++
 2 files changed, 6 insertions(+)
(quoted diff) +0 -0

b/grub-core/Makefile.core.def

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

index 2ef10d1..3ea4e49 100644

grub-core/Makefile.core.def +0 -0
@@ -1674,6 +1674,7 @@ module = {
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

grub-core/Makefile.core.def module = { · line 1680

Quoted 7 lines
grub-core/Makefile.core.def +1 -0
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
+  fdt = lib/fdt.c;
   enable = arm64;
 };
 

Please don't add same file to 2 different modules. Remove it from

Linux

Quoted 12 lines
Quoted 12 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 1 line

module

AFAIK, for now , only arm and arm64 are using lib/fdt.c So please allow me to separate all the fdt code from loader/arm/linux.c; just like arm64.

I don't think it's necessary at this point. Is xen_boot going to be available for 32-bit arm as well?

And I would like to help to sort out the code for your new fdt module , If you don't mind.

Quoted 7 lines
Quoted 6 lines

But according to my tests, I think we need "fdt = lib/fdt.c;" in module. If we don't separate fdt code from arm, we also need "fdt = lib/fdt.c;" in linux module.

Please correct me if I misunderstand something, thanks

We need arm = lib/fdt.c in linux if we don't restructure. There is no

reason to include lib/fdt.c in 2 different modules on arm64. Fdt in first part just mean arm and arm64 in this context

Quoted 1 line

As an alternative: enable fdt module on all fdt platforms (enable = fdt) and put lib/fdt.c

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

This patch may become a patchset :-)

Quoted 9 lines
Quoted 9 lines
grub-core/loader/arm64/fdt.c +0 -0
index 5202c14..d160ca0 100644
@@ -25,6 +25,10 @@
 #include <grub/file.h>
 #include <grub/efi/efi.h>
 
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

grub-core/loader/arm64/fdt.c line 31

Quoted 4 lines
grub-core/loader/arm64/fdt.c +4 -0
+GRUB_MOD_LICENSE ("GPLv3+");
+
+static grub_dl_t my_mod;
+

What's the reason for my_mod?

this is for grub_dl_unref and grub_dl_ref. but I forgot to check

this

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

again for this, sorry,
will add this later

Forget dl_ref and dl_unref. Linux module having a function reference

is

Quoted 57 lines
Quoted 57 lines
Quoted 35 lines
Quoted 29 lines

already good enough

Quoted 28 lines
Quoted 10 lines
Quoted 10 lines
grub-core/loader/arm64/fdt.c +1 -0
 static void *loaded_fdt;
 static void *fdt;
 
@@ -177,6 +181,7 @@ GRUB_MOD_INIT (fdt)
   cmd_devicetree =
     grub_register_command ("devicetree", grub_cmd_devicetree, 0,
                           N_("Load DTB file."));
+  my_mod = mod;
 }
 
Quoted 4 lines
Quoted 4 lines
grub-core/loader/arm64/fdt.c +0 -1
 GRUB_MOD_FINI (fdt)
--

2.4.3

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

author
#11 lore raw

Hi Vladimir

Please correct me :-)
Can I do this :

grub-core/Makefile.core.def +3 -2
index 2ef10d1..ea5831f 100644
@@ -1665,7 +1665,6 @@ module = {
   ia64_efi = loader/ia64/efi/linux.c;
   arm = loader/arm/linux.c;
   arm64 = loader/arm64/linux.c;
-  fdt = lib/fdt.c;
   common = loader/linux.c;
   common = lib/cmdline.c;
   enable = noemu;
@@ -1674,7 +1673,9 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
-  enable = arm64;
+  arm = loader/arm/fdt.c;
+  common = lib/fdt.c;
+  enable = fdt;
 };
 
 module = {
Quoted 162 lines · Vladimir 'phcoder' Serbinenko
Quoted 69 lines · Vladimir 'phcoder' Serbinenko
Quoted 66 lines · Fu Wei

Hi Vladimir,

Quoted 54 lines · Fu Wei

Hi Vladimir,

Quoted 50 lines · Vladimir 'phcoder' Serbinenko
Quoted 42 lines · Fu Wei

Hi Vladimir,

Great thanks for your help :-)

Quoted 17 lines · Vladimir 'phcoder' Serbinenko
Quoted 15 lines · Le 3 nov. 2015 9:56 AM, <[email protected]> a écrit :

From: Fu Wei <[email protected]>

This patch goes with commit:
4d0cb755387d6f109b901386ed4d3d475df239fe
arm64: Move FDT functions to separate module

linux and xen_boot modules can't work without this patch.

---
 grub-core/Makefile.core.def  | 1 +
 grub-core/loader/arm64/fdt.c | 5 +++++
 2 files changed, 6 insertions(+)
Quoted 16 lines

grub-core/Makefile.core.def module = { · line 1680

Quoted 13 lines
grub-core/Makefile.core.def +1 -0
index 2ef10d1..3ea4e49 100644
@@ -1674,6 +1674,7 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
+  fdt = lib/fdt.c;
   enable = arm64;
 };
 

Please don't add same file to 2 different modules. Remove it from Linux
module

Quoted 4 lines

AFAIK, for now , only arm and arm64 are using lib/fdt.c So please allow me to separate all the fdt code from loader/arm/linux.c; just like arm64.

I don't think it's necessary at this point. Is xen_boot going to be available for 32-bit arm as well?

And I would like to help to sort out the code for your new fdt module , If you don't mind.

But according to my tests, I think we need "fdt = lib/fdt.c;" in module. If we don't separate fdt code from arm, we also need "fdt = lib/fdt.c;" in linux module.

Quoted 6 lines
Quoted 2 lines

Please correct me if I misunderstand something, thanks

We need arm = lib/fdt.c in linux if we don't restructure. There is no reason to include lib/fdt.c in 2 different modules on arm64. Fdt in first part just mean arm and arm64 in this context

As an alternative: enable fdt module on all fdt platforms (enable = fdt) and put lib/fdt.c

Quoted 81 lines
Quoted 81 lines
Quoted 59 lines
Quoted 17 lines
Quoted 17 lines

This patch may become a patchset :-)

Quoted 14 lines

grub-core/loader/arm64/fdt.c line 31

Quoted 13 lines
grub-core/loader/arm64/fdt.c +4 -0
index 5202c14..d160ca0 100644
@@ -25,6 +25,10 @@
 #include <grub/file.h>
 #include <grub/efi/efi.h>
 
+GRUB_MOD_LICENSE ("GPLv3+");
+
+static grub_dl_t my_mod;
+

What's the reason for my_mod?

Quoted 36 lines
Quoted 5 lines

this is for grub_dl_unref and grub_dl_ref. but I forgot to check this
again for this, sorry,
will add this later

Forget dl_ref and dl_unref. Linux module having a function reference is
already good enough

Quoted 28 lines
Quoted 10 lines
Quoted 10 lines
grub-core/loader/arm64/fdt.c +1 -0
 static void *loaded_fdt;
 static void *fdt;
 
@@ -177,6 +181,7 @@ GRUB_MOD_INIT (fdt)
   cmd_devicetree =
     grub_register_command ("devicetree", grub_cmd_devicetree, 0,
                           N_("Load DTB file."));
+  my_mod = mod;
 }
 
Quoted 4 lines
Quoted 4 lines
grub-core/loader/arm64/fdt.c +0 -1
 GRUB_MOD_FINI (fdt)
--

2.4.3

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

Signature · 10 lines
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021
#12 lore raw
Quoted 19 lines · Fu Wei

Hi Vladimir

Please correct me :-)
Can I do this :

grub-core/Makefile.core.def +0 -1
index 2ef10d1..ea5831f 100644
@@ -1665,7 +1665,6 @@ module = {
   ia64_efi = loader/ia64/efi/linux.c;
   arm = loader/arm/linux.c;
   arm64 = loader/arm64/linux.c;
-  fdt = lib/fdt.c;
   common = loader/linux.c;
   common = lib/cmdline.c;
   enable = noemu;

grub-core/Makefile.core.def module = { · line 1676

Quoted 5 lines
grub-core/Makefile.core.def +1 -1
@@ -1674,7 +1673,9 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
-  enable = arm64;
+  arm = loader/arm/fdt.c;

Where does this file come from?

Quoted 10 lines
grub-core/Makefile.core.def +2 -0
+  common = lib/fdt.c;
+  enable = fdt;
 };
 
 module = {
Quoted 2 lines · Vladimir 'phcoder' Serbinenko

Le 4 nov. 2015 12:12 PM, "Vladimir 'phcoder' Serbinenko" <

[email protected]>

Quoted 39 lines
Quoted 39 lines
Quoted 38 lines · a écrit :
Quoted 35 lines · Fu Wei

Hi Vladimir,

Quoted 31 lines · Fu Wei

Hi Vladimir,

Quoted 27 lines · Vladimir 'phcoder' Serbinenko
Quoted 25 lines · Fu Wei

Hi Vladimir,

Great thanks for your help :-)

Quoted 17 lines · Vladimir 'phcoder' Serbinenko
Quoted 15 lines · Le 3 nov. 2015 9:56 AM, <[email protected]> a écrit :

From: Fu Wei <[email protected]>

This patch goes with commit:
4d0cb755387d6f109b901386ed4d3d475df239fe
arm64: Move FDT functions to separate module

linux and xen_boot modules can't work without this patch.

---
 grub-core/Makefile.core.def  | 1 +
 grub-core/loader/arm64/fdt.c | 5 +++++
 2 files changed, 6 insertions(+)
Quoted 14 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
grub-core/Makefile.core.def +0 -0
index 2ef10d1..3ea4e49 100644
@@ -1674,6 +1674,7 @@ module = {
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

grub-core/Makefile.core.def module = { · line 1680

Quoted 7 lines
grub-core/Makefile.core.def +1 -0
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
+  fdt = lib/fdt.c;
   enable = arm64;
 };
 

Please don't add same file to 2 different modules. Remove it

from

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

Linux
module

AFAIK, for now , only arm and arm64 are using lib/fdt.c So please allow me to separate all the fdt code from loader/arm/linux.c; just like arm64.

I don't think it's necessary at this point. Is xen_boot going to

be

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line

available for 32-bit arm as well?

And I would like to help to sort out the code for your new fdt module , If you don't mind.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines

But according to my tests, I think we need "fdt = lib/fdt.c;" in module. If we don't separate fdt code from arm, we also need "fdt = lib/fdt.c;" in linux module.

Please correct me if I misunderstand something, thanks

We need arm = lib/fdt.c in linux if we don't restructure. There is no reason to include lib/fdt.c in 2 different modules on arm64. Fdt in

first

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

part just mean arm and arm64 in this context

As an alternative: enable fdt module on all fdt platforms (enable =

fdt) and

Quoted 19 lines
Quoted 19 lines

put lib/fdt.c

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines

This patch may become a patchset :-)

Quoted 14 lines

grub-core/loader/arm64/fdt.c line 31

Quoted 13 lines
grub-core/loader/arm64/fdt.c +4 -0
index 5202c14..d160ca0 100644
@@ -25,6 +25,10 @@
 #include <grub/file.h>
 #include <grub/efi/efi.h>
 
+GRUB_MOD_LICENSE ("GPLv3+");
+
+static grub_dl_t my_mod;
+

What's the reason for my_mod?

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

this is for grub_dl_unref and grub_dl_ref. but I forgot to check this
again for this, sorry,
will add this later

Forget dl_ref and dl_unref. Linux module having a function

reference

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

is
already good enough

Quoted 6 lines
Quoted 6 lines

grub-core/loader/arm64/fdt.c GRUB_MOD_INIT (fdt) · line 182

Quoted 6 lines
grub-core/loader/arm64/fdt.c +0 -0
 static void *loaded_fdt;
 static void *fdt;
 
@@ -177,6 +181,7 @@ GRUB_MOD_INIT (fdt)
   cmd_devicetree =
     grub_register_command ("devicetree",

grub_cmd_devicetree, 0,

Quoted 64 lines
Quoted 42 lines
Quoted 42 lines
Quoted 42 lines
Quoted 28 lines
Quoted 14 lines
Quoted 14 lines
Quoted 8 lines
Quoted 8 lines
grub-core/loader/arm64/fdt.c +1 -1
                           N_("Load DTB file."));
+  my_mod = mod;
 }
 
 GRUB_MOD_FINI (fdt)
--

2.4.3

--
Best regards,

Quoted 8 lines
Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

author
#13 lore raw

Hi Vladimir

Quoted 19 lines · Vladimir 'phcoder' Serbinenko
Quoted 17 lines · Fu Wei

Hi Vladimir

Please correct me :-)
Can I do this :

grub-core/Makefile.core.def +0 -1
index 2ef10d1..ea5831f 100644
@@ -1665,7 +1665,6 @@ module = {
   ia64_efi = loader/ia64/efi/linux.c;
   arm = loader/arm/linux.c;
   arm64 = loader/arm64/linux.c;
-  fdt = lib/fdt.c;
   common = loader/linux.c;
   common = lib/cmdline.c;
Quoted 9 lines

grub-core/Makefile.core.def module = { · line 1676

Quoted 7 lines
grub-core/Makefile.core.def +1 -1
   enable = noemu;
@@ -1674,7 +1673,9 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
-  enable = arm64;
+  arm = loader/arm/fdt.c;

Where does this file come from?

that is the file I am working on

i just tried to let you know my thought.

Is this way Ok for you? Please correct me if I misunderstand you

Quoted 192 lines
Quoted 192 lines
grub-core/Makefile.core.def +2 -0
+  common = lib/fdt.c;
+  enable = fdt;
 };
 
 module = {
Quoted 77 lines · Vladimir 'phcoder' Serbinenko
Quoted 73 lines · Vladimir 'phcoder' Serbinenko
Quoted 70 lines · Fu Wei

Hi Vladimir,

Quoted 56 lines · Fu Wei

Hi Vladimir,

Quoted 52 lines · Vladimir 'phcoder' Serbinenko
Quoted 43 lines · Fu Wei

Hi Vladimir,

Great thanks for your help :-)

Quoted 26 lines · Vladimir 'phcoder' Serbinenko
Quoted 24 lines · Le 3 nov. 2015 9:56 AM, <[email protected]> a écrit :

From: Fu Wei <[email protected]>

This patch goes with commit:
4d0cb755387d6f109b901386ed4d3d475df239fe
arm64: Move FDT functions to separate module

linux and xen_boot modules can't work without this patch.

---
 grub-core/Makefile.core.def  | 1 +
 grub-core/loader/arm64/fdt.c | 5 +++++
 2 files changed, 6 insertions(+)
grub-core/Makefile.core.def +0 -0
index 2ef10d1..3ea4e49 100644
@@ -1674,6 +1674,7 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
Quoted 8 lines

grub-core/Makefile.core.def module = { · line 1680

Quoted 4 lines
grub-core/Makefile.core.def +1 -0
+  fdt = lib/fdt.c;
   enable = arm64;
 };
 

Please don't add same file to 2 different modules. Remove it from
Linux
module

Quoted 4 lines

AFAIK, for now , only arm and arm64 are using lib/fdt.c So please allow me to separate all the fdt code from loader/arm/linux.c; just like arm64.

I don't think it's necessary at this point. Is xen_boot going to be
available for 32-bit arm as well?

And I would like to help to sort out the code for your new fdt module , If you don't mind.

But according to my tests, I think we need "fdt = lib/fdt.c;" in module. If we don't separate fdt code from arm, we also need "fdt = lib/fdt.c;" in linux module.

Please correct me if I misunderstand something, thanks

Quoted 92 lines
Quoted 5 lines

We need arm = lib/fdt.c in linux if we don't restructure. There is no reason to include lib/fdt.c in 2 different modules on arm64. Fdt in first
part just mean arm and arm64 in this context

As an alternative: enable fdt module on all fdt platforms (enable = fdt) and
put lib/fdt.c

Quoted 83 lines
Quoted 83 lines
Quoted 61 lines
Quoted 22 lines
Quoted 17 lines

This patch may become a patchset :-)

Quoted 9 lines
Quoted 9 lines
grub-core/loader/arm64/fdt.c +0 -0
index 5202c14..d160ca0 100644
@@ -25,6 +25,10 @@
 #include <grub/file.h>
 #include <grub/efi/efi.h>
 
Quoted 5 lines

grub-core/loader/arm64/fdt.c line 31

Quoted 4 lines
grub-core/loader/arm64/fdt.c +4 -0
+GRUB_MOD_LICENSE ("GPLv3+");
+
+static grub_dl_t my_mod;
+

What's the reason for my_mod?

Quoted 5 lines

this is for grub_dl_unref and grub_dl_ref. but I forgot to check this
again for this, sorry,
will add this later

Quoted 33 lines

Forget dl_ref and dl_unref. Linux module having a function reference
is
already good enough

Quoted 29 lines
Quoted 11 lines
Quoted 11 lines
grub-core/loader/arm64/fdt.c +1 -0
 static void *loaded_fdt;
 static void *fdt;
 
@@ -177,6 +181,7 @@ GRUB_MOD_INIT (fdt)
   cmd_devicetree =
     grub_register_command ("devicetree", grub_cmd_devicetree,
 0,
                           N_("Load DTB file."));
+  my_mod = mod;
 }
 
Quoted 4 lines
Quoted 4 lines

GRUB_MOD_FINI (fdt)
--
2.4.3

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

Signature · 10 lines
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021
#14 lore raw
Quoted 34 lines · Fu Wei

Hi Vladimir

Quoted 19 lines · Vladimir 'phcoder' Serbinenko
Quoted 17 lines · Fu Wei

Hi Vladimir

Please correct me :-)
Can I do this :

grub-core/Makefile.core.def +0 -1
index 2ef10d1..ea5831f 100644
@@ -1665,7 +1665,6 @@ module = {
   ia64_efi = loader/ia64/efi/linux.c;
   arm = loader/arm/linux.c;
   arm64 = loader/arm64/linux.c;
-  fdt = lib/fdt.c;
   common = loader/linux.c;
   common = lib/cmdline.c;
Quoted 9 lines

grub-core/Makefile.core.def module = { · line 1676

Quoted 7 lines
grub-core/Makefile.core.def +1 -1
   enable = noemu;
@@ -1674,7 +1673,9 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
-  enable = arm64;
+  arm = loader/arm/fdt.c;

Where does this file come from?

Quoted 6 lines

that is the file I am working on

i just tried to let you know my thought.

Is this way Ok for you? Please correct me if I misunderstand you

What is the reason to reshuffle fdt code for 32-bit arm? Does it merge any code with arm64? Will this code be used by anything besides linux module?

Quoted 70 lines
Quoted 70 lines
Quoted 70 lines
grub-core/Makefile.core.def +2 -0
+  common = lib/fdt.c;
+  enable = fdt;
 };
 
 module = {
Quoted 60 lines · Vladimir 'phcoder' Serbinenko
Quoted 56 lines · Vladimir 'phcoder' Serbinenko
Quoted 53 lines · Fu Wei

Hi Vladimir,

Quoted 49 lines · Fu Wei

Hi Vladimir,

Quoted 45 lines · Vladimir 'phcoder' Serbinenko
Quoted 43 lines · Fu Wei

Hi Vladimir,

Great thanks for your help :-)

Quoted 34 lines · Vladimir 'phcoder' Serbinenko
Quoted 21 lines · Le 3 nov. 2015 9:56 AM, <[email protected]> a écrit :

From: Fu Wei <[email protected]>

This patch goes with commit:
4d0cb755387d6f109b901386ed4d3d475df239fe
arm64: Move FDT functions to separate module

linux and xen_boot modules can't work without this patch.

---
 grub-core/Makefile.core.def  | 1 +
 grub-core/loader/arm64/fdt.c | 5 +++++
 2 files changed, 6 insertions(+)
grub-core/Makefile.core.def +0 -0
index 2ef10d1..3ea4e49 100644

grub-core/Makefile.core.def module = { · line 1680

Quoted 7 lines
grub-core/Makefile.core.def +1 -0
@@ -1674,6 +1674,7 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
+  fdt = lib/fdt.c;
   enable = arm64;
 };
 

Please don't add same file to 2 different modules. Remove it from
Linux
module

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

AFAIK, for now , only arm and arm64 are using lib/fdt.c So please allow me to separate all the fdt code from loader/arm/linux.c; just like arm64.

I don't think it's necessary at this point. Is xen_boot going

to

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines

be
available for 32-bit arm as well?

And I would like to help to sort out the code for your new fdt

module

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

, If you don't mind.

But according to my tests, I think we need "fdt = lib/fdt.c;" in module. If we don't separate fdt code from arm, we also need "fdt

=

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

lib/fdt.c;" in linux module.

Please correct me if I misunderstand something, thanks

We need arm = lib/fdt.c in linux if we don't restructure. There is

no

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

reason to include lib/fdt.c in 2 different modules on arm64. Fdt in first
part just mean arm and arm64 in this context

As an alternative: enable fdt module on all fdt platforms (enable =

fdt)

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines

and
put lib/fdt.c

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

This patch may become a patchset :-)

Quoted 9 lines
Quoted 9 lines
grub-core/loader/arm64/fdt.c +0 -0
index 5202c14..d160ca0 100644
@@ -25,6 +25,10 @@
 #include <grub/file.h>
 #include <grub/efi/efi.h>
 
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

grub-core/loader/arm64/fdt.c line 31

Quoted 4 lines
grub-core/loader/arm64/fdt.c +4 -0
+GRUB_MOD_LICENSE ("GPLv3+");
+
+static grub_dl_t my_mod;
+

What's the reason for my_mod?

this is for grub_dl_unref and grub_dl_ref. but I forgot to

check

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

this
again for this, sorry,
will add this later

Forget dl_ref and dl_unref. Linux module having a function reference
is
already good enough

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

grub-core/loader/arm64/fdt.c GRUB_MOD_INIT (fdt) · line 182

Quoted 6 lines
grub-core/loader/arm64/fdt.c +0 -0
 static void *loaded_fdt;
 static void *fdt;
 
@@ -177,6 +181,7 @@ GRUB_MOD_INIT (fdt)
   cmd_devicetree =
     grub_register_command ("devicetree",

grub_cmd_devicetree,

Quoted 79 lines
Quoted 57 lines
Quoted 57 lines
Quoted 43 lines
Quoted 43 lines
Quoted 43 lines
Quoted 29 lines
Quoted 15 lines
Quoted 15 lines
Quoted 9 lines
Quoted 9 lines
grub-core/loader/arm64/fdt.c +1 -0
 0,
                           N_("Load DTB file."));
+  my_mod = mod;
 }
 

GRUB_MOD_FINI (fdt)
--
2.4.3

--
Best regards,

Quoted 8 lines
Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines
Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

author
#15 lore raw

Hi Vladimir,

Quoted 36 lines · Vladimir 'phcoder' Serbinenko
Quoted 34 lines · Fu Wei

Hi Vladimir

Quoted 28 lines · Vladimir 'phcoder' Serbinenko
Quoted 19 lines · Fu Wei

Hi Vladimir

Please correct me :-)
Can I do this :

grub-core/Makefile.core.def +0 -1
index 2ef10d1..ea5831f 100644
@@ -1665,7 +1665,6 @@ module = {
   ia64_efi = loader/ia64/efi/linux.c;
   arm = loader/arm/linux.c;
   arm64 = loader/arm64/linux.c;
-  fdt = lib/fdt.c;
   common = loader/linux.c;
   common = lib/cmdline.c;
   enable = noemu;

grub-core/Makefile.core.def module = { · line 1676

Quoted 5 lines
grub-core/Makefile.core.def +1 -1
@@ -1674,7 +1673,9 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
-  enable = arm64;
+  arm = loader/arm/fdt.c;

Where does this file come from?

Quoted 7 lines
Quoted 6 lines

that is the file I am working on

i just tried to let you know my thought.

Is this way Ok for you? Please correct me if I misunderstand you

What is the reason to reshuffle fdt code for 32-bit arm?

reason:
we can delete fdt = lib/fdt.c; in linux module, make this only in fdt module.

Quoted 1 line

Does it merge any code with arm64?

No, because arm64 uses uefi runtime service, but arm doesn't

Quoted 1 line

Will this code be used by anything besides linux module?

For arm64, as you know, yes, by xen_boot, but for arm, NO

So maybe we can do this:

grub-core/Makefile.core.def +2 -2
index 3ea4e49..db36a68 100644
@@ -1664,8 +1664,8 @@ module = {
   sparc64_ieee1275 = loader/sparc64/ieee1275/linux.c;
   ia64_efi = loader/ia64/efi/linux.c;
   arm = loader/arm/linux.c;
+  arm = lib/fdt.c;
   arm64 = loader/arm64/linux.c;
-  fdt = lib/fdt.c;
   common = loader/linux.c;
   common = lib/cmdline.c;
   enable = noemu;
@@ -1674,7 +1674,7 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
-  fdt = lib/fdt.c;
+  common = lib/fdt.c;
   enable = arm64;
 };
 
Quoted 215 lines
Quoted 215 lines
Quoted 193 lines
Quoted 193 lines
grub-core/Makefile.core.def +2 -0
+  common = lib/fdt.c;
+  enable = fdt;
 };
 
 module = {
Quoted 86 lines · Vladimir 'phcoder' Serbinenko
Quoted 74 lines · Vladimir 'phcoder' Serbinenko
Quoted 71 lines · Fu Wei

Hi Vladimir,

Quoted 57 lines · Fu Wei

Hi Vladimir,

Quoted 53 lines · Vladimir 'phcoder' Serbinenko
Quoted 43 lines · Fu Wei

Hi Vladimir,

Great thanks for your help :-)

Quoted 26 lines · Vladimir 'phcoder' Serbinenko
Quoted 24 lines · Le 3 nov. 2015 9:56 AM, <[email protected]> a écrit :

From: Fu Wei <[email protected]>

This patch goes with commit:
4d0cb755387d6f109b901386ed4d3d475df239fe
arm64: Move FDT functions to separate module

linux and xen_boot modules can't work without this patch.

---
 grub-core/Makefile.core.def  | 1 +
 grub-core/loader/arm64/fdt.c | 5 +++++
 2 files changed, 6 insertions(+)
grub-core/Makefile.core.def +0 -0
index 2ef10d1..3ea4e49 100644
@@ -1674,6 +1674,7 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
Quoted 8 lines

grub-core/Makefile.core.def module = { · line 1680

Quoted 4 lines
grub-core/Makefile.core.def +1 -0
+  fdt = lib/fdt.c;
   enable = arm64;
 };
 

Please don't add same file to 2 different modules. Remove it from
Linux
module

Quoted 4 lines

AFAIK, for now , only arm and arm64 are using lib/fdt.c So please allow me to separate all the fdt code from loader/arm/linux.c; just like arm64.

I don't think it's necessary at this point. Is xen_boot going to
be
available for 32-bit arm as well?

And I would like to help to sort out the code for your new fdt module
, If you don't mind.

But according to my tests, I think we need "fdt = lib/fdt.c;" in module. If we don't separate fdt code from arm, we also need "fdt =
lib/fdt.c;" in linux module.

Quoted 8 lines
Quoted 2 lines

Please correct me if I misunderstand something, thanks

We need arm = lib/fdt.c in linux if we don't restructure. There is no
reason to include lib/fdt.c in 2 different modules on arm64. Fdt in first
part just mean arm and arm64 in this context

Quoted 90 lines

As an alternative: enable fdt module on all fdt platforms (enable = fdt)
and
put lib/fdt.c

Quoted 85 lines
Quoted 85 lines
Quoted 63 lines
Quoted 23 lines
Quoted 17 lines

This patch may become a patchset :-)

Quoted 9 lines
Quoted 9 lines
grub-core/loader/arm64/fdt.c +0 -0
index 5202c14..d160ca0 100644
@@ -25,6 +25,10 @@
 #include <grub/file.h>
 #include <grub/efi/efi.h>
 
Quoted 5 lines

grub-core/loader/arm64/fdt.c line 31

Quoted 4 lines
grub-core/loader/arm64/fdt.c +4 -0
+GRUB_MOD_LICENSE ("GPLv3+");
+
+static grub_dl_t my_mod;
+

What's the reason for my_mod?

Quoted 6 lines

this is for grub_dl_unref and grub_dl_ref. but I forgot to check
this
again for this, sorry,
will add this later

Quoted 34 lines

Forget dl_ref and dl_unref. Linux module having a function reference
is
already good enough

Quoted 30 lines
Quoted 12 lines
Quoted 12 lines
grub-core/loader/arm64/fdt.c +1 -0
 static void *loaded_fdt;
 static void *fdt;
 
@@ -177,6 +181,7 @@ GRUB_MOD_INIT (fdt)
   cmd_devicetree =
     grub_register_command ("devicetree",
 grub_cmd_devicetree,
 0,
                           N_("Load DTB file."));
+  my_mod = mod;
 }
Quoted 4 lines
Quoted 4 lines

GRUB_MOD_FINI (fdt)
--
2.4.3

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines
Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

Signature · 10 lines
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021
#16 lore raw
Quoted 14 lines · Fu Wei

Hi Vladimir,

Quoted 8 lines · Vladimir 'phcoder' Serbinenko
Quoted 6 lines · Fu Wei

Hi Vladimir

Quoted 1 line · Vladimir 'phcoder' Serbinenko
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines · Fu Wei

Review

Quoted 7 lines

Hi Vladimir

Please correct me :-)
Can I do this :

(quoted diff) +0 -0

b/grub-core/Makefile.core.def

Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
Quoted 10 lines
Quoted 10 lines

index 2ef10d1..ea5831f 100644

grub-core/Makefile.core.def +0 -1
@@ -1665,7 +1665,6 @@ module = {
   ia64_efi = loader/ia64/efi/linux.c;
   arm = loader/arm/linux.c;
   arm64 = loader/arm64/linux.c;
-  fdt = lib/fdt.c;
   common = loader/linux.c;
   common = lib/cmdline.c;
Quoted 9 lines

grub-core/Makefile.core.def module = { · line 1676

Quoted 7 lines
grub-core/Makefile.core.def +1 -1
   enable = noemu;
@@ -1674,7 +1673,9 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
-  enable = arm64;
+  arm = loader/arm/fdt.c;

Where does this file come from?

that is the file I am working on

i just tried to let you know my thought.

Quoted 8 lines
Quoted 3 lines
Quoted 2 lines

Is this way Ok for you? Please correct me if I misunderstand you

What is the reason to reshuffle fdt code for 32-bit arm?

reason:
we can delete fdt = lib/fdt.c; in linux module, make this only in fdt module.

You don't need to actually shuffle any code. Just see the attached patch

Quoted 57 lines
Quoted 2 lines

Does it merge any code with arm64?

No, because arm64 uses uefi runtime service, but arm doesn't

Quoted 1 line

Will this code be used by anything besides linux module?

For arm64, as you know, yes, by xen_boot, but for arm, NO

So maybe we can do this:

grub-core/Makefile.core.def +2 -2
index 3ea4e49..db36a68 100644
@@ -1664,8 +1664,8 @@ module = {
   sparc64_ieee1275 = loader/sparc64/ieee1275/linux.c;
   ia64_efi = loader/ia64/efi/linux.c;
   arm = loader/arm/linux.c;
+  arm = lib/fdt.c;
   arm64 = loader/arm64/linux.c;
-  fdt = lib/fdt.c;
   common = loader/linux.c;
   common = lib/cmdline.c;
   enable = noemu;
@@ -1674,7 +1674,7 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
-  fdt = lib/fdt.c;
+  common = lib/fdt.c;
   enable = arm64;
 };
 
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
grub-core/Makefile.core.def +2 -0
+  common = lib/fdt.c;
+  enable = fdt;
 };
 
 module = {
Quoted 10 lines · Vladimir 'phcoder' Serbinenko
Quoted 6 lines · Vladimir 'phcoder' Serbinenko
Quoted 3 lines · Fu Wei

Hi Vladimir,

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines · Fu Wei
Quoted 6 lines

Hi Vladimir,

Quoted 2 lines · Vladimir 'phcoder' Serbinenko

Le 4 nov. 2015 10:48 AM, "Fu Wei" <[email protected]> a

écrit :

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

Hi Vladimir,

Great thanks for your help :-)

Quoted 3 lines · Vladimir 'phcoder' Serbinenko
Quoted 1 line · Le 3 nov. 2015 9:56 AM, <[email protected]> a écrit :
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

From: Fu Wei <[email protected]>

This patch goes with commit:
4d0cb755387d6f109b901386ed4d3d475df239fe
arm64: Move FDT functions to separate module

linux and xen_boot modules can't work without this

patch.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Signed-off-by: Fu Wei <[email protected]>
---
grub-core/Makefile.core.def | 1 +
grub-core/loader/arm64/fdt.c | 5 +++++
2 files changed, 6 insertions(+)

Quoted 14 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

diff --git a/grub-core/Makefile.core.def
b/grub-core/Makefile.core.def
index 2ef10d1..3ea4e49 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -1674,6 +1674,7 @@ module = {

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

module = {
name = fdt;
arm64 = loader/arm64/fdt.c;
+ fdt = lib/fdt.c;
enable = arm64;
};

Please don't add same file to 2 different modules.

Remove it

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 3 lines

from
Linux
module

AFAIK, for now , only arm and arm64 are using lib/fdt.c So please allow me to separate all the fdt code from loader/arm/linux.c; just like arm64.

I don't think it's necessary at this point. Is xen_boot

going

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 3 lines
Quoted 3 lines

to
be
available for 32-bit arm as well?

And I would like to help to sort out the code for your new fdt module
, If you don't mind.

But according to my tests, I think we need "fdt = lib/fdt.c;"

in

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

module. If we don't separate fdt code from arm, we also need

"fdt

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

=
lib/fdt.c;" in linux module.

Please correct me if I misunderstand something, thanks

We need arm = lib/fdt.c in linux if we don't restructure. There

is

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

no
reason to include lib/fdt.c in 2 different modules on arm64. Fdt

in

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

first
part just mean arm and arm64 in this context

As an alternative: enable fdt module on all fdt platforms (enable

=

Quoted 123 lines
Quoted 109 lines
Quoted 109 lines
Quoted 95 lines
Quoted 95 lines
Quoted 89 lines

fdt)
and
put lib/fdt.c

Quoted 85 lines
Quoted 85 lines
Quoted 63 lines
Quoted 23 lines
Quoted 17 lines

This patch may become a patchset :-)

Quoted 9 lines
Quoted 9 lines

diff --git a/grub-core/loader/arm64/fdt.c
b/grub-core/loader/arm64/fdt.c
index 5202c14..d160ca0 100644
--- a/grub-core/loader/arm64/fdt.c
+++ b/grub-core/loader/arm64/fdt.c
@@ -25,6 +25,10 @@
#include <grub/file.h>
#include <grub/efi/efi.h>

Quoted 5 lines
Quoted 4 lines

+GRUB_MOD_LICENSE ("GPLv3+");
+
+static grub_dl_t my_mod;
+

What's the reason for my_mod?

Quoted 6 lines

this is for grub_dl_unref and grub_dl_ref. but I forgot to check
this
again for this, sorry,
will add this later

Quoted 34 lines

Forget dl_ref and dl_unref. Linux module having a function reference
is
already good enough

Quoted 30 lines
Quoted 12 lines
Quoted 12 lines

static void *loaded_fdt;
static void *fdt;

@@ -177,6 +181,7 @@ GRUB_MOD_INIT (fdt)
cmd_devicetree =
grub_register_command ("devicetree",
grub_cmd_devicetree,
0,
N_("Load DTB file."));
+ my_mod = mod;
}

Quoted 4 lines
Quoted 4 lines

GRUB_MOD_FINI (fdt)
--
2.4.3

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines
Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines
Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

autogen.sh +3 -3
index 5020456..5220e66 100755
@@ -23,14 +23,14 @@ fi
 if [ -d grub-core/lib/libgcrypt-grub/mpi/generic ]; then 
     rm -rf grub-core/lib/libgcrypt-grub/mpi/generic
 fi
-ln -s ../../../grub-core/lib/libgcrypt-grub/src/g10lib.h include/grub/gcrypt/g10lib.h
+cp grub-core/lib/libgcrypt-grub/src/g10lib.h include/grub/gcrypt/g10lib.h
 cp -R grub-core/lib/libgcrypt/mpi/generic grub-core/lib/libgcrypt-grub/mpi/generic
 
 for x in mpi-asm-defs.h mpih-add1.c mpih-sub1.c mpih-mul1.c mpih-mul2.c mpih-mul3.c mpih-lshift.c mpih-rshift.c; do
     if [ -h grub-core/lib/libgcrypt-grub/mpi/"$x" ] || [ -f grub-core/lib/libgcrypt-grub/mpi/"$x" ]; then
 	rm grub-core/lib/libgcrypt-grub/mpi/"$x"
     fi
-    ln -s generic/"$x" grub-core/lib/libgcrypt-grub/mpi/"$x"
+    cp grub-core/lib/libgcrypt-grub/mpi/generic/"$x" grub-core/lib/libgcrypt-grub/mpi/"$x"
 done
 
 echo "Generating Automake input..."
@@ -84,4 +84,4 @@ echo timestamp > stamp-h.in
 
 echo "Running autoreconf..."
 autoreconf -vi
-exit 0
+exit 0
\ No newline at end of file
grub-core/Makefile.core.def +2 -2
index 2ef10d1..03e04ab 100644
@@ -1665,7 +1665,6 @@ module = {
   ia64_efi = loader/ia64/efi/linux.c;
   arm = loader/arm/linux.c;
   arm64 = loader/arm64/linux.c;
-  fdt = lib/fdt.c;
   common = loader/linux.c;
   common = lib/cmdline.c;
   enable = noemu;
@@ -1674,7 +1673,8 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
-  enable = arm64;
+  common = lib/fdt.c;
+  enable = fdt;
 };
 
 module = {
author
#17 lore raw

Hi Vladimir,

Thanks for your help, I will test it on arm and arm64, then make a new patch

Quoted 334 lines · Vladimir 'phcoder' Serbinenko
Quoted 48 lines · Fu Wei

Hi Vladimir,

Quoted 41 lines · Vladimir 'phcoder' Serbinenko
Quoted 39 lines · Fu Wei

Hi Vladimir

Quoted 20 lines · Vladimir 'phcoder' Serbinenko
Quoted 18 lines · Fu Wei

Hi Vladimir

Please correct me :-)
Can I do this :

grub-core/Makefile.core.def +0 -1
index 2ef10d1..ea5831f 100644
@@ -1665,7 +1665,6 @@ module = {
   ia64_efi = loader/ia64/efi/linux.c;
   arm = loader/arm/linux.c;
   arm64 = loader/arm64/linux.c;
-  fdt = lib/fdt.c;
   common = loader/linux.c;
   common = lib/cmdline.c;
Quoted 9 lines

grub-core/Makefile.core.def module = { · line 1676

Quoted 7 lines
grub-core/Makefile.core.def +1 -1
   enable = noemu;
@@ -1674,7 +1673,9 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
-  enable = arm64;
+  arm = loader/arm/fdt.c;

Where does this file come from?

that is the file I am working on

i just tried to let you know my thought.

Quoted 8 lines
Quoted 3 lines
Quoted 2 lines

Is this way Ok for you? Please correct me if I misunderstand you

What is the reason to reshuffle fdt code for 32-bit arm?

reason:
we can delete fdt = lib/fdt.c; in linux module, make this only in fdt module.

You don't need to actually shuffle any code. Just see the attached patch

Quoted 274 lines
Quoted 2 lines

Does it merge any code with arm64?

No, because arm64 uses uefi runtime service, but arm doesn't

Quoted 1 line

Will this code be used by anything besides linux module?

For arm64, as you know, yes, by xen_boot, but for arm, NO

So maybe we can do this:

grub-core/Makefile.core.def +2 -2
index 3ea4e49..db36a68 100644
@@ -1664,8 +1664,8 @@ module = {
   sparc64_ieee1275 = loader/sparc64/ieee1275/linux.c;
   ia64_efi = loader/ia64/efi/linux.c;
   arm = loader/arm/linux.c;
+  arm = lib/fdt.c;
   arm64 = loader/arm64/linux.c;
-  fdt = lib/fdt.c;
   common = loader/linux.c;
   common = lib/cmdline.c;
   enable = noemu;
@@ -1674,7 +1674,7 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
-  fdt = lib/fdt.c;
+  common = lib/fdt.c;
   enable = arm64;
 };
 
Quoted 217 lines
Quoted 217 lines
Quoted 203 lines
Quoted 203 lines
grub-core/Makefile.core.def +2 -0
+  common = lib/fdt.c;
+  enable = fdt;
 };
 
 module = {
Quoted 94 lines · Vladimir 'phcoder' Serbinenko
Quoted 82 lines · Vladimir 'phcoder' Serbinenko
Quoted 70 lines · Fu Wei

Hi Vladimir,

Quoted 61 lines · Fu Wei

Hi Vladimir,

Quoted 57 lines · Vladimir 'phcoder' Serbinenko

Le 4 nov. 2015 10:48 AM, "Fu Wei" <[email protected]> a écrit :

Quoted 45 lines

Hi Vladimir,

Great thanks for your help :-)

Quoted 36 lines · Vladimir 'phcoder' Serbinenko

Le 3 nov. 2015 9:56 AM, <[email protected]> a écrit :

From: Fu Wei <[email protected]>

This patch goes with commit:
4d0cb755387d6f109b901386ed4d3d475df239fe
arm64: Move FDT functions to separate module

linux and xen_boot modules can't work without this
patch.

Signed-off-by: Fu Wei <[email protected]>
---
grub-core/Makefile.core.def | 1 +
grub-core/loader/arm64/fdt.c | 5 +++++
2 files changed, 6 insertions(+)

diff --git a/grub-core/Makefile.core.def
b/grub-core/Makefile.core.def
index 2ef10d1..3ea4e49 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -1674,6 +1674,7 @@ module = {
module = {
name = fdt;
arm64 = loader/arm64/fdt.c;
+ fdt = lib/fdt.c;
enable = arm64;
};

Please don't add same file to 2 different modules. Remove
it
from
Linux
module

Quoted 4 lines

AFAIK, for now , only arm and arm64 are using lib/fdt.c So please allow me to separate all the fdt code from loader/arm/linux.c; just like arm64.

I don't think it's necessary at this point. Is xen_boot going
to
be
available for 32-bit arm as well?

And I would like to help to sort out the code for your new fdt module
, If you don't mind.

Quoted 9 lines

But according to my tests, I think we need "fdt = lib/fdt.c;" in
module. If we don't separate fdt code from arm, we also need "fdt
=
lib/fdt.c;" in linux module.

Please correct me if I misunderstand something, thanks

Quoted 8 lines

We need arm = lib/fdt.c in linux if we don't restructure. There is
no
reason to include lib/fdt.c in 2 different modules on arm64. Fdt in
first
part just mean arm and arm64 in this context

Quoted 91 lines

As an alternative: enable fdt module on all fdt platforms (enable =
fdt)
and
put lib/fdt.c

Quoted 85 lines
Quoted 85 lines
Quoted 63 lines
Quoted 23 lines
Quoted 17 lines

This patch may become a patchset :-)

Quoted 14 lines

diff --git a/grub-core/loader/arm64/fdt.c
b/grub-core/loader/arm64/fdt.c
index 5202c14..d160ca0 100644
--- a/grub-core/loader/arm64/fdt.c
+++ b/grub-core/loader/arm64/fdt.c
@@ -25,6 +25,10 @@
#include <grub/file.h>
#include <grub/efi/efi.h>

+GRUB_MOD_LICENSE ("GPLv3+");
+
+static grub_dl_t my_mod;
+
What's the reason for my_mod?

Quoted 6 lines

this is for grub_dl_unref and grub_dl_ref. but I forgot to check
this
again for this, sorry,
will add this later

Quoted 34 lines

Forget dl_ref and dl_unref. Linux module having a function reference
is
already good enough

Quoted 30 lines
Quoted 16 lines

static void *loaded_fdt;
static void *fdt;

@@ -177,6 +181,7 @@ GRUB_MOD_INIT (fdt)
cmd_devicetree =
grub_register_command ("devicetree",
grub_cmd_devicetree,
0,
N_("Load DTB file."));
+ my_mod = mod;
}

GRUB_MOD_FINI (fdt)
--
2.4.3

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines
Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines
Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

Signature · 10 lines
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021
author
#18 lore raw

Hi Vladimir,
Since you have merged a patch for Makefile problem, we just need to fix the license problem.
I have sent the new little patch for that

Great thanks! :-) .

Quoted 355 lines · Fu Wei

Hi Vladimir,

Thanks for your help, I will test it on arm and arm64, then make a new patch

Quoted 52 lines · Vladimir 'phcoder' Serbinenko
Quoted 50 lines · Fu Wei

Hi Vladimir,

Quoted 43 lines · Vladimir 'phcoder' Serbinenko
Quoted 41 lines · Fu Wei

Hi Vladimir

Quoted 20 lines · Vladimir 'phcoder' Serbinenko
Quoted 18 lines · Fu Wei

Hi Vladimir

Please correct me :-)
Can I do this :

grub-core/Makefile.core.def +0 -1
index 2ef10d1..ea5831f 100644
@@ -1665,7 +1665,6 @@ module = {
   ia64_efi = loader/ia64/efi/linux.c;
   arm = loader/arm/linux.c;
   arm64 = loader/arm64/linux.c;
-  fdt = lib/fdt.c;
   common = loader/linux.c;
   common = lib/cmdline.c;
Quoted 9 lines

grub-core/Makefile.core.def module = { · line 1676

Quoted 7 lines
grub-core/Makefile.core.def +1 -1
   enable = noemu;
@@ -1674,7 +1673,9 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
-  enable = arm64;
+  arm = loader/arm/fdt.c;

Where does this file come from?

that is the file I am working on

i just tried to let you know my thought.

Is this way Ok for you? Please correct me if I misunderstand you

Quoted 282 lines
Quoted 6 lines
Quoted 1 line

What is the reason to reshuffle fdt code for 32-bit arm?

reason:
we can delete fdt = lib/fdt.c; in linux module, make this only in fdt module.

You don't need to actually shuffle any code. Just see the attached patch

Quoted 274 lines
Quoted 2 lines

Does it merge any code with arm64?

No, because arm64 uses uefi runtime service, but arm doesn't

Quoted 1 line

Will this code be used by anything besides linux module?

For arm64, as you know, yes, by xen_boot, but for arm, NO

So maybe we can do this:

grub-core/Makefile.core.def +2 -2
index 3ea4e49..db36a68 100644
@@ -1664,8 +1664,8 @@ module = {
   sparc64_ieee1275 = loader/sparc64/ieee1275/linux.c;
   ia64_efi = loader/ia64/efi/linux.c;
   arm = loader/arm/linux.c;
+  arm = lib/fdt.c;
   arm64 = loader/arm64/linux.c;
-  fdt = lib/fdt.c;
   common = loader/linux.c;
   common = lib/cmdline.c;
   enable = noemu;
@@ -1674,7 +1674,7 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
-  fdt = lib/fdt.c;
+  common = lib/fdt.c;
   enable = arm64;
 };
 
Quoted 217 lines
Quoted 217 lines
Quoted 203 lines
Quoted 203 lines
grub-core/Makefile.core.def +2 -0
+  common = lib/fdt.c;
+  enable = fdt;
 };
 
 module = {
Quoted 94 lines · Vladimir 'phcoder' Serbinenko
Quoted 82 lines · Vladimir 'phcoder' Serbinenko
Quoted 70 lines · Fu Wei

Hi Vladimir,

Quoted 61 lines · Fu Wei

Hi Vladimir,

Quoted 57 lines · Vladimir 'phcoder' Serbinenko

Le 4 nov. 2015 10:48 AM, "Fu Wei" <[email protected]> a écrit :

Quoted 49 lines

Hi Vladimir,

Great thanks for your help :-)

On 4 November 2015 at 02:07, Vladimir 'phcoder' Serbinenko
<[email protected]> wrote:

Le 3 nov. 2015 9:56 AM, <[email protected]> a écrit :

From: Fu Wei <[email protected]>

This patch goes with commit:
4d0cb755387d6f109b901386ed4d3d475df239fe
arm64: Move FDT functions to separate module

linux and xen_boot modules can't work without this
patch.

Signed-off-by: Fu Wei <[email protected]>
---
grub-core/Makefile.core.def | 1 +
grub-core/loader/arm64/fdt.c | 5 +++++
2 files changed, 6 insertions(+)

diff --git a/grub-core/Makefile.core.def
b/grub-core/Makefile.core.def
index 2ef10d1..3ea4e49 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -1674,6 +1674,7 @@ module = {
module = {
name = fdt;
arm64 = loader/arm64/fdt.c;
+ fdt = lib/fdt.c;
enable = arm64;
};

Please don't add same file to 2 different modules. Remove
it
from
Linux
module

AFAIK, for now , only arm and arm64 are using lib/fdt.c
So please allow me to separate all the fdt code from
loader/arm/linux.c; just like arm64.

I don't think it's necessary at this point. Is xen_boot going
to
be
available for 32-bit arm as well?

And I would like to help to sort out the code for your new fdt module
, If you don't mind.

Quoted 9 lines

But according to my tests, I think we need "fdt = lib/fdt.c;" in
module. If we don't separate fdt code from arm, we also need "fdt
=
lib/fdt.c;" in linux module.

Please correct me if I misunderstand something, thanks

Quoted 8 lines

We need arm = lib/fdt.c in linux if we don't restructure. There is
no
reason to include lib/fdt.c in 2 different modules on arm64. Fdt in
first
part just mean arm and arm64 in this context

Quoted 91 lines

As an alternative: enable fdt module on all fdt platforms (enable =
fdt)
and
put lib/fdt.c

Quoted 85 lines
Quoted 85 lines
Quoted 63 lines
Quoted 23 lines
Quoted 23 lines

This patch may become a patchset :-)

diff --git a/grub-core/loader/arm64/fdt.c
b/grub-core/loader/arm64/fdt.c
index 5202c14..d160ca0 100644
--- a/grub-core/loader/arm64/fdt.c
+++ b/grub-core/loader/arm64/fdt.c
@@ -25,6 +25,10 @@
#include <grub/file.h>
#include <grub/efi/efi.h>

+GRUB_MOD_LICENSE ("GPLv3+");
+
+static grub_dl_t my_mod;
+
What's the reason for my_mod?

this is for grub_dl_unref and grub_dl_ref. but I forgot to
check
this
again for this, sorry,
will add this later

Quoted 34 lines

Forget dl_ref and dl_unref. Linux module having a function reference
is
already good enough

Quoted 30 lines

static void *loaded_fdt;
static void *fdt;

@@ -177,6 +181,7 @@ GRUB_MOD_INIT (fdt)
cmd_devicetree =
grub_register_command ("devicetree",
grub_cmd_devicetree,
0,
N_("Load DTB file."));
+ my_mod = mod;
}

GRUB_MOD_FINI (fdt)
--
2.4.3

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021

--
Best regards,

Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines
Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines
Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

Signature · 10 lines
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021
author
#19 lore raw

Hi Vladimir,

But I think maybe we still need to make a loader/arm/fdt.c, but because if we don't , we will get "incompatible license" error.

Quoted 377 lines · Fu Wei

Hi Vladimir,
Since you have merged a patch for Makefile problem, we just need to fix the license problem.
I have sent the new little patch for that

Great thanks! :-) .

Quoted 347 lines · Fu Wei

Hi Vladimir,

Thanks for your help, I will test it on arm and arm64, then make a new patch

Quoted 52 lines · Vladimir 'phcoder' Serbinenko
Quoted 50 lines · Fu Wei

Hi Vladimir,

Quoted 43 lines · Vladimir 'phcoder' Serbinenko
Quoted 41 lines · Fu Wei

Hi Vladimir

Quoted 20 lines · Vladimir 'phcoder' Serbinenko
Quoted 18 lines · Fu Wei

Hi Vladimir

Please correct me :-)
Can I do this :

grub-core/Makefile.core.def +0 -1
index 2ef10d1..ea5831f 100644
@@ -1665,7 +1665,6 @@ module = {
   ia64_efi = loader/ia64/efi/linux.c;
   arm = loader/arm/linux.c;
   arm64 = loader/arm64/linux.c;
-  fdt = lib/fdt.c;
   common = loader/linux.c;
   common = lib/cmdline.c;
Quoted 9 lines

grub-core/Makefile.core.def module = { · line 1676

Quoted 7 lines
grub-core/Makefile.core.def +1 -1
   enable = noemu;
@@ -1674,7 +1673,9 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
-  enable = arm64;
+  arm = loader/arm/fdt.c;

Where does this file come from?

that is the file I am working on

i just tried to let you know my thought.

Is this way Ok for you? Please correct me if I misunderstand you

Quoted 282 lines
Quoted 6 lines
Quoted 1 line

What is the reason to reshuffle fdt code for 32-bit arm?

reason:
we can delete fdt = lib/fdt.c; in linux module, make this only in fdt module.

You don't need to actually shuffle any code. Just see the attached patch

Quoted 274 lines
Quoted 2 lines

Does it merge any code with arm64?

No, because arm64 uses uefi runtime service, but arm doesn't

Quoted 1 line

Will this code be used by anything besides linux module?

For arm64, as you know, yes, by xen_boot, but for arm, NO

So maybe we can do this:

grub-core/Makefile.core.def +2 -2
index 3ea4e49..db36a68 100644
@@ -1664,8 +1664,8 @@ module = {
   sparc64_ieee1275 = loader/sparc64/ieee1275/linux.c;
   ia64_efi = loader/ia64/efi/linux.c;
   arm = loader/arm/linux.c;
+  arm = lib/fdt.c;
   arm64 = loader/arm64/linux.c;
-  fdt = lib/fdt.c;
   common = loader/linux.c;
   common = lib/cmdline.c;
   enable = noemu;
@@ -1674,7 +1674,7 @@ module = {
 module = {
   name = fdt;
   arm64 = loader/arm64/fdt.c;
-  fdt = lib/fdt.c;
+  common = lib/fdt.c;
   enable = arm64;
 };
 
Quoted 217 lines
Quoted 217 lines
Quoted 203 lines
Quoted 203 lines
grub-core/Makefile.core.def +2 -0
+  common = lib/fdt.c;
+  enable = fdt;
 };
 
 module = {
Quoted 94 lines · Vladimir 'phcoder' Serbinenko
Quoted 82 lines · Vladimir 'phcoder' Serbinenko
Quoted 70 lines · Fu Wei

Hi Vladimir,

Quoted 61 lines · Fu Wei

Hi Vladimir,

Quoted 57 lines · Vladimir 'phcoder' Serbinenko

Le 4 nov. 2015 10:48 AM, "Fu Wei" <[email protected]> a
écrit :

Hi Vladimir,

Great thanks for your help :-)

On 4 November 2015 at 02:07, Vladimir 'phcoder' Serbinenko
<[email protected]> wrote:

Le 3 nov. 2015 9:56 AM, <[email protected]> a écrit :

From: Fu Wei <[email protected]>

This patch goes with commit:
4d0cb755387d6f109b901386ed4d3d475df239fe
arm64: Move FDT functions to separate module

linux and xen_boot modules can't work without this
patch.

Signed-off-by: Fu Wei <[email protected]>
---
grub-core/Makefile.core.def | 1 +
grub-core/loader/arm64/fdt.c | 5 +++++
2 files changed, 6 insertions(+)

diff --git a/grub-core/Makefile.core.def
b/grub-core/Makefile.core.def
index 2ef10d1..3ea4e49 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -1674,6 +1674,7 @@ module = {
module = {
name = fdt;
arm64 = loader/arm64/fdt.c;
+ fdt = lib/fdt.c;
enable = arm64;
};

Please don't add same file to 2 different modules. Remove
it
from
Linux
module

AFAIK, for now , only arm and arm64 are using lib/fdt.c
So please allow me to separate all the fdt code from
loader/arm/linux.c; just like arm64.

I don't think it's necessary at this point. Is xen_boot
going
to
be
available for 32-bit arm as well?

And I would like to help to sort out the code for your new fdt module
, If you don't mind.

Quoted 9 lines

But according to my tests, I think we need "fdt = lib/fdt.c;" in
module. If we don't separate fdt code from arm, we also need "fdt
=
lib/fdt.c;" in linux module.

Please correct me if I misunderstand something, thanks

Quoted 8 lines

We need arm = lib/fdt.c in linux if we don't restructure. There is
no
reason to include lib/fdt.c in 2 different modules on arm64. Fdt in
first
part just mean arm and arm64 in this context

Quoted 91 lines

As an alternative: enable fdt module on all fdt platforms (enable =
fdt)
and
put lib/fdt.c

Quoted 85 lines
Quoted 85 lines
Quoted 63 lines
Quoted 57 lines

This patch may become a patchset :-)

diff --git a/grub-core/loader/arm64/fdt.c
b/grub-core/loader/arm64/fdt.c
index 5202c14..d160ca0 100644
--- a/grub-core/loader/arm64/fdt.c
+++ b/grub-core/loader/arm64/fdt.c
@@ -25,6 +25,10 @@
#include <grub/file.h>
#include <grub/efi/efi.h>

+GRUB_MOD_LICENSE ("GPLv3+");
+
+static grub_dl_t my_mod;
+
What's the reason for my_mod?

this is for grub_dl_unref and grub_dl_ref. but I forgot to
check
this
again for this, sorry,
will add this later

Forget dl_ref and dl_unref. Linux module having a function
reference
is
already good enough
static void *loaded_fdt;
static void *fdt;

@@ -177,6 +181,7 @@ GRUB_MOD_INIT (fdt)
cmd_devicetree =
grub_register_command ("devicetree",
grub_cmd_devicetree,
0,
N_("Load DTB file."));
+ my_mod = mod;
}

GRUB_MOD_FINI (fdt)
--
2.4.3

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021

--
Best regards,

Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines
Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines
Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Quoted 8 lines

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

Signature · 10 lines
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021