--******************************************************************************************************************** -- Created: 30-Mar-2010 17:36:16 by OpenVMS SDL EV3-3 -- Source: 30-MAY-1995 14:26:02 $1$DGA7274:[LIB_ADA.LIS]UTCDEF.SDL;1 --******************************************************************************************************************** with SYSTEM; use SYSTEM; with STARLET; use STARLET; with CONDITION_HANDLING; use CONDITION_HANDLING; package UTCDEF is -- module $UTCDEF --+ -- -- $UTCDEF defines the storage format for UTC based times. -- --- UTC_M_TDF : constant := 16#00000FFF#; UTC_M_VER : constant := 16#0000F000#; UTC_S_UTCDEF : constant := 16; -- Old size name - synonym type UTCDEF_QUAD0_TYPE is record ABSTIME : UNSIGNED_QUADWORD; -- 64 bit system time -- In units of 100ns ticks TDF_ETC : UNSIGNED_QUADWORD; -- Inaccuracy, TDF, and version end record; for UTCDEF_QUAD0_TYPE use record ABSTIME at 0 range 0 .. 63; TDF_ETC at 8 range 0 .. 63; end record; for UTCDEF_QUAD0_TYPE'SIZE use 128; UTCDEF_QUAD0_TYPE_INIT : constant UTCDEF_QUAD0_TYPE := (ABSTIME => (0, 0), TDF_ETC => (0, 0)); type UTCDEF_LONG0_TYPE is record ABS0 : UNSIGNED_LONGWORD; -- Least sig 4 bytes of binary time ABS1 : UNSIGNED_LONGWORD; -- Most sig 4 bytes of binary time INAC : UNSIGNED_LONGWORD; -- 4 least sig bytes of inaccuracy TDFV : UNSIGNED_LONGWORD; -- 4 bits vers, 12 bits TDF, 2 -- most sig bytes of inaccuracy end record; for UTCDEF_LONG0_TYPE use record ABS0 at 0 range 0 .. 31; ABS1 at 4 range 0 .. 31; INAC at 8 range 0 .. 31; TDFV at 12 range 0 .. 31; end record; for UTCDEF_LONG0_TYPE'SIZE use 128; UTCDEF_LONG0_TYPE_INIT : constant UTCDEF_LONG0_TYPE := (ABS0 => 0, ABS1 => 0, INAC => 0, TDFV => 0); type UTCDEF_TDFBIT1_TYPE is record TDF : UNSIGNED_12; -- 12 bits of offset from UTC to local -- In units of minutes VER : UNSIGNED_4; -- Unsigned version number end record; for UTCDEF_TDFBIT1_TYPE use record TDF at 0 range 0 .. 11; VER at 1 range 4 .. 7; end record; for UTCDEF_TDFBIT1_TYPE'SIZE use 16; UTCDEF_TDFBIT1_TYPE_INIT : constant UTCDEF_TDFBIT1_TYPE := (TDF => 0, VER => 0); type UTCDEF_FLD0_TYPE is record FILLER_1 : UNSIGNED_QUADWORD; -- Overlay filler INACCUR : INTEGER_8_ARRAY (1 .. 6); -- Six bytes of inaccuracy -- In units of 100ns ticks TDFWRD : UNSIGNED_WORD; -- Fetch the TDF and the version ----Component(s) below are defined as comments since they ----overlap other fields ---- ----UTCDEF_TDFBIT1 : UTCDEF_TDFBIT1_TYPE; end record; for UTCDEF_FLD0_TYPE use record FILLER_1 at 0 range 0 .. 63; INACCUR at 8 range 0 .. 47; TDFWRD at 14 range 0 .. 15; ----Component representation spec(s) below are defined as ----comments since they overlap other fields ---- ----UTCDEF_TDFBIT1 at 14 range 0 .. 15; end record; for UTCDEF_FLD0_TYPE'SIZE use 128; UTCDEF_FLD0_TYPE_INIT : constant UTCDEF_FLD0_TYPE := (FILLER_1 => (0, 0), INACCUR => (others => 0), TDFWRD => 0 ); type UTCDEF_TIME_TYPE is record WHOLE_TIME : UNSIGNED_QUADWORD_ARRAY (1 .. 2); -- Double quad to fetch entire time ----Component(s) below are defined as comments since they ----overlap other fields ---- ----UTCDEF_QUAD0 : UTCDEF_QUAD0_TYPE; ----UTCDEF_LONG0 : UTCDEF_LONG0_TYPE; ----UTCDEF_FLD0 : UTCDEF_FLD0_TYPE; end record; for UTCDEF_TIME_TYPE use record WHOLE_TIME at 0 range 0 .. 127; ----Component representation spec(s) below are defined as ----comments since they overlap other fields ---- ----UTCDEF_QUAD0 at 0 range 0 .. 127; ----UTCDEF_LONG0 at 0 range 0 .. 127; ----UTCDEF_FLD0 at 0 range 0 .. 127; end record; for UTCDEF_TIME_TYPE'SIZE use 128; UTCDEF_TIME_TYPE_INIT : constant UTCDEF_TIME_TYPE := (WHOLE_TIME => (others => (0, 0))); type UTC_TYPE is record UTCDEF_TIME : UTCDEF_TIME_TYPE; end record; for UTC_TYPE use record UTCDEF_TIME at 0 range 0 .. 127; end record; for UTC_TYPE'SIZE use 128; UTC_TYPE_INIT : constant UTC_TYPE := ( UTCDEF_TIME => UTCDEF_TIME_TYPE_INIT ); end UTCDEF;