public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] Consolidate arch-specific mem_malloc_init() implementations
Date: Sat, 22 Aug 2009 12:51:46 +0200	[thread overview]
Message-ID: <20090822085428.GA11950@game.jcrosoft.org> (raw)
In-Reply-To: <1250913921-15689-4-git-send-email-ptyser@xes-inc.com>

On 23:05 Fri 21 Aug     , Peter Tyser wrote:
> Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
> ---
>  common/dlmalloc.c      |   15 +++++++++++++++
>  include/malloc.h       |    2 ++
>  lib_arm/board.c        |   10 ----------
>  lib_avr32/board.c      |   15 ++-------------
>  lib_blackfin/board.c   |    9 ---------
>  lib_m68k/board.c       |   14 +-------------
>  lib_microblaze/board.c |   20 +++++---------------
>  lib_mips/board.c       |   14 +-------------
>  lib_nios/board.c       |   14 ++------------
>  lib_nios2/board.c      |   14 ++------------
>  lib_ppc/board.c        |   14 +-------------
>  lib_sh/board.c         |    9 ---------
>  lib_sparc/board.c      |   21 +--------------------
>  13 files changed, 32 insertions(+), 139 deletions(-)
> 
> diff --git a/common/dlmalloc.c b/common/dlmalloc.c
> index f3bced4..241db8c 100644
> --- a/common/dlmalloc.c
> +++ b/common/dlmalloc.c
> @@ -1520,6 +1520,21 @@ void *sbrk(ptrdiff_t increment)
>  	return (void *)old;
>  }
>  
> +#ifndef CONFIG_X86
could we have a generic name (not arch)
CONFIG_GENERIC_MALLOC_INIT

and then define it in the configs/arch.h
> +/*
> + * x86 boards use a slightly different init sequence thus they implement
> + * their own version of mem_malloc_init()
> + */
> +void mem_malloc_init(ulong start, ulong size)
> +{
> +	mem_malloc_start = start;
> +	mem_malloc_end = start + size;
> +	mem_malloc_brk = start;
> +
> +	memset((void *)mem_malloc_start, 0, size);
> +}
> +#endif
> +
>  /* field-extraction macros */
>  
>  #define first(b) ((b)->fd)
> diff --git a/include/malloc.h b/include/malloc.h
> index 0382169..3e145ad 100644
> --- a/include/malloc.h
> +++ b/include/malloc.h
> @@ -944,6 +944,8 @@ extern ulong mem_malloc_start;
>  extern ulong mem_malloc_end;
>  extern ulong mem_malloc_brk;
>  
Best Regards,
J.

  reply	other threads:[~2009-08-22 10:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-22  4:05 [U-Boot] [PATCH 0/3] Clean up up malloc pool init Peter Tyser
2009-08-22  4:05 ` [U-Boot] [PATCH 1/3] Consolidate arch-specific sbrk() implementations Peter Tyser
2009-09-04 19:45   ` Wolfgang Denk
2009-08-22  4:05 ` [U-Boot] [PATCH 2/3] Standardize mem_malloc_init() implementation Peter Tyser
2009-09-04 19:46   ` Wolfgang Denk
2009-08-22  4:05 ` [U-Boot] [PATCH 3/3] Consolidate arch-specific mem_malloc_init() implementations Peter Tyser
2009-08-22 10:51   ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2009-08-22 11:54     ` Wolfgang Denk
2009-08-22 12:32       ` Jean-Christophe PLAGNIOL-VILLARD
2009-08-22 12:49         ` Wolfgang Denk
2009-08-22 16:45     ` Peter Tyser
2009-08-22 22:48       ` Graeme Russ
2009-09-04 19:47   ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090822085428.GA11950@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox