comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <rieachus@comcast.net>
Subject: Re: Isn't this in favour of Ada??
Date: Thu, 27 Oct 2005 03:20:26 -0400
Date: 2005-10-27T03:20:26-04:00	[thread overview]
Message-ID: <n4WdnXnxdP4x4v3enZ2dnUVZ_s6dnZ2d@comcast.com> (raw)
In-Reply-To: <GprDe.1797$6f.554@newsread3.news.atl.earthlink.net>

Marin David Condic wrote:

> It doesn't seem like a big leap to have some language defined "signal" 
> abstraction that could be either hardware triggered, OS triggered or 
> software triggered so that the protected procedure could do what it is 
> currently doing to connect to an interrupt (connecting to the "signal" 
> abstraction instead), but you could hide the triggering mechanism under 
> a package body somewhere.
> 
> I'm not looking to avoid having to do some code substitution between a 
> target machine and a simulation. What I'm looking for is a mechanism 
> that lets you hide the SOURCE of the interrupt in a package BODY so that 
> the embedded executive developer and the workstation simulation 
> developer can both work from a common specification and all we have to 
> do to get off the target and on to the simulation is substitute one 
> package body. With Ada as it stands, I'm not sure I can do that without 
> some significant gyrations. A language defined "signal" would seem to 
> provide a simple mechanism for doing that.

Hmmm...  If I wanted to do this in a platform independent manner, I'd 
have a package containing an enumeration type that provided the 
interrupt names.  If you prefer, you could have an integer type with 
deferred constants for some common useful names.

Also in the package would be a generic package with two procedures for 
binding and unbinding the interrupt to a task or protected object entry. 
  The choice of generic formals I leave up to you.  I'd go for a formal 
parameterless procedure for the action to be called.  That lets you use 
a procedure in a protected object.  And I would have the package body 
maintain a stack of bindings that resides in the non-generic enclosing 
package.  However, I would have the unbind routine raise an error if it 
is not from the generic instance that did the binding.  Oh, and the 
generic body should use finalization to insure that when the scope in 
which the generic package is instantiated is left, the interrupt is 
unbound if necessary.

At the other end of the spectrum would be an implementation where 
instantiating the generic did the binding, and the unbinding occurs when 
the enclosing scope is left. So the generic takes two 
(generic)parameters an interrupt name or number and the procedure or 
entry to be called.  Not as powerful an abstraction, but easier to use. 
  In practice though, most interrupt bindings will have the same scope 
as the main program...

RIE



  reply	other threads:[~2005-10-27  7:20 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-14 11:34 Isn't this in favour of Ada?? Erlo Haugen
2005-07-14 14:56 ` Mike Silva
2005-07-14 16:11   ` Jeffrey Carter
2005-07-14 18:06     ` Marc A. Criley
2005-07-15 13:05       ` Marin David Condic
2005-07-19 17:03         ` James Alan Farrell
2005-07-19 17:31           ` Ed Falis
2005-07-20 11:49           ` Marin David Condic
2005-07-19 11:40     ` Erlo Haugen
2005-07-19 17:10       ` Jeffrey Carter
2005-07-19 15:41     ` Dan McLeran
2005-07-19 17:17       ` Adrien Plisson
2005-07-20  2:22       ` Jeffrey Carter
2005-07-20  5:13         ` Dan McLeran
2005-07-22  7:30     ` Erlo Haugen
2005-07-22 13:12       ` Marc A. Criley
2005-07-22 13:36         ` Erlo Haugen
2005-07-22 14:24           ` Dan McLeran
2005-07-22 14:29           ` Bob Spooner
2005-07-23 13:02             ` Ludovic Brenta
2005-07-22 18:01           ` Marc A. Criley
2005-07-22 15:49       ` Jeffrey Carter
2005-07-15 14:04 ` Florian Weimer
2005-07-15 21:10   ` Larry Kilgallen
2005-07-18 12:37     ` Marin David Condic
2005-07-18 12:57       ` Ed Falis
2005-07-18 13:18         ` Marin David Condic
2005-07-18 14:12           ` Ed Falis
2005-07-19 12:51             ` Marin David Condic
2005-07-19 18:08               ` Robert A Duff
2005-07-20  5:12                 ` Simon Wright
2005-07-20 15:37                   ` Robert A Duff
2005-07-21 12:15                     ` Marin David Condic
2005-07-21 15:32                       ` Robert A Duff
2005-07-20 12:26                 ` Marin David Condic
2005-10-27  7:20                   ` Robert I. Eachus [this message]
2005-08-04 12:59     ` Florian Weimer
2005-08-05 14:29       ` Larry Kilgallen
2005-08-05 16:58         ` Florian Weimer
2005-08-05 23:15           ` Larry Kilgallen
2005-08-06  4:01           ` tmoran
2005-08-06 10:28           ` Pascal Obry
2005-08-06 10:33             ` Pascal Obry
2005-08-06 11:02           ` Dmitry A. Kazakov
2005-07-21 13:27 ` Maciej Sobczak
2005-07-22  7:39   ` Erlo Haugen
2005-07-22  9:29     ` Maciej Sobczak
2005-07-22 10:41       ` Erlo Haugen
2005-07-22 14:28         ` Alex R. Mosteo
2005-07-22 15:02           ` Pascal Obry
2005-07-25  9:48             ` Tassilo v. Parseval
2005-07-25 13:31               ` Adrien Plisson
2005-07-25 15:08                 ` Jerome Hugues
2005-07-25 15:58                   ` Adrien Plisson
2005-07-25 21:03                     ` Jerome Hugues
2005-07-26  6:03                       ` Tassilo v. Parseval
2005-07-25 16:39               ` Pascal Obry
2005-07-26  5:58                 ` Tassilo v. Parseval
2005-07-26 17:25                   ` Pascal Obry
2005-07-22 15:26           ` Georg Bauhaus
replies disabled

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