[PATCH 1/4] common/board_f: remove XTRN_DECLARE_GLOBAL_DATA_PTR dead code

Tom Rini trini at konsulko.com
Mon Sep 12 18:30:20 CEST 2022


On Mon, Sep 12, 2022 at 11:22:53AM +0200, Wolfgang Denk wrote:
> Dear Ovidiu,
> 
> In message <20220911161052.2986264-1-ovpanait at gmail.com> you wrote:
> > The XTRN_DECLARE_GLOBAL_DATA_PTR declarations in ppc code are permanently
> > commented out, so there are no users for this macro:
> >   #if 1
> >     #define DECLARE_GLOBAL_DATA_PTR   register volatile gd_t *gd asm ("r2")
> >   #else
> >     #define XTRN_DECLARE_GLOBAL_DATA_PTR   extern
> >     #define DECLARE_GLOBAL_DATA_PTR     XTRN_DECLARE_GLOBAL_DATA_PTR \
> >                                         gd_t *gd
> >   #endif
> >
> > Remove all references.
> 
> Actually the commented out code contained some information, and I
> feel it would be a pity if that got lost:
> 
> > -#if 1
> >  #define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("r2")
> > -#else /* We could use plain global data, but the resulting code is bigger */
> > -#define XTRN_DECLARE_GLOBAL_DATA_PTR	extern
> > -#define DECLARE_GLOBAL_DATA_PTR     XTRN_DECLARE_GLOBAL_DATA_PTR \
> > -				    gd_t *gd
> > -#endif
> 
> Maybe we can keep the information that using global data for the GD
> pointer would be possible too (and simpler, as it does not require
> the reservation of a specific register for it), but that the
> implementation uses a register nevertheless because this results in
> smaller code?
> 
> Maybe add such a comment instead ?
> 

This is slightly mentioned in doc/develop/global_data.rst currently, but
a follow-up to expand on this would be good.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220912/290d5f39/attachment.sig>


More information about the U-Boot mailing list