comp.lang.ada
 help / color / mirror / Atom feed
* Connecting To Interrupts Using Protected Procedures
@ 1999-02-17  0:00 Marin David Condic
  1999-02-17  0:00 ` Pat Rogers
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Marin David Condic @ 1999-02-17  0:00 UTC (permalink / raw)


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




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1999-02-18  0:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
1999-02-18  0:00 ` robert_dewar
1999-02-18  0:00   ` Marin David Condic
1999-02-18  0:00     ` robert_dewar

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