* [ECOS] Using standard malloc()
@ 2005-05-11 8:53 Balasaravanan P
2005-05-12 5:08 ` Andrew Lunn
0 siblings, 1 reply; 4+ messages in thread
From: Balasaravanan P @ 2005-05-11 8:53 UTC (permalink / raw)
To: ecos-discuss
Hi,
I am writing an abstraction layer for an existing application this
requires me to use malloc to create threads.
I tried using the standard LIBC malloc which returns NULL. I tried
printing the mallinfo structure and it shows 0 for all its members.
Is there any other way to use standard malloc or am I missing any
configuration steps.
Thanks in advance.
Best Regards,
Bala.
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ECOS] Using standard malloc()
2005-05-11 8:53 [ECOS] Using standard malloc() Balasaravanan P
@ 2005-05-12 5:08 ` Andrew Lunn
2005-05-12 10:59 ` Balasaravanan P
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2005-05-12 5:08 UTC (permalink / raw)
To: Balasaravanan P; +Cc: ecos-discuss
On Wed, May 11, 2005 at 11:34:30AM +0530, Balasaravanan P wrote:
> Hi,
>
> I am writing an abstraction layer for an existing application this
> requires me to use malloc to create threads.
>
> I tried using the standard LIBC malloc which returns NULL. I tried
> printing the mallinfo structure and it shows 0 for all its members.
>
> Is there any other way to use standard malloc or am I missing any
> configuration steps.
You are missing something somewhere. malloc should work. What is the
target and the configuration? Do an ecosconfig export and post the
result.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ECOS] Using standard malloc()
2005-05-12 5:08 ` Andrew Lunn
@ 2005-05-12 10:59 ` Balasaravanan P
2005-05-19 10:57 ` Balasaravanan P
0 siblings, 1 reply; 4+ messages in thread
From: Balasaravanan P @ 2005-05-12 10:59 UTC (permalink / raw)
To: Balasaravanan P, ecos-discuss
Hi Andrew,
Thanks for the reply.
I am using MIPS 4kc processor.
I also tried enabling "CYGBLD_ISO_MALLOC_HEADER" but could give correct value.
I have pasted the ecosconfig export ecm file below.
=========================================
cdl_savefile_version 1;
cdl_savefile_command cdl_savefile_version {};
cdl_savefile_command cdl_savefile_command {};
cdl_savefile_command cdl_configuration { description hardware template
package };
cdl_savefile_command cdl_package { value_source user_value
wizard_value inferred_value };
cdl_savefile_command cdl_component { value_source user_value
wizard_value inferred_value };
cdl_savefile_command cdl_option { value_source user_value wizard_value
inferred_value };
cdl_savefile_command cdl_interface { value_source user_value
wizard_value inferred_value };
cdl_configuration eCos {
description "" ;
hardware mips32_4kc ;
template kernel ;
package -hardware CYGPKG_HAL_MIPS v2_0 ;
package -hardware CYGPKG_HAL_MIPS_MIPS32 v2_0 ;
package -hardware CYGPKG_HAL_MIPS v2_0 ;
package CYGPKG_HAL v2_0 ;
package CYGPKG_IO v2_0 ;
package CYGPKG_IO_SERIAL v2_0 ;
package CYGPKG_INFRA v2_0 ;
package CYGPKG_KERNEL v2_0 ;
package CYGPKG_ERROR v2_0 ;
package CYGPKG_MEMALLOC v2_0 ;
package CYGPKG_ISOINFRA v2_0 ;
};
cdl_option CYGFUN_HAL_COMMON_KERNEL_SUPPORT {
user_value 1
};
cdl_option CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK {
user_value 0
};
cdl_option CYGHWR_HAL_MIPS_MIPS32_CORE {
user_value 4Kc
};
cdl_component CYGSEM_KERNEL_SCHED_TIMESLICE {
user_value 1
};
cdl_component CYGPKG_KERNEL_INSTRUMENT {
user_value 0
};
cdl_option CYGDBG_KERNEL_INSTRUMENT_SMP {
user_value 0
};
cdl_component CYGDBG_KERNEL_INSTRUMENT_MSGS {
user_value 0
};
cdl_option CYGSEM_MEMALLOC_ALLOCATOR_FIXED_THREADAWARE {
user_value 0
};
cdl_option CYGSEM_MEMALLOC_ALLOCATOR_VARIABLE_THREADAWARE {
user_value 0
};
cdl_option CYGSEM_MEMALLOC_ALLOCATOR_VARIABLE_COALESCE {
user_value 0
};
cdl_option CYGBLD_MEMALLOC_MALLOC_IMPLEMENTATION_HEADER {
user_value <cyg/memalloc/dlmalloc.hxx>
};
cdl_option CYGIMP_MEMALLOC_MALLOC_VARIABLE_SIMPLE {
user_value 0
};
cdl_option CYGIMP_MEMALLOC_MALLOC_DLMALLOC {
user_value 1
};
cdl_option CYGBLD_ISO_ERRNO_CODES_HEADER {
inferred_value 1 <cyg/error/codes.h>
};
cdl_option CYGBLD_ISO_ERRNO_HEADER {
inferred_value 1 <cyg/error/errno.h>
};
cdl_option CYGBLD_ISO_RAND_HEADER {
user_value 0 0
};
cdl_option CYGBLD_ISO_MALLOC_HEADER {
user_value 0 0
};
cdl_option CYGBLD_ISO_STDLIB_SYSTEM_HEADER {
user_value 0 0
};
cdl_option CYGBLD_ISO_STRERROR_HEADER {
inferred_value 1 <cyg/error/strerror.h>
};
Best Regards,
Bala.
On 5/12/05, Andrew Lunn <andrew@lunn.ch> wrote:
> On Wed, May 11, 2005 at 11:34:30AM +0530, Balasaravanan P wrote:
> > Hi,
> >
> > I am writing an abstraction layer for an existing application this
> > requires me to use malloc to create threads.
> >
> > I tried using the standard LIBC malloc which returns NULL. I tried
> > printing the mallinfo structure and it shows 0 for all its members.
> >
> > Is there any other way to use standard malloc or am I missing any
> > configuration steps.
>
> You are missing something somewhere. malloc should work. What is the
> target and the configuration? Do an ecosconfig export and post the
> result.
>
> Andrew
>
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ECOS] Using standard malloc()
2005-05-12 10:59 ` Balasaravanan P
@ 2005-05-19 10:57 ` Balasaravanan P
0 siblings, 0 replies; 4+ messages in thread
From: Balasaravanan P @ 2005-05-19 10:57 UTC (permalink / raw)
To: Balasaravanan P, ecos-discuss
FYI,
The problem I faced was not due the configuration.
The Doug Lea's malloc implementation which I was using failed to
allocate memory because one of its variable "remainder_size" was
declared "long" which probably should have been "unsigned long" due to
this a condition to check for the top fails always since the address
which it checks was showing a negative.
When it was made "unsigned long" malloc works fine.
Thanks and Regards,
Bala.
On 5/12/05, Balasaravanan P <pbalasaravanan@gmail.com> wrote:
> Hi Andrew,
>
> Thanks for the reply.
>
> I am using MIPS 4kc processor.
> I also tried enabling "CYGBLD_ISO_MALLOC_HEADER" but could give correct value.
>
> I have pasted the ecosconfig export ecm file below.
>
> =========================================
>
> cdl_savefile_version 1;
> cdl_savefile_command cdl_savefile_version {};
> cdl_savefile_command cdl_savefile_command {};
> cdl_savefile_command cdl_configuration { description hardware template
> package };
> cdl_savefile_command cdl_package { value_source user_value
> wizard_value inferred_value };
> cdl_savefile_command cdl_component { value_source user_value
> wizard_value inferred_value };
> cdl_savefile_command cdl_option { value_source user_value wizard_value
> inferred_value };
> cdl_savefile_command cdl_interface { value_source user_value
> wizard_value inferred_value };
>
> cdl_configuration eCos {
> description "" ;
> hardware mips32_4kc ;
> template kernel ;
> package -hardware CYGPKG_HAL_MIPS v2_0 ;
> package -hardware CYGPKG_HAL_MIPS_MIPS32 v2_0 ;
> package -hardware CYGPKG_HAL_MIPS v2_0 ;
> package CYGPKG_HAL v2_0 ;
> package CYGPKG_IO v2_0 ;
> package CYGPKG_IO_SERIAL v2_0 ;
> package CYGPKG_INFRA v2_0 ;
> package CYGPKG_KERNEL v2_0 ;
> package CYGPKG_ERROR v2_0 ;
> package CYGPKG_MEMALLOC v2_0 ;
> package CYGPKG_ISOINFRA v2_0 ;
> };
>
> cdl_option CYGFUN_HAL_COMMON_KERNEL_SUPPORT {
> user_value 1
> };
>
> cdl_option CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK {
> user_value 0
> };
>
> cdl_option CYGHWR_HAL_MIPS_MIPS32_CORE {
> user_value 4Kc
> };
>
> cdl_component CYGSEM_KERNEL_SCHED_TIMESLICE {
> user_value 1
> };
>
> cdl_component CYGPKG_KERNEL_INSTRUMENT {
> user_value 0
> };
>
> cdl_option CYGDBG_KERNEL_INSTRUMENT_SMP {
> user_value 0
> };
>
> cdl_component CYGDBG_KERNEL_INSTRUMENT_MSGS {
> user_value 0
> };
>
> cdl_option CYGSEM_MEMALLOC_ALLOCATOR_FIXED_THREADAWARE {
> user_value 0
> };
>
> cdl_option CYGSEM_MEMALLOC_ALLOCATOR_VARIABLE_THREADAWARE {
> user_value 0
> };
>
> cdl_option CYGSEM_MEMALLOC_ALLOCATOR_VARIABLE_COALESCE {
> user_value 0
> };
>
> cdl_option CYGBLD_MEMALLOC_MALLOC_IMPLEMENTATION_HEADER {
> user_value <cyg/memalloc/dlmalloc.hxx>
> };
>
> cdl_option CYGIMP_MEMALLOC_MALLOC_VARIABLE_SIMPLE {
> user_value 0
> };
>
> cdl_option CYGIMP_MEMALLOC_MALLOC_DLMALLOC {
> user_value 1
> };
>
> cdl_option CYGBLD_ISO_ERRNO_CODES_HEADER {
> inferred_value 1 <cyg/error/codes.h>
> };
>
> cdl_option CYGBLD_ISO_ERRNO_HEADER {
> inferred_value 1 <cyg/error/errno.h>
> };
>
> cdl_option CYGBLD_ISO_RAND_HEADER {
> user_value 0 0
> };
>
> cdl_option CYGBLD_ISO_MALLOC_HEADER {
> user_value 0 0
> };
>
> cdl_option CYGBLD_ISO_STDLIB_SYSTEM_HEADER {
> user_value 0 0
> };
>
> cdl_option CYGBLD_ISO_STRERROR_HEADER {
> inferred_value 1 <cyg/error/strerror.h>
> };
>
>
> Best Regards,
> Bala.
>
>
> On 5/12/05, Andrew Lunn <andrew@lunn.ch> wrote:
> > On Wed, May 11, 2005 at 11:34:30AM +0530, Balasaravanan P wrote:
> > > Hi,
> > >
> > > I am writing an abstraction layer for an existing application this
> > > requires me to use malloc to create threads.
> > >
> > > I tried using the standard LIBC malloc which returns NULL. I tried
> > > printing the mallinfo structure and it shows 0 for all its members.
> > >
> > > Is there any other way to use standard malloc or am I missing any
> > > configuration steps.
> >
> > You are missing something somewhere. malloc should work. What is the
> > target and the configuration? Do an ecosconfig export and post the
> > result.
> >
> > Andrew
> >
>
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-05-19 6:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-11 8:53 [ECOS] Using standard malloc() Balasaravanan P
2005-05-12 5:08 ` Andrew Lunn
2005-05-12 10:59 ` Balasaravanan P
2005-05-19 10:57 ` Balasaravanan P
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).