From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,856114749978634c X-Google-Attributes: gid103376,public From: mab@dst17.wdl.loral.com (Mark A Biggar) Subject: Re: Protected Types and Address Clauses Date: 1996/02/22 Message-ID: <4gi71p$94s@wdl1.wdl.loral.com>#1/1 X-Deja-AN: 140650824 references: <4gcppr$10f5@watnews1.watson.ibm.com> organization: Loral Western Development Labs newsgroups: comp.lang.ada Date: 1996-02-22T00:00:00+00:00 List-Id: In article kst@thomsoft.com (Keith Thompson) writes: >In 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