From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNhCh-00048i-Dc for qemu-devel@nongnu.org; Sun, 22 Sep 2013 06:47:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VNhCb-0003Pc-ER for qemu-devel@nongnu.org; Sun, 22 Sep 2013 06:47:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNhCb-0003PY-6B for qemu-devel@nongnu.org; Sun, 22 Sep 2013 06:47:45 -0400 Date: Sun, 22 Sep 2013 13:49:58 +0300 From: "Michael S. Tsirkin" Message-ID: <20130922104958.GA6413@redhat.com> References: <1373211589-8097-1-git-send-email-mst@redhat.com> <1373211589-8097-2-git-send-email-mst@redhat.com> <20130714182452.GB7607@morn.localdomain> <20130715080102.GA31638@redhat.com> <20130725125555.GA761@redhat.com> <20130726000627.GA14029@morn.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130726000627.GA14029@morn.localdomain> Subject: Re: [Qemu-devel] [SeaBIOS] [PATCH v2 1/5] linker: utility to patch in-memory ROM files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin O'Connor Cc: seabios@seabios.org, qemu-devel@nongnu.org On Thu, Jul 25, 2013 at 08:06:27PM -0400, Kevin O'Connor wrote: > 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. OK I'll do this but it's more code as I can't use plain romfile_find anymore, and have to code up my own lookup. > > > > 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