[PATCH 10/12] ARM: add early malloc support needed by the decompressor

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Mon Jul 30 04:19:42 EDT 2012


On 10:02 Mon 30 Jul     , Sascha Hauer wrote:
> On Fri, Jul 27, 2012 at 08:33:08PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > This is not needed by lzo but by gunzip, xz and others.
> > 
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
> > ---
> >  arch/arm/cpu/start.c |    7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
> > index a54f5fd..f500ca8 100644
> > --- a/arch/arm/cpu/start.c
> > +++ b/arch/arm/cpu/start.c
> > @@ -28,6 +28,9 @@
> >  #include <asm-generic/memory_layout.h>
> >  #include <asm/sections.h>
> >  
> > +unsigned long free_mem_ptr;
> > +unsigned long free_mem_end_ptr;
> > +
> >  #ifdef CONFIG_PBL_IMAGE
> >  void __naked __section(.text_head_entry) pbl_start(void)
> >  {
> > @@ -193,6 +196,10 @@ void __naked __section(.text_ll_return) board_init_lowlevel_return(void)
> >  	/* clear bss */
> >  	memset(__bss_start, 0, __bss_stop - __bss_start);
> >  
> > +	/* set 128 KiB before the STACK_BASE - 16 address for early malloc */
> > +	free_mem_ptr = STACK_BASE - 0x20000 - 16;
> > +	free_mem_end_ptr = STACK_BASE - 16;
> > +
> 
> This assumes that the malloc area is directly before the stack. How
> about using __bss_stop or _end instead?

it's just for early alloc and __bss_stop no so maybe we can use the same as
Malloc but we already use this for HEAD_TEXT_BASE

Best Regards,
J.



More information about the barebox mailing list