Skip to contentSkip to conversation

omap4: board: change global data pointer to file scope

PATCH New Nishanth Menon 4 participants 8 messages Oct 25, 2010 – Nov 19, 2010 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 omap4: board: change global data pointer to file scope

DECLARE_GLOBAL_DATA_PTR is currently defined within the scope of function while it is a global pointer. Change the scope of definition to replicate it's global scope. This seems to help gcc 4.5 optimizations as well.

---
 arch/arm/cpu/armv7/omap4/board.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/cpu/armv7/omap4/board.c +2 -1
index 24a66f5..f967d09 100644
@@ -32,6 +32,8 @@
 #include <asm/arch/sys_proto.h>
 #include <asm/sizes.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * Routine: s_init
  * Description: Does early system init of muxing and clocks.
@@ -100,7 +102,6 @@ u32 sdram_size(void)
  */
 int dram_init(void)
 {
-	DECLARE_GLOBAL_DATA_PTR;
 
 #if defined(CONFIG_SYS_ARM_WITHOUT_RELOC)
 	gd->bd->bi_dram[0].start = 0x80000000;
Signature · 1 line
1.6.3.3
#1 lore raw

PATCH 1/1 omap4: board: change global data pointer to file scope

Quoted 6 lines · Nishanth

DECLARE_GLOBAL_DATA_PTR is currently defined within the scope of function while it is a global pointer. Change the scope of definition to replicate it's global scope. This seems to help gcc 4.5 optimizations as well.

gentle ping - I dont see comments on this, is it ok to pull this in?

Quoted 30 lines

---
?arch/arm/cpu/armv7/omap4/board.c | ? ?3 ++-
?1 files changed, 2 insertions(+), 1 deletions(-)

arch/arm/cpu/armv7/omap4/board.c +0 -0
index 24a66f5..f967d09 100644
@@ -32,6 +32,8 @@

?#include <asm/arch/sys_proto.h>
?#include <asm/sizes.h>

arch/arm/cpu/armv7/omap4/board.c +2 -0
+DECLARE_GLOBAL_DATA_PTR;
+

?/*
?* Routine: s_init
?* Description: Does early system init of muxing and clocks.

arch/arm/cpu/armv7/omap4/board.c +0 -0
@@ -100,7 +102,6 @@ u32 sdram_size(void)

?*/
?int dram_init(void)
?{
- ? ? ? DECLARE_GLOBAL_DATA_PTR;

?#if defined(CONFIG_SYS_ARM_WITHOUT_RELOC)
? ? ? ?gd->bd->bi_dram[0].start = 0x80000000;
--
1.6.3.3

#2 lore raw

PATCH 1/1 omap4: board: change global data pointer to file scope

Dear "Menon, Nishanth",

Quoted 9 lines · In message <[email protected]> you…
Quoted 6 lines · Nishanth

DECLARE_GLOBAL_DATA_PTR is currently defined within the scope of function while it is a global pointer. Change the scope of definition to replicate it's global scope. This seems to help gcc 4.5 optimizations as well.

gentle ping - I dont see comments on this, is it ok to pull this in?

This is OK.

The use of DECLARE_GLOBAL_DATA_PTR at function scope (instead file scope) is known to cause incorrect code in some compiler / architecture versions. We consider it a bug.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If you want strict real-time behavior, run in the real  time  schedu-
ling class.  But there are no seatbelts or airbags;  main(){for(;;);}
can hard hang your system.                          -- Bart Smaalders
#3 lore raw

PATCH 1/1 omap4: board: change global data pointer to file scope

In reply to Menon
Quoted 9 lines · Nishanth
Quoted 6 lines · Nishanth

DECLARE_GLOBAL_DATA_PTR is currently defined within the scope of function while it is a global pointer. Change the scope of definition to replicate it's global scope. This seems to help gcc 4.5 optimizations as well.

gentle ping - I dont see comments on this, is it ok to pull this in?

Tested on Panda, no issues found.

Steve

#4 lore raw

PATCH 1/1 omap4: board: change global data pointer to file scope

In reply to Nishanth Menon
Quoted 8 lines

DECLARE_GLOBAL_DATA_PTR is currently defined within the scope of function while it is a global pointer. Change the scope of definition to replicate it's global scope. This seems to help gcc 4.5 optimizations as well.

Quoted 5 lines
---
 arch/arm/cpu/armv7/omap4/board.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Pushed to u-boot-ti

#5 lore raw

PATCH 1/1 omap4: board: change global data pointer to file scope

Dear Sandeep,

Quoted 2 lines · In message <[email protected]> you…

Pushed to u-boot-ti

In this case it would make sense to set the state of this patch in Patchwork to "Awaiting Upstream". Thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A rolling stone gathers momentum.
#6 lore raw

PATCH 1/1 omap4: board: change global data pointer to file scope

Quoted 7 lines

Dear Sandeep,

In message <[email protected]>

Quoted 1 line · you
Quoted 8 lines
Quoted 1 line

Pushed to u-boot-ti

In this case it would make sense to set the state of this patch in Patchwork to "Awaiting Upstream". Thanks.

Best regards,

Wolfgang Denk

Wolfgang,

I am working through the todo list on patchworks.

Regards,
Sandeep

#7 lore raw

PATCH 1/1 omap4: board: change global data pointer to file scope

Dear "Paulraj, Sandeep",

Quoted 5 lines · In message <[email protected]> you…
Quoted 5 lines
Quoted 2 lines

Pushed to u-boot-ti

In this case it would make sense to set the state of this patch in Patchwork to "Awaiting Upstream". Thanks.

...

Quoted 1 line

I am working through the todo list on patchworks.

Thanks.

Note that this was a "should", not a "must".

Also, there are a few options to do that automatically - either as post-commit triggers in your git repository, or as a script that iterates on a list of commits. See
http://www.denx.de/wiki/view/U-Boot/Patches#pwclient and
http://www.denx.de/wiki/view/U-Boot/Patches#pwparser , but be aware that these scripts may need tuning for your environment (i. e. you would probably want to change the state to "Awaiting Upstream", and do this only if the previous state was still "New").

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Bureaucracy is the enemy of innovation."
       - Mark Shepherd, former President and CEO of Texas Instruments