9
0
Fork 0

ARM: compile in image size and magic into barebox image

This is useful to detect a barebox image and to be able
to copy only the image size if barebox is stored on
raw partitions which are bigger than the image.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2011-04-04 10:51:47 +02:00
parent c1bcb052dd
commit 64476d2177
3 changed files with 10 additions and 0 deletions

View File

@ -48,6 +48,12 @@ void __naked __section(.text_entry) exception_vectors(void)
"1: bne 1b\n" /* irq (interrupt) */
"1: bne 1b\n" /* fiq (fast interrupt) */
#endif
".word 0x65726162\n" /* 'bare' */
".word 0x00786f62\n" /* 'box' */
".word _text\n" /* text base. If copied there,
* barebox can skip relocation
*/
".word _barebox_image_size\n" /* image size to copy */
);
}

View File

@ -93,4 +93,5 @@ SECTIONS
.bss : { *(.bss*) }
__bss_stop = .;
_end = .;
_barebox_image_size = __bss_start - _text;
}

View File

@ -4,5 +4,8 @@
extern char _text[], _stext[], _etext[];
extern char __bss_start[], __bss_stop[];
extern char _end[];
extern void *_barebox_image_size;
#define barebox_image_size (unsigned int)&_barebox_image_size
#endif /* _ASM_GENERIC_SECTIONS_H_ */