This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Re: Patch: init priority fix for memory pools
- From: "Øyvind Harboe" <oyvind dot harboe at zylin dot com>
- To: "Jonathan Larmour" <jifl at ecoscentric dot com>
- Cc: ecos-patches at ecos dot sourceware dot org
- Date: Wed, 24 Oct 2007 18:22:06 +0200
- Subject: Re: Patch: init priority fix for memory pools
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=kqpG83QddX6m3s1gYXa4ovJbsCtjSxfMRNkGnFAyBtg=; b=ojIwiYtnZnzVugnFyDS1nJIg+VNwjW7t3hWeX/m5Fqbom/i7+jXHxkm/9mfr0tByTHzZhTvMjcTVv8EzZfRX2WDRL4LlYirTUBeOcFIKBY77W9BVYZ6TBvg3ea98F9CLiUiicp6azhwki8dFoZ8EbT7Tx3naG18mzyuCLlwUkMU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=sSOb37mUmC+LBt9ZahiYmEsK2lyM+OwwTOAi/6gewdIy7fsCv2cqz/hUQktuzxGZ/EgTSJe/CiHtILaTNcLCM1Gl96Q3H4lU0XRyb5FLfFhbGxuKH+mzj178U0SX4g3E3UwI+8CdwvDcz7rn5E+n3O/7qH7q43xXdUss+vkPmjY=
- References: <c09652430710240442r2befefe6m8f45820b758d1659@mail.gmail.com> <471F3DE8.7070809@eCosCentric.com> <c09652430710240546r10fa4284yb312b6e0cfd48017@mail.gmail.com> <471F47F6.1060707@eCosCentric.com> <c09652430710240914n22d2ae09o705c9076060b2e0d@mail.gmail.com> <471F70A7.4030709@eCosCentric.com>
On 10/24/07, Jonathan Larmour <jifl@ecoscentric.com> wrote:
> Øyvind Harboe wrote:
> > On 10/24/07, Jonathan Larmour <jifl@ecoscentric.com> wrote:
> >
> >>Øyvind Harboe wrote:
> >>
> >>>On 10/24/07, Jonathan Larmour <jifl@ecoscentric.com> wrote:
> >>>
> >>>
> >>>>Øyvind Harboe wrote:
> >>>>
> >>>>
> >>>>>Why was it CYG_INIT_LIBC?
> >>>>>
> >>>>>CYG_INIT_MEMALLOC seems like the right thing, e.g. jffs2 allocates
> >>>>>memory and CYG_INIT_LIBC is after IO.
> >>>>>
> >>>>>I discovered this when working w/multiple heaps.
> >>>>
> >>>>Yes, I can't remember any rationale for doing it before CYG_INIT_LIBC
> >>>>instead. Probably was just some old leftover. Applied, thanks.
> >>>
> >>>
> >>>Ooops. I screwed up the first patch. The tcl script needs to be fixed as well.
> >>
> >>Done, albeit slightly differently.
> >
> >
> > It's broken now. The problem is that it needs to be "before
> > before"(-200), not "before" -100.
>
> Oh, I didn't notice your patch kept it as CYGBLD_ATTRIB_INIT_BEFORE. It
> should be CYGBLD_ATTRIB_INIT_PRI, as per below. Checked in.
Hmmm... I think I need to test this tomorrow. I wonder if there are
three things that need to happen in order: heap init, joined heap
init, malloc init. Not sure if the last one and joined heap init are
the same though.
>
> Jifl
>
> Index: src/malloc.cxx
> ===================================================================
> RCS file:
> /cvs/ecos/ecos/packages/services/memalloc/common/current/src/malloc.cxx,v
> retrieving revision 1.6
> diff -u -5 -p -r1.6 malloc.cxx
> --- src/malloc.cxx 24 Oct 2007 12:42:38 -0000 1.6
> +++ src/malloc.cxx 24 Oct 2007 16:17:48 -0000
> @@ -84,11 +84,11 @@
> cyg_uint8 cyg_memalloc_mallocpool_memory[
> CYGNUM_MEMALLOC_FALLBACK_MALLOC_POOL_SIZE ] CYGBLD_ATTRIB_WEAK;
>
> // the memory pool object itself
> CYGCLS_MEMALLOC_MALLOC_IMPL cyg_memalloc_mallocpool
> - CYGBLD_ATTRIB_INIT_BEFORE( CYG_INIT_MEMALLOC ) =
> + CYGBLD_ATTRIB_INIT_PRI( CYG_INIT_MEMALLOC ) =
> CYGCLS_MEMALLOC_MALLOC_IMPL( cyg_memalloc_mallocpool_memory,
> sizeof( cyg_memalloc_mallocpool_memory ) );
>
> # define POOL cyg_memalloc_mallocpool
>
> @@ -101,11 +101,11 @@ CYGCLS_MEMALLOC_MALLOC_IMPL cyg_memalloc
> // multiple heaps
>
> # include <cyg/memalloc/memjoin.hxx>
>
> Cyg_Mempool_Joined<CYGCLS_MEMALLOC_MALLOC_IMPL> cyg_memalloc_mallocpool
> - CYGBLD_ATTRIB_INIT_BEFORE( CYG_INIT_MEMALLOC ) =
> + CYGBLD_ATTRIB_INIT_PRI( CYG_INIT_MEMALLOC ) =
> Cyg_Mempool_Joined<CYGCLS_MEMALLOC_MALLOC_IMPL>(
> CYGMEM_HEAP_COUNT, cygmem_memalloc_heaps
> );
>
> # define POOL cyg_memalloc_mallocpool
>
> --
> eCosCentric Limited http://www.eCosCentric.com/ The eCos experts
> Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571
> Registered in England and Wales: Reg No 4422071.
> ------["The best things in life aren't things."]------ Opinions==mine
>
--
Øyvind Harboe
http://www.zylin.com - eCos ARM & FPGA developer kit