[SeaBIOS] [PATCH v4 1/2] pciinit: refactor mem init code

Michael S. Tsirkin mst at redhat.com
Thu Aug 8 08:13:56 CEST 2013


On Wed, Aug 07, 2013 at 09:59:09PM -0400, Kevin O'Connor wrote:
> On Mon, Jul 29, 2013 at 12:33:46PM +0300, Michael S. Tsirkin wrote:
> > Refactor memory initialization code:
> > - split window initialization from other setup
> > - pass all window data around by pointer
> > 
> > This is in preparation for getting window data
> > from qemu.
> 
> I'm struggling to understand this patch.  Why does it setup the ranges
> in 'struct pci_mem mem' and then pass 'mem' around to a bunch of
> functions, when it ultimately populates the four global pcimem*
> variables anyway?  It seems the patch would be simpler if it just
> populated the globals at the start and used the global variables
> everywhere.  (The subsequent "load memory window" patch can read
> etc/pci-info and populate the globals as well.)
> 
> -Kevin

I generally dislike globals so I thought it's a step in the correct
direction.  A subsequent patch can get rid of the globals completely and
pass everything by pointer.
But OK, I'll split this change out and leave it for another day.



More information about the SeaBIOS mailing list