comp.lang.ada
 help / color / mirror / Atom feed
From: mab@dst17.wdl.loral.com (Mark A Biggar)
Subject: Re: Protected Types and Address Clauses
Date: 1996/02/22
Date: 1996-02-22T00:00:00+00:00	[thread overview]
Message-ID: <4gi71p$94s@wdl1.wdl.loral.com> (raw)
In-Reply-To: Dn5Mq1.Ewz@thomsoft.com

In article <Dn5Mq1.Ewz@thomsoft.com> kst@thomsoft.com (Keith Thompson) writes:
>In <dewar.824905563@schonberg> dewar@cs.nyu.edu (Robert Dewar) writes:
>[...]
>> If you declare a single protected object, it is fine to have an address
>> clause for the object, but not for its individual components.
>Such an address clause is unlikely to do you much good, though, unless
>you know exactly how the implementation lays out the components of a
>protected object.  I presume that many implementations will put the
>implementation-defined implicit components common to all protected
>types at the beginning of the object (for more efficient addressing),
>so user-declared components are likely to be at a substantial offset.
>If you need to have an object of a particular type at a specified
>address with the kind of protection offered by protected types, you'll
>probably need to use Tucker Taft's suggested work-around of moving the
>data declarations into the package body surrounding the protected body.

That's not a work around, it is the necessity and proper implementation
method in almost all cases.  Even if you could figure out the layout
of the protected object and could give it an address clause that put
the one special component at the proper address for the hardware memory
mapped register, it is highly unlikely that the surrounding addresses
are anything other then other memory mapped registers or other non-normal
memory.  Thus having the special component outside of the PO is the only
proper way to handle this situation.  Note that the special variable
doesn't have to be visible to the users of the protected object, it
only need to be visible to the body of the PO and so can be hidden in
the same place the PO body is hidden.

--
Mark Biggar
mab@wdl.loral.com





  reply	other threads:[~1996-02-22  0:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4fqe6h$t0e@theopolis.orl.mmc.com>
1996-02-19  0:00 ` Protected Types and Address Clauses Robert I. Eachus
1996-02-20  0:00   ` Norman H. Cohen
1996-02-21  0:00     ` Robert Dewar
1996-02-22  0:00       ` Keith Thompson
1996-02-22  0:00         ` Mark A Biggar [this message]
1996-02-23  0:00           ` Robert A Duff
1996-02-21  0:00     ` Keith Thompson
1996-02-21  0:00   ` Robert I. Eachus
     [not found] <DMrJAC.788@thomsoft.com>
1996-02-21  0:00 ` 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