RTEMS Classic API bindings

Joel Sherrill joel.sherrill at OARcorp.com
Tue May 29 13:07:08 UTC 2001



Laurent Guerby wrote:
> 
> > Comments welcomed.
> 
> Looks great, can't wait for the GNAT commit next week to play with it
> on various simulators :).
> 
> A few comments:
> 
> ***
>    Unsigned8_Bits   : constant := 7;
>    Unsigned16_Bits  : constant := 15;
> 
> That's at odd with my information theory knowledge :)

Thanks for spotting this.  FWIW this code is OLD and probably MOLDY. :)
This is based on the Ada83 implementaiton of RTEMS which was last supported
around RTEMS 3.2.1 (1994?).

This binding was originally written in Ada83 where real unsigned types
did not exist in a portable manner.  The compiler we used was 
particularly brain-damaged in this regard.

> ***
>    subtype Boolean             is RTEMS.Unsigned32;
>    subtype Address             is System.Address;
>    subtype Single              is Interfaces.C.C_float;
>    subtype Double              is Interfaces.C.Double;
> 
> This is likely to cause some problems for code wanting to with/use
> RTEMS, especially for Boolean, Address and Double which are already
> used. I'd suggest prefixing all those by RTEMS_.
> 
> ***
>    function From_Ada_Boolean (
>       Ada_Boolean : Standard.Boolean
>    ) return RTEMS.Boolean;
> 
>    function To_Ada_Boolean (
>       RTEMS_Boolean : RTEMS.Boolean
>    ) return Standard.Boolean;
> 
> To_Ada and To_RTEMS should do the job, overloading is nice :).
> While we're at it I'd subrange RTEMS_Boolean:
> 
>    subtype Boolean             is RTEMS.Unsigned32 range 0 .. 1;
> 
> Or do an explicit check in To_Ada and raise Constraint_Error.
> 
> ***
> address_io is unneeded since GNAT provides System.Address_Image
> 
> ***
> Copyright date is probably not correct :)
> 
> ***
> May be using the pragma Inline or Always_Inline could save a few
> bytes, to be checked.
> 
> ***
> Do you have basic Ada examples using the classic API?

The old version of the tests for the Ada implementation of RTEMS
are available.  I will have to dig around to find them.  I recall
some API differences because of the historical gap but also recall
trying to compile them and run them with just the binding.

> Hopes this help,
> 
> --
> Laurent Guerby <guerby at acm.org>

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985



More information about the users mailing list