[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110627232903.GB7736@n2100.arm.linux.org.uk>
Date: Tue, 28 Jun 2011 00:29:03 +0100
From: Russell King - ARM Linux <linux@....linux.org.uk>
To: Grant Likely <grant.likely@...retlab.ca>
Cc: Ohad Ben-Cohen <ohad@...ery.com>,
davinci-linux-open-source
<davinci-linux-open-source@...ux.davincidsp.com>,
Arnd Bergmann <arnd@...db.de>,
Brian Swetland <swetland@...gle.com>,
Rusty Russell <rusty@...tcorp.com.au>,
linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
linux-omap@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [RFC 1/8] drivers: add generic remoteproc framework
On Mon, Jun 27, 2011 at 02:49:58PM -0600, Grant Likely wrote:
> > +struct {
> > + char magic[4] = { 'R', 'P', 'R', 'C' };
> > + u32 version;
> > + u32 header_len;
> > + char header[...] = { header_len bytes of unformatted, textual header };
> > + struct section {
> > + u32 type;
> > + u64 da;
> > + u32 len;
> > + u8 content[...] = { len bytes of binary data };
> > + } [ no limit on number of sections ];
> > +} __packed;
>
> Other have commented on the image format, so I'll skip this bit other
> than saying that I agree it would be great to have a common format.
(Don't have the original message to reply to...)
Do we really want to end up with header being 5 bytes, header_len set
as 5, and having to load/store all this data using byte loads/stores ?
If we don't want that, then I suggest we get rid of the packed attribute,
and require stuff to be naturally aligned.
First issue is that struct section could be much better layed out:
struct section {
u32 type;
u32 len;
u64 da;
u8 content[];
};
and require sizeof(struct section) % sizeof(u64) == 0 - iow, to find
the next section, round len up to sizeof(u64). Ditto for the header.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists