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


Arnaud Charlet wrote:
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".
OK. But obviously I can't test any changes to the VxWorks file
at all. I can't even compile it.


I thought it would be better for VxWorks and RTEMS to share
hwint, but also thought it better for VxWorks to have tested code.
The latter overrode my desire for common code.

If you are willing to take responsibility for my best faith attempt
at the VxWorks code, then I will take a shot at it.
* 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


OK.  I will try to get just that committed soon and move on to
the next part.
* 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;

I copied those from the VxWorks system.ads but confused RTEMS
native priorities with POSIX threads when adjusting them to account
for priorities 0 and 255 being reserved.  Is this OK?

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


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;
Which ones are irrelevant to RTEMS?  Before this patch added the
RTEMS specific system.ads in this patch, we used the default one
and it defined all of these symbols.  All I did was copy the default
one and make minimal changes.  I am happy to delete them but
don't know what to remove and why.

--joel
Arno


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