comp.lang.ada
 help / color / mirror / Atom feed
From: Toshitaka Kumano <kumano@cityfujisawa.ne.jp>
To: John Arnsparger <jarnspar@ems.jsc.nasa.gov>
Subject: Re: Interrupt Handlers using GNAT-VxWorks?
Date: 1999/10/16
Date: 1999-10-15T18:04:12+00:00	[thread overview]
Message-ID: <38076AEB.11FA6168@cityfujisawa.ne.jp> (raw)
In-Reply-To: 7u500m$e96@niven.ksc.nasa.gov

Dear John,

John Arnsparger wrote:
> 
> I am trying to attach an interrupt handler (procedure) to Vector #29
> (decimal) on the mvme167
> board using Ada95 "protected" constructs.  I have tried
> Ada.Interrupts.Attach_Handler,
> which results in "Program_Error: Trying to overwrite a static Interrupt
> Handler" with a dynamic handler".
> 
> I have also tried the "pragma Attach_Handler", which produces a run-time
> error saying
> "Unitialized Interrupt".
> 
> Both of these were declared in package bodies.
> 
> Does anyone have any helpful hints or examples of successfully doing this
> with GNAT-Works m68K?  Or pointers to better references than the LRM? :-)

How about a workaround as follows ?

1. Export the proteced procedure to C function with the pragma Export.
2. Write C wrapper to install the C function with "intConnect ()".
3. Import the wrapper as an Ada procedure with the pragma Import.
4. Call the procedure at an appropriate timing, e.g. in the elaboration
   of the package body.

X. Of course, unmasking must be considered in other portion of codes.

P.S.

"Ada Interrupts" and "Interrupts in a CPU" are different things.

"Ada Interrupts" is rather a programmer model than real H/W interrupts,
and the relation between two is undefined in ARM, and implementaion
defined.

As you may know, GNAT limits "Ada Interrupts" only to "signals"
probably because of portability, although that feature could be
an obtacle for those who write codes using many user defined vectors.

Sorry for my poor English.

--




  parent reply	other threads:[~1999-10-16  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-14  0:00 Interrupt Handlers using GNAT-VxWorks? John Arnsparger
1999-10-14  0:00 ` Rick Stikkers
1999-10-15  0:00 ` Martin Gangkofer
1999-10-16  0:00 ` Toshitaka Kumano [this message]
1999-10-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