From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,beb6b378a857b7ea X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-20 05:52:43 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: jidu2851@student.uu.se (=?ISO-8859-1?Q?Jimmy_Dub=E9n?=) Newsgroups: comp.lang.ada Subject: Re: Use of entries using Ravenscar Date: 20 Dec 2001 05:52:43 -0800 Organization: http://groups.google.com/ Message-ID: <4948089f.0112200552.2b137487@posting.google.com> References: <4948089f.0112180828.2ea4c80@posting.google.com> <4948089f.0112192354.5411f0ed@posting.google.com> NNTP-Posting-Host: 130.238.15.200 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1008856363 27748 127.0.0.1 (20 Dec 2001 13:52:43 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 20 Dec 2001 13:52:43 GMT Xref: archiver1.google.com comp.lang.ada:18143 Date: 2001-12-20T13:52:43+00:00 List-Id: > You couldn't provide an actual code example? I've been playing with > the Ravenscar profile for a few months now and have never had any > problem with it. Okidoki.. here goes. I have three different files below (sorry, I could not send them along...). One procedure that uses the PO, and then a package with the PO that has the entry. Originally the code was intended to catch a signal but that did not work with ravenscar either. Strange since I think it is statically attached. Pragma(Ravenscar) not shown here (used in gnat.adc next to Makefile) <<<<<<<<<<<>>>>>>>>>>> >>>>>>>>test_entry.adb with Ada.Real_Time, Ada.Text_IO, Signal_Handler_Test; use Ada.Real_Time, Ada.Text_IO, Signal_Handler_Test; procedure Test_Entry is Period : constant Duration := 5.0; Next_Time : Time; begin loop Next_Time := Clock + To_Time_Span (Period); delay until Next_Time; Protected_Signal_Handler_Test.Read; end loop; end Test_Entry; >>>>>>>>>signal_handler_test.ads with Ada.Interrupts, Ada.Text_IO, Ada.Interrupts.Names; use Ada.Interrupts, Ada.Text_IO, Ada.Interrupts.Names; package Signal_Handler_Test is protected Protected_Signal_Handler_Test is --*F --* Read entry ... --*E entry Read; --*F --* Report that signal USR1 has occured --*E procedure Something_Arrived; -- Attach this certain procedure to the correct signal -- NOT ANY MORE --pragma Attach_Handler(Something_Arrived, SIGUSR1); private -- Whether or not there is anything to "read" Exists_Something : Boolean := False; No_Of_Something : Integer := 0; end Protected_Signal_Handler_Test; end Signal_Handler_Test; >>>>>>>>>signal_handler_test.adb package body Signal_Handler_Test is protected body Protected_Signal_Handler_Test is entry Read when Exists_Something is begin -- Decrement message counter No_Of_Something := No_Of_Something - 1; Put_Line("Read: Something is = " & No_Of_Something'img); -- (Possibly) allow others to use the entry again Exists_Something := No_Of_Something > 0; end Read; procedure Something_Arrived is begin Ada.Text_IO.Put_Line("Something_Arrived: A message has arrived."); -- Increment something counter No_Of_Something := No_Of_Something + 1; Put_Line("Something_Arrived: Something is = " & No_Of_Something'img); -- A something is available now Exists_Something := True; end Something_Arrived; end Protected_Signal_Handler_Test; end Signal_Handler_Test; >>>>>>>>>>>>>NO MORE CODE<<<<<<<<<<<<<< In the system I'm working with we, among other things, want to catch a signal from a CAN-driver to be able to do a non-blocking read. (We can't find good drivers to our CAN-module that is working with Linux 2.4.15)