posix_memalign

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Apr 30 07:41:00 UTC 2013


On 04/29/2013 10:57 PM, Daron Chabot wrote:
> Hi,
>
> I'm working with RTEMS 4.9.3 and the mvme3100 BSP
>
> In trying to emulate the vxworks function, memalign( ), and it looks like:
>
> 1) there is no equivalent in RTEMS, but it's prototyped in newlib
> 2) posix_memalign( ) is defined in cpukit/libcsupport/src, but does not appear
> in any headers and cannot be linked against. It's definitely in librtemscpu.a:
>
> ---------------------------------------
> dchabot at dev32new--> nm /usr/powerpc-rtems4.9/mvme3100/lib/librtemscpu.a
> libcsupport_a-posix_memalign.o:
> 00000000 T posix_memalign
>           U rtems_malloc_statistics
>           U rtems_memalign
> ---------------------------------------

What is the linker problem with this function?

>
> 3) rtems_memalign( ) appears to be the only functional variant
>
> Is there a more elegant solution here than creating my own memalign( ) wrapper
> around rtems_memalign( ) ? It seems like an error to not have a posix_memalign(
> ) available...

Since memalign() has a prototype in Newlib's <malloc.h> you can simply add an 
implementation to cpukit/libcsupport and a test case to 
testsuites/libtests/memalign01 if you want.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the users mailing list