comp.lang.ada
 help / color / mirror / Atom feed
* Interrupt Handlers using GNAT-VxWorks?
@ 1999-10-14  0:00 John Arnsparger
  1999-10-14  0:00 ` Rick Stikkers
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: John Arnsparger @ 1999-10-14  0:00 UTC (permalink / raw)


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? :-)

Thanks.


John M. Arnsparger
Lockheed Martin Space Operations
 e-mail john.arnsparger1@jsc.nasa.gov
 Phone (281) 244 9693
 Fax (281) 244 9681








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

* Re: Interrupt Handlers using GNAT-VxWorks?
  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
  2 siblings, 0 replies; 5+ messages in thread
From: Rick Stikkers @ 1999-10-14  0:00 UTC (permalink / raw)


I was able to attach to an interrupt using a task entry.  This code worked
with the Verdix Ada-83 cross compiler running in SUNOS 4.1.4 with a target of
a VME 68040 processor.  Hopefully it will work for you.

    Rick

 clock_interrupt_vector : constant := 16#44#;
 task timer_tick is
      entry start;
      entry tick_isr;
      for tick_isr use at SYSTEM.address'ref( clock_interrupt_vector );
      pragma passive( interrupt, 16#0700# );
   end timer_tick;


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? :-)
>
> Thanks.
>
> John M. Arnsparger
> Lockheed Martin Space Operations
>  e-mail john.arnsparger1@jsc.nasa.gov
>  Phone (281) 244 9693
>  Fax (281) 244 9681





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

* Re: Interrupt Handlers using GNAT-VxWorks?
  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
  2 siblings, 0 replies; 5+ messages in thread
From: Martin Gangkofer @ 1999-10-15  0:00 UTC (permalink / raw)


In article <7u500m$e96@niven.ksc.nasa.gov>,
  "John Arnsparger" <jarnspar@ems.jsc.nasa.gov> 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?
:-)
>
> Thanks.
>
> John M. Arnsparger
> Lockheed Martin Space Operations
>  e-mail john.arnsparger1@jsc.nasa.gov
>  Phone (281) 244 9693
>  Fax (281) 244 9681
>
>

I actually have had the same problem using APEX/Tornado on top of
VxWorks. As I remember there was a package named

        ada.interrupts.rational.handler.dependent.1.ada

This package contains a handler table, which selects, which interrupts
are legal interrupts and which are not. On illegal interrupts a
Program_Error is raised. Unfortunately, after I made this change, the
problem did relax (I think before I got a Program_Error on call to any
routine in Ada.Interrupts), but there were still Program_Errors raised
when I tried to attach an interrupt handler.

RATIONAL support obviously was not not able to solve this problem, which
was critical to the project I was working on, within half a year! So I
was forced to do a bloody, unstable workaround using a C procedure and
Vxworks interrupt service connect.

This experience was one reason for us to select gnat for our next
project starting end of the year. Therefore I would be happy if you
could keep me informed via email or this newsgroup, whether or gnat
support (ACT) could solve the problem.

--
Martin Gangkofer, System Engineer
ESG Elektroniksystem und -Logistik GmbH, Dept.EF-E
eMail: mgangkof@esg-gmbh.de
Tel:   +49 89 9216 2176


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: Interrupt Handlers using GNAT-VxWorks?
  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
  1999-10-18  0:00   ` Robert Dewar
  2 siblings, 1 reply; 5+ messages in thread
From: Toshitaka Kumano @ 1999-10-16  0:00 UTC (permalink / raw)
  To: John Arnsparger

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.

--




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

* Re: Interrupt Handlers using GNAT-VxWorks?
  1999-10-16  0:00 ` Toshitaka Kumano
@ 1999-10-18  0:00   ` Robert Dewar
  0 siblings, 0 replies; 5+ messages in thread
From: Robert Dewar @ 1999-10-18  0:00 UTC (permalink / raw)


In article <38076AEB.11FA6168@cityfujisawa.ne.jp>,
  toots@kama.melco.co.jp wrote:
>
> 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.


Actually there is no fundamental reason for this limitation.
If you need to handle interrupts directly and you are using
GNATWorks, please contact report@gnat.com to discuss your
requirements.

Robert Dewar
Ada Core Technologies


Sent via Deja.com http://www.deja.com/
Before you buy.




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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
1999-10-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