[PATCH 2/2] Export _NCPUWORDS for Ada

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Oct 30 09:07:45 UTC 2015


On 30/10/15 09:53, Jan Sommer wrote:
> Am Friday 30 October 2015, 07:50:16 schrieb Sebastian Huber:
>> >How is this tackled in the glibc/Linux support? Is the exact layout of
>> >the structures really interesting for Ada? I guess its sufficient to
>> >tell Ada the size and alignment of pthread_attr_t for example.
>> >
> In Linux they do it like this:
>     type pthread_attr_t is record
>        Data : char_array (1 .. OS_Constants.PTHREAD_ATTR_SIZE);
>     end record;
>     pragma Convention (C, pthread_attr_t);
>     for pthread_attr_t'Alignment use Interfaces.C.unsigned_long'Alignment;
>
> That's probably the best solution. The gnat-rts changes values of the fields only using the corresponding pthread_set functions.
> If no one objects I would try to change the osinte-rtems.ads in the same manner.

This would be my preferred solution.

-- 
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 devel mailing list