[U-Boot] [PATCH v6 3/8] x86: slimbootloader: Add memory configuration

Park, Aiden aiden.park at intel.com
Fri Jul 26 11:54:19 UTC 2019


Hi Andy,

> -----Original Message-----
> From: Andy Shevchenko [mailto:andy.shevchenko at gmail.com]
> Sent: Friday, July 26, 2019 7:30 PM
> To: Park, Aiden <aiden.park at intel.com>
> Cc: Bin Meng <bmeng.cn at gmail.com>; U-Boot Mailing List <u-
> boot at lists.denx.de>; Simon Glass <sjg at chromium.org>
> Subject: Re: [PATCH v6 3/8] x86: slimbootloader: Add memory configuration
> 
> On Fri, Jul 26, 2019 at 10:00 AM Park, Aiden <aiden.park at intel.com> wrote:
> >
> > Slim Bootloader provides memory map info thru its HOB list pointer.
> > Configure memory size and relocation memory from the HOB data, and
> > provide e820 entries as well.
> > - Get memory size from the memory map info HOB
> > - Set available top memory lower than 4GB for U-Boot relocation
> > - Provide e820 entries from the memory map info HOB
> 
> 
> > +#define while_each_memory_map_entry_reversed(iter, entries) \
> > +       (iter) = (entries)->count; \
> > +       while ((iter)--) \
> > +               if ((entries)->entry[(iter)].type != E820_RAM) \
> > +                       continue; \
> > +               else \
> 
> In case of macro it's better to go with for-loop.
> Also, no need to have parenthesis around iterator (we expect it to be plain
> variable.
> continue can be replaced with {}.
> 
> See, for wxample,
> https://elixir.bootlin.com/linux/latest/source/include/linux/pci.h#L634
> 
Thanks for giving better reference. Let me update this as your suggestion.

> > +
> > +DECLARE_GLOBAL_DATA_PTR;
> > +
> 
> And move the macro definition closer to its first use.
> 
Let me move the macro before its first use.

> --
> With Best Regards,
> Andy Shevchenko

Best Regards,
Aiden


More information about the U-Boot mailing list