Re: [PATCH] ARM: put a valid "barebox" signature in the header on big-endian systems.

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

 



On Sun, May 13, 2012 at 12:05:33PM +0200, Krzysztof Halasa wrote:
> Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> writes:
> 
> >> +++ b/arch/arm/include/asm/barebox-arm-head.h
> >> @@ -24,8 +24,7 @@ static inline void barebox_arm_head(void)
> >>  		"1: b 1b\n"
> >>  		"1: b 1b\n"
> >>  #endif
> >> -		".word 0x65726162\n"			/* 'bare' */
> >> -		".word 0x00786f62\n"			/* 'box' */
> >> +		".asciz \"barebox\"\n"
> >>  		".word _text\n"				/* text base. If copied there,
> >>  							 * barebox can skip relocation
> >>  							 */
> > Another downside of this patch (apart from the file type detection that
> > still needs adaption?) is that the magic is different depending on
> > endianess.
> 
> Actually it's the opposite - i.e., the magic is now always "barebox\0"
> and doesn't depend on endianness :-)
> 
> Without this patch, the magic changes with endianness (it becomes
> "erab\0xob" on BE).

This may have the upside that with this we are able to detect foreign
endian images like done in the zImage support. Here we use this to know
that we have to swap byte endianess before jumping to the kernel.

I probably should have chosen some arbitrary number rather than a
string, then nobody would have wondered about this ;)

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux