Re: [U-Boot] [PATCH 28/48] x86: Allow use of global_data with EFI

2015-07-23 Thread Bin Meng
Hi Simon,

On Wed, Jul 22, 2015 at 11:49 PM, Simon Glass s...@chromium.org wrote:
 On x86 the global_data pointer is provided through a somewhat-bizarre and
 x86-specific mechanism: the frame segment is set to a pointer to the start

frame segment? I don't think F stands for frame.

 of global_data, so that accesses can use this build-in register.

 When running as an EFI payload we don't want to mess with the Global
 Descriptor Table (GDT) and there is little advantage (in terms of code size)
 to doing so.

 Allow global_data to be a simple variable in this case.

 Signed-off-by: Simon Glass s...@chromium.org
 ---

  arch/x86/include/asm/global_data.h | 7 +++
  1 file changed, 7 insertions(+)

 diff --git a/arch/x86/include/asm/global_data.h 
 b/arch/x86/include/asm/global_data.h
 index abd70b9..6df6a78 100644
 --- a/arch/x86/include/asm/global_data.h
 +++ b/arch/x86/include/asm/global_data.h
 @@ -76,6 +76,12 @@ struct arch_global_data {
  #include asm-generic/global_data.h

  #ifndef __ASSEMBLY__
 +# ifdef CONFIG_ARCH_EFI
 +
 +#define gd global_data_ptr

OK, I got you here :) See comments in patch#18 @
http://patchwork.ozlabs.org/patch/498657/

I think this patch should come before patch#18. Please adjust the order.

 +
 +#define DECLARE_GLOBAL_DATA_PTR   extern struct global_data *global_data_ptr
 +# else
  static inline __attribute__((no_instrument_function)) gd_t 
 *get_fs_gd_ptr(void)
  {
 gd_t *gd_ptr;
 @@ -88,6 +94,7 @@ static inline __attribute__((no_instrument_function)) gd_t 
 *get_fs_gd_ptr(void)
  #define gd get_fs_gd_ptr()

  #define DECLARE_GLOBAL_DATA_PTR
 +# endif

  #endif


Regards,
Bin
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 28/48] x86: Allow use of global_data with EFI

2015-07-22 Thread Simon Glass
On x86 the global_data pointer is provided through a somewhat-bizarre and
x86-specific mechanism: the frame segment is set to a pointer to the start
of global_data, so that accesses can use this build-in register.

When running as an EFI payload we don't want to mess with the Global
Descriptor Table (GDT) and there is little advantage (in terms of code size)
to doing so.

Allow global_data to be a simple variable in this case.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/x86/include/asm/global_data.h | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/x86/include/asm/global_data.h 
b/arch/x86/include/asm/global_data.h
index abd70b9..6df6a78 100644
--- a/arch/x86/include/asm/global_data.h
+++ b/arch/x86/include/asm/global_data.h
@@ -76,6 +76,12 @@ struct arch_global_data {
 #include asm-generic/global_data.h
 
 #ifndef __ASSEMBLY__
+# ifdef CONFIG_ARCH_EFI
+
+#define gd global_data_ptr
+
+#define DECLARE_GLOBAL_DATA_PTR   extern struct global_data *global_data_ptr
+# else
 static inline __attribute__((no_instrument_function)) gd_t *get_fs_gd_ptr(void)
 {
gd_t *gd_ptr;
@@ -88,6 +94,7 @@ static inline __attribute__((no_instrument_function)) gd_t 
*get_fs_gd_ptr(void)
 #define gd get_fs_gd_ptr()
 
 #define DECLARE_GLOBAL_DATA_PTR
+# endif
 
 #endif
 
-- 
2.4.3.573.g4eafbef

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot