RTEMS Classic API bindings

Laurent Guerby guerby at acm.org
Fri May 25 21:02:10 UTC 2001

> 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 :)

   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?

Hopes this help,

Laurent Guerby <guerby at acm.org>

More information about the users mailing list