comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: Connecting To Interrupts Using Protected Procedures
Date: 1999/02/18
Date: 1999-02-18T00:00:00+00:00	[thread overview]
Message-ID: <m3k8xg7ab2.fsf@mheaney.ni.net> (raw)
In-Reply-To: 36CB42FA.FDD195CF@pwfl.com

Couldn't you reverse the calling sequence?  And have the slower task
call an entry of the interrupt handler?  

The interrupt handler can block its call, until the interrupt comes in.




Marin David Condic <condicma@bogon.pwfl.com> writes:

> I'm looking at trying to convert an Ada83 method of handling interrupts
> into the Ada95 preferred technique and am a bit puzzled as to how to go
> about it. What we've been doing is connecting an entry in one task (or
> connecting a procedure) to an interrupt that goes off every milisecond.
> The task/procedure does some work and on every Nth cycle it initiates a
> slower cycle task by calling a parameterless entry or initiating an
> interrupt to which the entry is tied. (Not both at the same time - just
> two different ways we have done it.)
> 
> Now Ada95 allows this as per ARM J.7.1 etc. but given that it is
> considered obsolete, I'd like to do it by the preferred method. So I've
> looked at connecting the 1ms interrupt to a protected procedure and this
> all looks pretty straightforward. The problem is getting this protected
> procedure to periodically kick off the slower cycle task. According to
> ARM 9.5.1(8..17) you can't call an entry from there without creating a
> bounded error. (Maybe it will run, but only if the system can't detect
> it and raise Program_Error.) So how is it that the protected procedure
> should communicate to the slower task to start cycling? You want the
> slower task to be blocked until its time cycle comes around again, so
> you would naturally think of some form of entry - but so far as I can
> see, I've got no way of legally doing that. I suppose one could poll a
> shared variable until the interrupt handler set the flag, but polling
> answers are just not practical in this arena. (Ideally, you would want
> to implement this with a clock and a delay statement, but the hardware
> doesn't support this at the moment.)
> 
> Does anybody have a suggested method of doing this? Possibly with a code
> snippet or two to illustrate? Thanks in advance.
> 
> MDC
> -- 
> Marin David Condic
> Real Time & Embedded Systems, Propulsion Systems Analysis
> United Technologies, Pratt & Whitney, Large Military Engines
> M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600
> Ph: 561.796.8997         Fx: 561.796.4669
> ***To reply, remove "bogon" from the domain name.***
> 
>     "Crime does not pay ... as well as politics."
> 
>         --  A. E. Newman




  parent reply	other threads:[~1999-02-18  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-17  0:00 Connecting To Interrupts Using Protected Procedures Marin David Condic
1999-02-17  0:00 ` Pat Rogers
1999-02-18  0:00   ` Pat Rogers
1999-02-18  0:00     ` Marin David Condic
1999-02-18  0:00 ` Matthew Heaney [this message]
1999-02-18  0:00 ` robert_dewar
1999-02-18  0:00   ` Marin David Condic
1999-02-18  0:00     ` robert_dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox