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,5618e4c4489899ac X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-31 06:59:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wn1feed!wn2feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!sccrnsc03.POSTED!not-for-mail From: "SteveD" Newsgroups: comp.lang.ada References: Subject: Re: implementation approach X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: NNTP-Posting-Host: 12.225.227.101 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc03 1028123944 12.225.227.101 (Wed, 31 Jul 2002 13:59:04 GMT) NNTP-Posting-Date: Wed, 31 Jul 2002 13:59:04 GMT Organization: AT&T Broadband Date: Wed, 31 Jul 2002 13:59:04 GMT Xref: archiver1.google.com comp.lang.ada:27524 Date: 2002-07-31T13:59:04+00:00 List-Id: "Mark" wrote in message news:a5ae824.0207301854.3295f3a2@posting.google.com... [snip] > > I suspect I'll need two semaphores on both processors. Once the flag > gets passed from processor B to processor A, the routine in A will > enter the semaphore command the device, release the flag, etc. > > Thanks in advance In Ada an interrupt is associated with a protected procedure in a protected type. An example of how to set this up is in the LRM C.3.2(28). I haven't done any Ada Interrupt handling myself, but I believe this is the way it's done. With Ada.Interrupts; Package Body Interrupt_Test Is Protected Type Device_Interface(Int_Id : Ada.Interrupts.Interrupt_ID) Is Procedure Handler; Pragma Attach_Handler( Handler, Int_Id ); Entry Wait_Interrupt; Private Occurred : Boolean := False; End Device_Interface; Protected Body Device_Interface Is Procedure Handler Is Begin Occurred := TRUE; End Handler; Entry Wait_Interrupt When Occurred Is Begin Occurred := False; End Wait_Interrupt; End Device_Interface; Device_1_Driver : Device_Interface( 1 ); Task Relay Is End Relay; Task Body Relay Is Begin Loop Device_1_Driver.Wait_Interrupt; -- Do something when the interrupt occurs End Loop; End Relay; End Interrupt_Test; I hope this helps, SteveD