comp.lang.ada
 help / color / mirror / Atom feed
From: rgilbert@orl.mmc.com (Bob Gilbert)
Subject: Type System.ADDRESS
Date: 31 Oct 1994 20:28:24 GMT
Date: 1994-10-31T20:28:24+00:00	[thread overview]
Message-ID: <393k18$huv@theopolis.orl.mmc.com> (raw)

I've run across a problem and would like a little net wisdom
on this...

The compiler I'm working with has choosen to implement the type
System.ADDRESS as static.  Although this appears to be within 
the rules of the LRM, it does present some significant limitations.

1)  It has been a frequent practice of mine to implement drivers for
    memory mapped devices using a generic, where the base address of
    the device is supplied as a generic parameter. This has allowed
    for nice reusable Ada components. Unfortunately,with a static 
    implementation of type System.ADDRESS, a representation clause 
    cannot use the generic base address supplied.

2)  Similar to the above example, I've also used generics packages 
    containing tasks associated with an interrupt, where the interrupt
    is either directly or indirectly determined by the generic 
    parameters.  Again, a static implementation of System.ADDRESS
    won't allow this.

Now I've worked around the first problem by using access types and
Unchecked_Conversion to map the generic objects, and I reconize 
that this is sort of a bastard implementation that makes assumptions
as to the implementation of the access type (not necessarily portable).

I've worked around the second problem by creating task types for each
possible interrupt, and then dynamically allocate the appropiate task
object in the generic. But this ends up looking somewhat silly as I
have many tasks types defined that are all identical except for their
address clause used to associate the interrupt (ends up looking like
I should have used a generic, so I end up writting extra comments to
explain why I didn't).

My questions are then:

 Is it reasonable for a compiler to implement System.ADDRESS as static?  

 Is it reasonable for the language to allow this?

 Is there a better way to work around the limitations?

Thanks,

    Bob




             reply	other threads:[~1994-10-31 20:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-10-31 20:28 Bob Gilbert [this message]
1994-11-01  3:11 ` Type System.ADDRESS Tucker Taft
1994-11-01 13:04   ` Bob Gilbert
1994-11-01 23:04     ` Norman H. Cohen
1994-11-02  5:51     ` Tucker Taft
1994-11-02 15:45       ` Bob Gilbert
1994-11-07 11:22         ` David Emery
1994-11-03 11:27     ` David Emery
1994-11-03 11:31     ` Robert Dewar
1994-11-03 10:08 ` Robert I. Eachus
1994-11-03 11:30 ` Robert Dewar
1994-11-03 18:23   ` Bob Gilbert
replies disabled

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