qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [SeaBIOS] [PATCH v2 1/5] linker: utility to patch in-me


From: Kevin O'Connor
Subject: Re: [Qemu-devel] [SeaBIOS] [PATCH v2 1/5] linker: utility to patch in-memory ROM files
Date: Thu, 25 Jul 2013 20:06:27 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Jul 25, 2013 at 03:55:56PM +0300, Michael S. Tsirkin wrote:
> On Mon, Jul 15, 2013 at 11:01:02AM +0300, Michael S. Tsirkin wrote:
> > On Sun, Jul 14, 2013 at 02:24:52PM -0400, Kevin O'Connor wrote:
> > > I'd prefer to see this tracked within the "linker" code and not in the
> > > generic romfile struct.
> > 
> > A way to associate a romfile instance with a value seems generally
> > useful, no?  Still, that's not too hard - it would only mean an extra
> > linked list of 
> > 
> > struct linker {
> >     char name[56]
> >     void *data;
> >     struct hlist_node node;
> > }
> > 
> > is this preferable?

Sure, but it's probably easier to do something like:

struct linkfiles { char *name; void *data; };

void linker_loader_execute(const char *name)
{
    int size;
    struct linker_loader_entry_s *entries = romfile_loadfile(name, &size);
    int numentries = size/sizeof(entries[0]);
    if (! entries)
        return;
    struct linkfiles *files = malloc_tmp(sizeof(files[0]) * numentries);

and then just populate and use the array of filenames.

> > > Also, is there another name besides "linker" that could be used?
> > > SeaBIOS has code to self-relocate and fixup code relocations.  I think
> > > having code in the repo called "linker" could cause confusion.
> > > 
> > 
> > romfile_loader?

Shrug.  How about "tabledeploy"?

-Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]