POK
/home/jaouen/pok_official/pok/trunk/libpok/ada/arinc653/apex.ads
00001 -- This is a compilable Ada 95 specification for the APEX interface,
00002 -- derived from section 3 of ARINC 653.
00003 -- The declarations of the services given below are taken from the
00004 -- standard, as are the enumerated types and the names of the others types.
00005 -- However, the definitions given for these others types, and the
00006 -- names and values given below for constants, are all implementation
00007 -- specific.
00008 -- All types have defining representation pragmas or clauses to ensure
00009 -- representation compatibility with the C and Ada 83 bindings.
00010 -- ---------------------------------------------------------------------------
00011 -- --
00012 -- Root package providing constant and type definitions                     --
00013 -- --
00014 -- ---------------------------------------------------------------------------
00015 with System;
00016                     -- This is the Ada 95 predefined C interface package
00017 with Interfaces.C;
00018 package APEX is
00019    pragma Pure;
00020    -- ----------------------------
00021    -- Domain limits              --
00022    -- ----------------------------
00023    --  Domain dependent
00024    --  These values define the domain limits and are implementation-dependent.
00025    System_Limit_Number_Of_Partitions     : constant := 32;
00026    -- module scope
00027    System_Limit_Number_Of_Messages       : constant := 512;
00028    -- module scope
00029    System_Limit_Message_Size             : constant := 16#10_0000#;
00030    -- module scope
00031    System_Limit_Number_Of_Processes      : constant := 1024;
00032    -- partition scope
00033    System_Limit_Number_Of_Sampling_Ports : constant := 1024;
00034    -- partition scope
00035    System_Limit_Number_Of_Queuing_Ports  : constant := 1024;
00036    -- partition scope
00037    System_Limit_Number_Of_Buffers        : constant := 512;
00038    -- partition scope
00039    System_Limit_Number_Of_Blackboards    : constant := 512;
00040    -- partition scope
00041    System_Limit_Number_Of_Semaphores     : constant := 512;
00042    -- partition scope
00043    System_Limit_Number_Of_Events         : constant := 512;
00044    -- partition scope
00045    -- ----------------------------
00046    -- Base APEX types            --
00047    -- ----------------------------
00048    --  The actual sizes of these base types are system-specific and must
00049    --  match those of the underlying Operating System.
00050    type APEX_Byte is new Interfaces.C.unsigned_char;
00051    type APEX_Integer is new Interfaces.C.long;
00052    type APEX_Unsigned is new Interfaces.C.unsigned_long;
00053    type APEX_Long_Integer is new Interfaces.Integer_64;
00054    -- If Integer_64 is not provided in package Interfaces, any implementation-
00055    -- defined alternative 64-bit signed integer type may be used.
00056    -- ----------------------------
00057    -- General APEX types        --
00058    -- ----------------------------
00059    type Return_Code_Type is (
00060       No_Error,        -- request valid and operation performed
00061       No_Action,       -- status of system unaffected by request
00062       Not_Available,   -- resource required by request unavailable
00063       Invalid_Param,   -- invalid parameter specified in request
00064       Invalid_Config, -- parameter incompatible with configuration
00065       Invalid_Mode,    -- request incompatible with current mode
00066       Timed_Out);      -- time-out tied up with request has expired
00067    pragma Convention (C, Return_Code_Type);
00068    Max_Name_Length : constant := 30;
00069    subtype Name_Type is String (1 .. Max_Name_Length);
00070    subtype System_Address_Type is System.Address;
00071    subtype Message_Addr_Type is System.Address;
00072    subtype Message_Size_Type is APEX_Integer range
00073       1 .. System_Limit_Message_Size;
00074    subtype Message_Range_Type is APEX_Integer range
00075       0 .. System_Limit_Number_Of_Messages;
00076    type Port_Direction_Type is (Source, Destination);
00077    pragma Convention (C, Port_Direction_Type);
00078    type Queuing_Discipline_Type is (Fifo, Priority);
00079    pragma Convention (C, Queuing_Discipline_Type);
00080    subtype System_Time_Type is APEX_Long_Integer;
00081    -- 64-bit signed integer with 1 nanosecond LSB
00082    Infinite_Time_Value : constant System_Time_Type;
00083    Aperiodic           : constant System_Time_Type;
00084    Zero_Time_Value     : constant System_Time_Type;
00085 private
00086    Infinite_Time_Value : constant System_Time_Type := -1;
00087    Aperiodic           : constant System_Time_Type := 0;
00088    Zero_Time_Value     : constant System_Time_Type := 0;
00089 end APEX;