[PATCH 14/16] ARM: compile in image size and magic into barebox image

Marc Reilly marc at cpdesign.com.au
Mon Apr 11 04:42:12 EDT 2011


Hi,

> > > @@ -38,6 +38,12 @@ void __naked __section(.text_entry)
> > > exception_vectors(void) "ldr pc, =not_used\n"			/* (reserved) */
> > > 
> > >  		"ldr pc, =irq\n"			/* irq (interrupt) */
> > >  		"ldr pc, =fiq\n"			/* fiq (fast interrupt) */
> > > 
> > > +		".word 0x65726162\n"			/* 'BARE' */
> > > +		".word 0x00786f62\n"			/* 'BOX' */
> 
> I just see that the comment is wrong. It's actually in lower case
> letters.
> 

True.
(This is why I'm always reluctant to ack patches - I'm not very thorough :)

> > > +		".word _text\n"				/* text base. If copied there,
> > > +							 * barebox can skip relocation
> > > +							 */
> > > +		".word _barebox_image_size\n"		/* image size to copy */
> > > 
> > >  	);
> > >  
> > >  }
> > 
> > I like this, is there a way to include a version string/info also?
> > 
> > (The aim is to be able to derive the barebox version of an image from
> > just reading the file).
> 
> Should be possible. One problem might be that the length of the version
> string is variable, so if we put it here, it must be the piece of
> information here.

"it must be the _last_ piece of information here"?
 
Could also dedicate a fixed maximum size, although that's the kind of thing 
that becomes a pain later. 

> 
> > > +extern void *_barebox_image_size;
> > > +
> > > +#define barebox_image_size	(unsigned int)&_barebox_image_size
> > 
> > I don't understand this line. Did you mean something like:
> > 
> > #define barebox_image_size *((unsigned int *)_barebox_image_size)
> > 
> > Or am I missing something?
> 
> _barebox_image_size is filled in by the linker. It can be seen as a
> pointer which address corresponds to the image size. I know this looks
> strange and I don't really like this. 


Ah, _now_ I get it. It looks strange but makes sense with your explanation 
above, and I reckon that's OK. 

> Maybe it can be done better?

Roberts suggestion to give it a comment is probably the best and simplest. The 
alternate way I come up with isn't any better.

Cheers
Marc





More information about the barebox mailing list