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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: SPARK 2014 and protected objects Date: Wed, 31 Aug 2016 08:42:49 +0100 Organization: A noiseless patient Spider Message-ID: References: <2a104643-59b9-4a46-b543-5c124984bf43@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="90a7515de723fda2443060f3e878f4b0"; logging-data="8253"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186lpsBG8yl/CfxLLT/Hco1z8ALkobTy+U=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:JcjgrPKsbXleYN1Qlq/ZN2cKp7U= sha1:/ySjVGRXkEAjDOMhnOsxombrScc= Xref: news.eternal-september.org comp.lang.ada:31653 Date: 2016-08-31T08:42:49+01:00 List-Id: Shark8 writes: > protected Impl > with Part_Of => State > is > procedure Set (Value : Integer) > with Depends => ((Impl =>+ Value)); > procedure Get (Value : out Integer) > with Depends => (Impl => Impl, Value => Impl); > > private > Protected_Value : Integer := 0; > end Impl; > > -- GNAT doesn't allow Volatile on the protected object's with. > Pragma Volatile(Impl); We seem to have come up with (almost) the same solution, which gives me confidence it's the right one. Thanks. I had Protected_Value outside the PO because it's standing in for a number of I/O registers communicating with devices on a shared SPI bus via their /Chip Select lines. Not sure how to deal with the concept of "a number of machine registers"!