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.2 required=5.0 tests=BAYES_00,FROM_WORDY, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e8d2c0ed82daf4da X-Google-Attributes: gid103376,public From: "Nick Roberts" Subject: Re: Handling Addressing Errors Date: 1999/03/04 Message-ID: <7bofa5$nfd$2@plug.news.pipex.net>#1/1 X-Deja-AN: 451519733 References: <1999Mar3.212443.1898@nosc.mil> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: UUNET WorldCom server (post doesn't reflect views of UUNET WorldCom) Newsgroups: comp.lang.ada Date: 1999-03-04T00:00:00+00:00 List-Id: Assuming you mean a memory board, the standard technique is something like this: with System.Storage_Elements; use System, System.Storage_Elements; procedure Check_For_Board (Bottom, Top: in System.Address; Present: out Boolean); Mask: array (1..4) of Storage_Element; Board: Storage_Array(0..Top-Bottom); for Board'Address use Bottom; pragma Volatile_Components(Board); begin Mask(1) := 0; Mask(2) := 16#A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5# and (2**Storage_Unit-1); Mask(3) := not Mask(2); Mask(4) := not Mask(1); Present := False; for i in Board'Range loop for m in 1..4 loop Board(i) := Mask(m); if Board(i) /= Mask(m) then return; end if; end loop; end loop; Present := True; exception when Program_Error => Present := False; return; -- ? end Check_For_Board; This is designed for all architectures, BTW, not just VME. I believe some VME boards provide a way to detect their presence (and to configure them) via I/O ports (usu memory mapped, as it happens), but, as ever, they're all different! VME memory boards tug the NMI to indicate memory failure. I take it that the RTOS your program ran on caught the NMI and raised Program_Error. If you could find a way to intercept the NMI explicitly, so much the better. (This might provide you with a more graceful way to handle genuine memory failures, BTW.) As for pragma Volatile, if you ever find a compiler which 'optimises' away a reference to a volatile object, do us all a favour: (a) find the person/people responsible for this compiler; (b) shoot them all, or commit them to a secure mental institution; (c) destroy all copies of the compiler, and any evidence that it ever existed. (Thanks :-) ------------------------------------- Nick Roberts -------------------------------------