DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦b1aa931d9⟧ Ada Source

    Length: 7168 (0x1c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, seg_03bdb4

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



-- Copyright 1988 Verdix Corporation

------------------------------------------------------------------------------
-- User interface to the counting semaphore data structures and subprograms
------------------------------------------------------------------------------
WITH V_I_Types;
WITH V_I_Sema;
WITH System;
USE System;
PACKAGE V_I_Csema IS

   PRAGMA Suppress (All_Checks);
   PRAGMA Suppress (Exception_Tables);
   PRAGMA Not_Elaborated;

   SUBTYPE Semaphore_Rec IS V_I_Sema.Semaphore_Rec;
   SUBTYPE Intr_Status_T IS V_I_Types.Intr_Status_T;
   Disable_Intr_Status : CONSTANT Intr_Status_T :=
      V_I_Types.Disable_Intr_Status;

   -- Predefined wait_time values
   Wait_Forever : CONSTANT Duration := -1.0;
   Do_Not_Wait  : CONSTANT Duration := 0.0;

   --------------------------------------------------------------------------
   -- Counting semaphore data structure
   --------------------------------------------------------------------------
   TYPE Cnt_Sema_Record_T IS
      RECORD
         Enter_S      : Semaphore_Rec;
         Wait_S       : Semaphore_Rec;
         Resume_Entry : System.Address;
         Intr_Flag    : Boolean;
         Intr_Status  : Intr_Status_T;
         Count        : Integer;
         Deleted_Flag : Boolean;
      END RECORD;
   TYPE A_Cnt_Sema_T IS ACCESS Cnt_Sema_Record_T;

   --------------------------------------------------------------------------
   -- Create a new counting semaphore.
   --
   -- Normally, the critical region for updating the semaphore's
   -- count is protected by a binary semaphore.
   --
   -- However, if the intr_flag is TRUE, then,
   -- its critical region is protected by disabling interrupts. This
   -- allows the counting semaphore to be accessed from an ISR.
   --
   -- STORAGE_ERROR exception is raised if not enough memory for semaphore.
   --------------------------------------------------------------------------
   FUNCTION Create (Initial_Count : Integer       := 1;
                    Intr_Flag     : Boolean       := False;
                    Intr_Status   : Intr_Status_T := Disable_Intr_Status)
                   RETURN A_Cnt_Sema_T;

   --------------------------------------------------------------------------
   -- Deletes a previously created counting semaphore. Returns TRUE if
   -- deletion was successful.
   --
   -- If conditional_delete_flag parameter is TRUE, then, semaphore
   -- is not deleted if any task is waiting on it.
   -- Otherwise, semaphore is always deleted and waiting tasks
   -- are resumed.
   --------------------------------------------------------------------------
   FUNCTION Delete (Cnt_Sema : A_Cnt_Sema_T; Conditional_Delete_Flag : Boolean)
                   RETURN Boolean;

   --------------------------------------------------------------------------
   -- Waits on a counting semaphore.
   --
   -- Returns TRUE, if semaphore count > 0. The count is decremented
   -- before returning.
   --
   -- If count <= 0, then, returns according to the wait_time parameter:
   --  < 0.0    \x09    - returns when count > 0. This may necessitate
   --                    suspension of current task until another task
   --                    signals.
   --  = 0.0     \x09    - returns FALSE immediately if count <= 0.
   --  > 0.0           - if count doesn't become positive
   --                    within "wait_time" amount of time, returns FALSE.
   --
   -- Note: returns FALSE for any wait_time, if semaphore was deleted.
   --
   --------------------------------------------------------------------------
   FUNCTION Wait (Cnt_Sema : A_Cnt_Sema_T; Wait_Time : Duration)
                 RETURN Boolean;

   --------------------------------------------------------------------------
   -- Signals a counting semaphore.
   --
   -- Increments the semphore's count. If count > 0, resumes next
   -- task waiting on semaphore.
   --------------------------------------------------------------------------
   PROCEDURE Signal (Cnt_Sema : A_Cnt_Sema_T);

PRIVATE
   PRAGMA Interface (Ada, Create);
   PRAGMA Interface_Name (Create, "__CREATE_COUNT_SEMAPHORE");
   PRAGMA Interface (Ada, Delete);
   PRAGMA Interface_Name (Delete, "__DELETE_COUNT_SEMAPHORE");
   PRAGMA Interface (Ada, Wait);
   PRAGMA Interface_Name (Wait, "__WAIT_COUNT_SEMAPHORE");
   PRAGMA Interface (Ada, Signal);
   PRAGMA Interface_Name (Signal, "__SIGNAL_COUNT_SEMAPHORE");
END V_I_Csema;

E3 Meta Data

    nblk1=6
    nid=0
    hdr6=c
        [0x00] rec0=1c rec1=00 rec2=01 rec3=09a
        [0x01] rec0=19 rec1=00 rec2=02 rec3=028
        [0x02] rec0=00 rec1=00 rec2=06 rec3=02c
        [0x03] rec0=15 rec1=00 rec2=03 rec3=01e
        [0x04] rec0=15 rec1=00 rec2=04 rec3=04a
        [0x05] rec0=0d rec1=00 rec2=05 rec3=000
    tail 0x21739b8ae8565744eea71 0x489e0066482863c01