|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 7168 (0x1c00)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package V_I_Csema, seg_04b9aa
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦this⟧
-- Copyright 1988, 1992 Verdix Corporation
------------------------------------------------------------------------------
-- User interface to the counting semaphore data structures and subprograms
--
-- Provides backward compatibility with earlier releases of VADS.
--
-- The interface to ALL the low kernel services is now provided in
-- ada_krn_i.a. Types used by these services is defined in ada_krn_defs.a.
--
-- This package simply layers upon the counting semaphore data structures and
-- subprograms found in ada_krn_defs.a and ada_krn_i.a.
--
-- Differences from earlier releases:
-- [1] The intr_flag and intr_status are only applicable to the
-- VADS_MICRO.
-- [2] For the delete() service, if the conditional_delete_flag is TRUE,
-- the semaphore might not be deleted even though no tasks are
-- waiting on it. This caveat isn't applicable to the VADS_MICRO.
------------------------------------------------------------------------------
with Ada_Krn_Defs;
with Ada_Krn_I;
package V_I_Csema is
pragma Suppress (All_Checks);
pragma Suppress (Exception_Tables);
pragma Not_Elaborated;
type Intr_Status_T is new Ada_Krn_Defs.Intr_Status_T;
-- DISABLE_INTR_STATUS\x09: constant intr_status_t :=
--\x09\x09intr_status_t(ada_krn_defs.DISABLE_INTR_STATUS);
function Disable_Intr_Status return Intr_Status_T;
pragma Inline_Only (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 new Ada_Krn_Defs.Count_Semaphore_T;
type A_Cnt_Sema_T is new Ada_Krn_Defs.A_Count_Semaphore_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.
--
-- Use of the intr_flag and intr_status fields is only applicable
-- to the VADS_MICRO.
--------------------------------------------------------------------------
function Create (Initial_Count : Integer := 1;
Intr_Flag : Boolean := False;
Intr_Status : Intr_Status_T := Disable_Intr_Status)
return A_Cnt_Sema_T;
pragma Inline_Only (Create);
--------------------------------------------------------------------------
-- 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.
--
-- Note: if the conditional_delete_flag is TRUE, the semaphore might not
-- be deleted even though no tasks are waiting on it. This caveat isn't
-- applicable to the VADS_MICRO.
--------------------------------------------------------------------------
function Delete (Cnt_Sema : A_Cnt_Sema_T; Conditional_Delete_Flag : Boolean)
return Boolean;
pragma Inline_Only (Delete);
--------------------------------------------------------------------------
-- 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;
pragma Inline_Only (Wait);
--------------------------------------------------------------------------
-- 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);
pragma Inline_Only (Signal);
end V_I_Csema;
nblk1=6
nid=0
hdr6=c
[0x00] rec0=16 rec1=00 rec2=01 rec3=00c
[0x01] rec0=19 rec1=00 rec2=02 rec3=01a
[0x02] rec0=15 rec1=00 rec2=03 rec3=052
[0x03] rec0=16 rec1=00 rec2=04 rec3=05a
[0x04] rec0=14 rec1=00 rec2=05 rec3=064
[0x05] rec0=06 rec1=00 rec2=06 rec3=001
tail 0x21750bd528684381f79ca 0x42a00088462060003