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-Thread: 103376,e6066104d6deadff X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: protected type interrupts Date: Thu, 24 Aug 2006 17:39:28 +0200 Organization: Adalog Message-ID: References: <1156430839.745932.279060@75g2000cwc.googlegroups.com> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1156435289 23632 195.25.228.57 (24 Aug 2006 16:01:29 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Thu, 24 Aug 2006 16:01:29 +0000 (UTC) User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) In-Reply-To: <1156430839.745932.279060@75g2000cwc.googlegroups.com> Xref: g2news2.google.com comp.lang.ada:6343 Date: 2006-08-24T17:39:28+02:00 List-Id: REH a �crit : > I am having a disagreement with a compiler vendor. I am using a > protected type for an interrupt handler (see below). The handler > simply sets a boolean to true that an entry is using as a guard. The > entry is called by a task. Basically, the task is blocked until > signaled by the interrupt to do the processing. With newer versions of > their compiler, the computer resets. They say it is because they are > calling the entry at the interrupt level, and not the task level (we > process this in a task because we have to do things you cannot do in a > interrupt). They say the LRM allows them to do this. Is that true? C.3.1 (17) allows them to pretty much anything. Apparently, a ceiling_priority is in effect (either because you specified it, or by default), thus your task inherits the ceiling of the protected type (which is an interrupt_priority), and this implementation seems to forbid an entry to be called at an interrupt level. A work-around could be: protected Relay_Object is procedure Isr; entry Process_Interrupt; private Triggered : Boolean := False; end Relay_Object; protected Interrupt_Object is procedure Isr; pragma Attach_Handler(Isr, XXX); pragma Interrupt_Priority(XXX); private pragma Suppress(All_Checks, On => Isr); end Interrupt_Object; protected body Relay_Object is procedure Isr is begin Triggered := True; end Isr; entry Process_Interrupt when Triggered is begin Triggered := False; -- process interrrupt end Process_Interrupt; end Relay_Object; protected body Interrupt_Object is procedure Isr is begin Relay_Object.Isr; end Isr; end Interrupt_Object; This way, the task is not calling a PO that serves as an interrupt handler, thus C.3.1 (17) does not apply. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr