On 10/24/07, Jonathan Larmour <[EMAIL PROTECTED]> 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.
--
Øyvind Harboe
http://www.zylin.com - eCos ARM & FPGA developer kit
Index: common/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/services/memalloc/common/current/ChangeLog,v
retrieving revision 1.39
diff -w -u -r1.39 ChangeLog
--- common/current/ChangeLog 17 May 2006 16:14:02 -0000 1.39
+++ common/current/ChangeLog 24 Oct 2007 12:34:46 -0000
@@ -1,3 +1,7 @@
+2007-10-24 Oyvind Harboe <[EMAIL PROTECTED]>
+
+ * Init priority for pool initialization is now CYG_INIT_MEMALLOC
+ instead of CYG_INIT_LIBC
2006-05-17 Andrew Lunn <[EMAIL PROTECTED]>
* doc/memalloc.sgml: Fix parameters for calloc. Reported by
Index: common/current/src/heapgen.tcl
===================================================================
RCS file:
/cvs/ecos/ecos/packages/services/memalloc/common/current/src/heapgen.tcl,v
retrieving revision 1.9
diff -w -u -r1.9 heapgen.tcl
--- common/current/src/heapgen.tcl 4 Oct 2004 11:48:33 -0000 1.9
+++ common/current/src/heapgen.tcl 24 Oct 2007 12:34:46 -0000
@@ -172,7 +172,7 @@
foreach heap $heaps {
puts $cfile "#ifdef HAL_MEM_REAL_REGION_TOP\n"
- puts $cfile [ format "%s CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_MEMALLOC)
cygmem_pool_%s ( (cyg_uint8 *)CYGMEM_SECTION_%s ," \
+ puts $cfile [ format "%s CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_MEMALLOC-200)
cygmem_pool_%s ( (cyg_uint8 *)CYGMEM_SECTION_%s ," \
$malloc_impl_class $heap $heap ]
puts $cfile [ format " HAL_MEM_REAL_REGION_TOP( (cyg_uint8
*)CYGMEM_SECTION_%s + CYGMEM_SECTION_%s_SIZE ) - (cyg_uint8 *)CYGMEM_SECTION_%s
) " \
$heap $heap $heap ]
@@ -180,7 +180,7 @@
puts $cfile "#else\n"
- puts $cfile [ format "%s CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_MEMALLOC)
cygmem_pool_%s ( (cyg_uint8 *)CYGMEM_SECTION_%s , CYGMEM_SECTION_%s_SIZE ) ;\n"
\
+ puts $cfile [ format "%s CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_MEMALLOC-200)
cygmem_pool_%s ( (cyg_uint8 *)CYGMEM_SECTION_%s , CYGMEM_SECTION_%s_SIZE ) ;\n"
\
$malloc_impl_class $heap $heap $heap ]
puts $cfile "#endif"
Index: common/current/src/malloc.cxx
===================================================================
RCS file:
/cvs/ecos/ecos/packages/services/memalloc/common/current/src/malloc.cxx,v
retrieving revision 1.5
diff -w -u -r1.5 malloc.cxx
--- common/current/src/malloc.cxx 23 May 2002 23:08:45 -0000 1.5
+++ common/current/src/malloc.cxx 24 Oct 2007 12:34:46 -0000
@@ -86,7 +86,7 @@
// the memory pool object itself
CYGCLS_MEMALLOC_MALLOC_IMPL cyg_memalloc_mallocpool
- CYGBLD_ATTRIB_INIT_BEFORE( CYG_INIT_LIBC ) =
+ CYGBLD_ATTRIB_INIT_BEFORE( CYG_INIT_MEMALLOC ) =
CYGCLS_MEMALLOC_MALLOC_IMPL( cyg_memalloc_mallocpool_memory,
sizeof( cyg_memalloc_mallocpool_memory ) );
@@ -103,7 +103,7 @@
# include <cyg/memalloc/memjoin.hxx>
Cyg_Mempool_Joined<CYGCLS_MEMALLOC_MALLOC_IMPL> cyg_memalloc_mallocpool
- CYGBLD_ATTRIB_INIT_BEFORE( CYG_INIT_LIBC ) =
+ CYGBLD_ATTRIB_INIT_BEFORE( CYG_INIT_MEMALLOC ) =
Cyg_Mempool_Joined<CYGCLS_MEMALLOC_MALLOC_IMPL>(
CYGMEM_HEAP_COUNT, cygmem_memalloc_heaps
);