All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] [ARM] Fix DECLARE_GLOBAL_DATA_PTR and make gd global
@ 2007-09-15  5:44 Dirk Behme
  2007-09-15  7:43 ` Wolfgang Denk
  0 siblings, 1 reply; 4+ messages in thread
From: Dirk Behme @ 2007-09-15  5:44 UTC (permalink / raw)
  To: u-boot


Some users [1] with (some?) ARM toolchains report issues with

#define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("r8")

in include/asm-arm/global_data.h

The issue seems to be [2]

-- cut --
The gcc documentation [3] clearly states that local register variables
are not guaranteed to contain the values you think they do, except in
certain circumstances. In particular: "Stores into local register
variables may be deleted when they appear to be dead according to
dataflow analysis."
-- cut --

This patch makes DECLARE_GLOBAL_DATA_PTR empty, so no local register
variable any more, and makes gd global.

Original patch by Paul Brook <paul@codesourcery.com>

Signed-off-by: Dirk Behme <dirk.behme@gmail.com>

[1]
http://linux.omap.com/pipermail/davinci-linux-open-source/2007-September/004068.html
http://www.codesourcery.com/archives/arm-gnu/msg00736.html

[2]
http://www.codesourcery.com/archives/arm-gnu/msg00741.html
http://linux.omap.com/pipermail/davinci-linux-open-source/2007-September/004072.html

[3]
http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Local-Reg-Vars.html#Local-Reg-Vars

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: arm_global_data_pointer_patch.txt
Url: http://lists.denx.de/pipermail/u-boot/attachments/20070915/f342351a/attachment.txt 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] [PATCH] [ARM] Fix DECLARE_GLOBAL_DATA_PTR and make gd global
  2007-09-15  5:44 [U-Boot-Users] [PATCH] [ARM] Fix DECLARE_GLOBAL_DATA_PTR and make gd global Dirk Behme
@ 2007-09-15  7:43 ` Wolfgang Denk
  2007-09-15  9:43   ` Dirk Behme
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Denk @ 2007-09-15  7:43 UTC (permalink / raw)
  To: u-boot

In message <46EB7145.1050307@googlemail.com> you wrote:
>
> Some users [1] with (some?) ARM toolchains report issues with
> #define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("r8")
> in include/asm-arm/global_data.h
> The issue seems to be [2]

Can you please point out specific boards that show this problem?

> This patch makes DECLARE_GLOBAL_DATA_PTR empty, so no local register
> variable any more, and makes gd global.

Actually this should not be  needed  any  more  as  all  use  of  the
DECLARE_GLOBAL_DATA_PTR  (should)  have  been  moved outside function
bodies, so we already use a global definition. If there are remaining
places where this has been forgotten I'd rather fix these.


Best regards,

Wolfgang Denk

-- 
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
Youth doesn't excuse everything.
	-- Dr. Janice Lester (in Kirk's body), "Turnabout Intruder",
	   stardate 5928.5.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] [PATCH] [ARM] Fix DECLARE_GLOBAL_DATA_PTR and make gd global
  2007-09-15  7:43 ` Wolfgang Denk
@ 2007-09-15  9:43   ` Dirk Behme
  2007-09-15 16:45     ` Wolfgang Denk
  0 siblings, 1 reply; 4+ messages in thread
From: Dirk Behme @ 2007-09-15  9:43 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk wrote:
> In message <46EB7145.1050307@googlemail.com> you wrote:
> 
>>Some users [1] with (some?) ARM toolchains report issues with
>>#define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("r8")
>>in include/asm-arm/global_data.h
>>The issue seems to be [2]
> 
> Can you please point out specific boards that show this problem?

[1] was on unknown board with CodeSourcery ARM toolchain 2006q1-3

[2] was on TI DaVinci board with MontaVista ARM toolchain 
3.4.3-25.0.104.0600975 2006-07-06

>>This patch makes DECLARE_GLOBAL_DATA_PTR empty, so no local register
>>variable any more, and makes gd global.
> 
> Actually this should not be  needed  any  more  as  all  use  of  the
> DECLARE_GLOBAL_DATA_PTR  (should)  have  been  moved outside function
> bodies, so we already use a global definition. If there are remaining
> places where this has been forgotten I'd rather fix these.

Thanks for the hint! I scanned for in-function DECLARE_GLOBAL_DATA_PTR 
and got following files

./cpu/bf537/i2c.c
./cpu/bf537/serial.c
./cpu/bf561/serial.c
./cpu/mcf532x/cpu.c
./cpu/mcf532x/speed.c
./cpu/mpc86xx/cpu_init.c
./cpu/mpc86xx/speed.c
./cpu/mpc86xx/traps.c
./cpu/arm720t/serial.c
./lib_blackfin/post.c.
./lib_blackfin/board.c
./board/mpl/vcma9/cmd_vcma9.c
./board/amcc/yucca/yucca.c
./board/amcc/taishan/taishan.c
./board/amcc/katmai/katmai.c
./board/davinci/schmoogie/dv_board.c
./board/davinci/dv-evm/dv_board.c
./board/davinci/sonata/dv_board.c
./board/sbc2410x/sbc2410x.c
./board/bf561-ezkit/bf561-ezkit.c
./board/bf537-stamp/bf537-stamp.c
./board/mpc7448hpc2/tsi108_init.c
./board/mpc7448hpc2/mpc7448hpc2.c
./board/siemens/SMN42/smn42.c
./board/freescale/mpc8313erdb/sdram.c
./board/bf533-ezkit/bf533-ezkit.c
./board/bf533-stamp/bf533-stamp.c
./board/lpc2292sodimm/lpc2292sodimm.c
./drivers/qe/qe.c

See below as well. Patch for DaVinci follows.

Cheers

Dirk

[1] http://www.codesourcery.com/archives/arm-gnu/msg00736.html

[2]
http://linux.omap.com/pipermail/davinci-linux-open-source/2007-September/004068.html
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: function_local_global_data_ptr.txt
Url: http://lists.denx.de/pipermail/u-boot/attachments/20070915/e22839a3/attachment.txt 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] [PATCH] [ARM] Fix DECLARE_GLOBAL_DATA_PTR and make gd global
  2007-09-15  9:43   ` Dirk Behme
@ 2007-09-15 16:45     ` Wolfgang Denk
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2007-09-15 16:45 UTC (permalink / raw)
  To: u-boot

Dear Dirk,

in message <46EBA945.30009@googlemail.com> you wrote:
> 
> > Actually this should not be  needed  any  more  as  all  use  of  the
> > DECLARE_GLOBAL_DATA_PTR  (should)  have  been  moved outside function
> > bodies, so we already use a global definition. If there are remaining
> > places where this has been forgotten I'd rather fix these.
> 
> Thanks for the hint! I scanned for in-function DECLARE_GLOBAL_DATA_PTR 
> and got following files

Argh... Thanks for bringing this to my attention. Seems some  cleanup
is needed ...

Best regards,

Wolfgang Denk

-- 
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
Where people stand is not as important as which way they face.
        - Terry Pratchett & Stephen Briggs, _The Discworld Companion_

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-09-15 16:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-15  5:44 [U-Boot-Users] [PATCH] [ARM] Fix DECLARE_GLOBAL_DATA_PTR and make gd global Dirk Behme
2007-09-15  7:43 ` Wolfgang Denk
2007-09-15  9:43   ` Dirk Behme
2007-09-15 16:45     ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.