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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ca23420b45ed64d7,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-31 04:29:20 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: "Luke A. Guest" Newsgroups: comp.lang.ada Subject: Address representation clause is getting 0 Date: Wed, 31 Dec 2003 12:29:19 +0000 Message-ID: NNTP-Posting-Host: abyss2.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.demon.co.uk 1072873759 9664 62.49.62.197 (31 Dec 2003 12:29:19 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Wed, 31 Dec 2003 12:29:19 +0000 (UTC) User-Agent: Pan/0.14.0 (I'm Being Nibbled to Death by Cats!) Xref: archiver1.google.com comp.lang.ada:3982 Date: 2003-12-31T12:29:19+00:00 List-Id: Hi, I'm working on an embedded project on an SGI O2 machine. I have a GNAT/GCC compiler set for mips-elf compiled and All I'm trying to do is to get the System Program Block from the ARCS PROM. I have the following types: type T_SPB is record SPBSignature : ULONG; -- Must be SPBSIGNATURE. SPBLength : ULONG; Version : USHORT; Revision : USHORT; RestartBlock : T_RESTARTBLOCK_PTR; DebugBlock : VOID_PTR; GEVector : VOID_PTR; UTLBMissVector : VOID_PTR; FirmwareVectorLength : ULONG; FirmwareVector : T_FIRMWAREVECTOR_PTR; PrivateVectorLength : ULONG; PrivateVector : VOID_PTR; AdapterCount : ULONG; Adapters : aliased T_ADAPTERS; end record; type T_SPB_PTR is access T_SPB; SP_Block : T_SPB; for SP_Block'Address use To_Address(16#80001000#); -- 0x80001000 Inside a procedure I have tested the address: package body ARCS_Prom is procedure PutChar(C : CHAR) is Count : aliased ULONG; OutputChar : CHAR := c; Output : LONG_PTR; begin -- if SP_Block'Address = To_Address(16#80001000#) then if SP_Block'Address = To_Address(0) then Output := SP_Block.FirmwareVector.ArcWrite(1, OutputChar'Address, 1, Count'Access); end if; end PutChar; end ARCS_Prom; Now, if I execute the PutChar procedure the program crashes (because of the null pointer). Here's the code for the ArcWrite function as well: --typedef LONG (*_ArcWrite)(ULONG FileID, VOID *Buffer, ULONG N, ULONG *Count); type Arc_Write is access function(FileID : ULONG; Buffer : System.Address; N : ULONG; Count : access ULONG) return LONG_PTR; pragma Convention(C, Arc_Write); Anyway, I think i've got everything else working ok, just not the SP_Block'Address. Can anyone help? FYI: I have no startup code, just a simple "main" procedure called start in which I call PutChar(65); the program is linked at the correct address for the O2. Thanks, Luke.