comp.lang.ada
 help / color / mirror / Atom feed
* Can someone explain this to me please?
@ 1999-08-06  0:00 J. Marshall
  1999-08-06  0:00 ` Ted Dennison
  1999-08-07  0:00 ` David Kristola
  0 siblings, 2 replies; 4+ messages in thread
From: J. Marshall @ 1999-08-06  0:00 UTC (permalink / raw)


I am a C programmer, recently assigned to an Ada project due to staff
problems here.
The project, originally built in 1492 using Verdix on a VAX, it is now being
ported to Green Hills AdaMULTI version 1.8.9 running on a SunOS host, for a
VMEbus embedded target running VxWorks.
I've never used Ada before, and am having some difficulty with some portions
of the project, the direct hardware addressing in particular.

Example of some of the "old" code used...

COMMAND_REG_PTR :
   COMMAND_REG_PTR_TYPE :=
      TO_CMD_PTR( SYSTEM.ADDRESS'ref( BOARD_CONFIGURATION ) );

..to which the compiler responds with

   UNRECOGNIZED ATTRIBUTE "ref"

The former Ada guru faxed me the following "fix":
(however, he is generally unavailable for help)

  generic
    type Object(<>) is limited private;
  package System.Address_To_Access_Conversions is
    pragma Preelaborate(Address_To_Access_Conversions);

    type Object_Pointer is access all Object;
    function To_Pointer(Value : Address) return Pbject_Pointer;
    function To_Address(Value : Object_Pointer) return Address;

    pragma Convention(Intrinsic, To_Pointer);
    pragma Convention(Intrinsic, To_Address);
  end System.Address_To_Access_Conversions

Can anyone tell me how to implement this into working code?
Thanks very much.
Jim Marshall







^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-08-09  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-08-06  0:00 Can someone explain this to me please? J. Marshall
1999-08-06  0:00 ` Ted Dennison
1999-08-07  0:00 ` David Kristola
1999-08-09  0:00   ` J. Marshall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox