This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GNAT/RTEMS Update


> I added s-interr-hwint.adb which is derived from
> s-interr-vxworks.adb but based upon a set of OS
> abstraction methods.  VxWorks and RTEMS SHOULD be
> able to use the same s-interr-hwint.adb implementation
> but I left that as an exercise for someone else.

Well, I have a problem with s-interr-hwint.adb, since it duplicates most
of the logic of another file, and adds maintenance burden when updating
the other similar files, so the merge of the two should really be part of
this exercise rather than "someone else".

>    * s-interr-hwint.adb: New file.  Portable support for hardware
>    interrupts assuming OS provides certain services.

See above for this part.

>    * env.c: Add conditional for RTEMS.
>    * s-osinte-rtems.adb: Add To_Target_Priority and fix formatting.
>    * s-osinte-rtems.ads: Add support for hardware interrupts via
>    the Binary Semaphore and Interrupt Management subprograms and
>    constants required by s-interr-hwint.adb.
>    * gsocket.h: When GNAT is built, you do not have access to the
>    RTEMS header files.  So we need to distinguish when IN_RTS.
>    * g-soccon-rtems.ads: New file.  Socket constants for RTEMS.

These are OK, as mentioned by Laurent Guerby. Feel free to commits them

>    * Makefile.in: Add support for new capabilities.  Turn on
>    building DEC Ada extensions.

This part is tied to the s-interr-hwint.adb issue above.

>    * system-rtems.ads: New file.  Add support for interrupt priorities.
>    Move from 32 priorities to 254 as supported by RTEMS.

This part is not OK. The definitions of *Priority* types and constants are
either inconsistent with all other system files, and are also wrong wrt
Ada semantics:

+   Max_Priority           : constant Positive := 11;
+   Max_Interrupt_Priority : constant Positive := 1;
+
+   subtype Any_Priority       is Integer      range   0 .. 255;
+   subtype Priority           is Any_Priority range  11 .. 245;
+   subtype Interrupt_Priority is Any_Priority range   1 .. 10;

You also need to remove non relelvant/obsolete entries at the end of
your system-rtems.ads file, as has been done in all other system files
a long time ago, e.g:

+   AAMP                      : constant Boolean := False;

Arno


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]