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

⟦6d094b15e⟧ Ada Source

    Length: 16384 (0x4000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, generic, package V_Interrupts, seg_03bd9d

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



-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
--
--   VERDIX CORPORATION                               (C) COPYRIGHT 1988
--   14130-A Sullyfield Circle                        Proprietary Information
--   Chantilly, Virginia 22021                        Not to be Disclosed
--
--  FILE:     V_VADS_EXEC.A
--
--  UNITS:    VADS/EXEC Package Specifications
--
--  PURPOSE:  This file contains the user's high level interface to VADS_EXEC.
--            It contains packages for each of the following services:
--
--              Interrupt Handling  (package V_INTERRUPTS)
--              Tasking Extensions  (package V_XTASKING)
--              Semaphores          (package V_SEMAPHORES)
--              Mailboxes           (package V_MAILBOXES)
--              Memory Management   (package V_MEMORY)
--              Stack Operations    (package V_STACK)
--
--            The specifications for the above packages are contained in
--            this file. The bodies are located in the following files also
--            found in this directory:
--              V_INTERRUPTS    v_intr_b.a
--              V_XTASKING      v_xtask_b.a
--              V_SEMAPHORES    v_sema_b.a
--              V_MAILBOXES     v_mbox_b.a
--              V_MEMORY        v_mem_b.a
--              V_STACK         v_stack_b.a
--
--            These packages are layered upon the low level kernel/library
--            primitives. The interface to these primitives is provided by
--            the V_I_* packages also found in this directory.
--
--            Do not modify or recompile these packages.
--
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
--
--  Revision History:
--
--  880306:1430     B01
--
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------

with V_I_Types;
with System;
package V_Interrupts is

    pragma Suppress (All_Checks);

    --   PURPOSE : V_INTERRUPTS provides interrupt processing support
    --             for the use of user-defined interrupt service
    --             routines (ISR's), the getting/setting of interrupt status and
    --             entering/leaving of supervisor state for the current task.
    --
    --             Refer to V_INTERRUPTS's machine dependent body in
    --             V_INTR_B.A file for an outline of the actions that must
    --             be performed in an ISR.
    --
    --
    --     NOTES ON FLOATING-POINT COPROCESSOR SAVE/RESTORE IN ISR's:
    --
    --             A save/restore of the floating-point coprocessor state is
    --             necessary if a coprocessor is in use and
    --             floating-point objects might be used
    --             during the execution of the interrupt handler.  Note
    --             that VADS_EXEC does not use floating-point
    --             objects; thus, a coprocessor save/restore is not
    --             necessary before calling the services.
    --
    --     NOTES ON DATA REFERENCES IN ISR's:
    --
    --             The user-defined interrupt handler must not reference
    --             non-local stack-relative data (including tasks declared
    --             within a subprogram).  Instead, all references should
    --             be either to objects declared in library-level
    --             package specifications/bodies, in the interrupt
    --             handler itself or in subprograms called by the handler.
    --
    --     NOTES ON EXCEPTION PROPAGATION IN ISR's:
    --
    --             Exceptions raised in an interrupt handler must be
    --             handled locally.  An "others" exception handler should
    --             be provided to prevent attempting to propogate an
    --             exception from an interrupt handler.  If you don't provide
    --             a handler for a raised exception (such as NUMERIC_ERROR),
    --             then, the entire program is abandoned (just like an unhandled
    --             exception for the main subprogram).
    --
    --     NOTES ON ISR/ADA TASK INTERACTION:
    --
    --             An ISR executes in the context of the task it interrupted.
    --             Since the ISR does not have its own task state, it must
    --             not perform any Ada tasking operations which would affect
    --             the state of the interrupted task:
    --
    --               - task creations
    --               - accept statements
    --               - entry calls
    --               - delay statements
    --               - abort statements
    --               - evaluation of an allocator or deallocator
    --
    --             In addition, the ISR cannot invoke any VADS_EXEC service which
    --             might block:
    --
    --               - SUSPEND_TASK
    --               - WAIT_SEMAPHORE
    --               - WAIT_MAILBOX
    --               - any V_MEMORY allocator or deallocator
    --
    --             If the ISR calls a service that would block, the
    --             TASKING_ERROR exception is raised.
    --
    --             It may, however, invoke any non-blocking operation,
    --             including:
    --
    --               - RESUME_TASK
    --               - SIGNAL_SEMAPHORE
    --               - WRITE_MAILBOX
    --
    --             Floating-point registers do not have to be saved before
    --             invoking VADS_EXEC services from an ISR.
    --
    --             The tasking and interrupt services support pre-emptive
    --             task scheduling.  If a call to a service from an
    --             interrupt handler causes a task with a priority higher
    --             than that of the interrupted task to become ready to run,
    --             the higher priority task will run immediately upon return
    --             from the outermost interrupt service routine.
    --
    --
    --   EXAMPLE :
    --
    --             package ISR_EXAMPLE is
    --             end;
    --
    --             with V_INTERRUPTS;
    --             with SYSTEM;
    --             package body ISR_EXAMPLE is
    --
    --               INTEGER_CNT: integer := 0;
    --               FLOAT_CNT: float := 0.0;
    --
    --               procedure INTEGER_HANDLER is
    --               begin
    --                 -- No floating point operations
    --
    --                 INTEGER_CNT := INTEGER_CNT + 1;
    --               end;
    --
    --               procedure FLOAT_HANDLER is
    --               begin
    --                 -- Does floating point operations
    --
    --                 FLOAT_CNT := FLOAT_CNT + 1.0;
    --               end;
    --
    --
    --               procedure INTEGER_ISR is new
    --                   V_INTERRUPTS.ISR(INTEGER_HANDLER);
    --                 -- An instantiated isr that doesn't perform any floating
    --                 -- point operations.
    --
    --               procedure WRAPPED_FLOAT_HANDLER is new
    --                   V_INTERRUPTS.FLOAT_WRAPPER(FLOAT_HANDLER);
    --                 -- An instantiated subprogram with floating point state
    --                 -- saved and initialized upon entry and then restored
    --                 -- upon return. This wrapped procedure is passed when
    --                 -- the isr is instantiated.
    --
    --               procedure FLOAT_ISR is new
    --                   V_INTERRUPTS.ISR(WRAPPED_FLOAT_HANDLER);
    --                 -- An instantiated isr that performs floating point
    --                 -- operations.
    --             begin
    --               -- Attach above instantiated isr's
    --               V_INTERRUPTS.ATTACH_ISR(16#80#, INTEGER_ISR'address);
    --               V_INTERRUPTS.ATTACH_ISR(16#81#, FLOAT_ISR'address);
    --             end ISR_EXAMPLE;


    -- The following type is used to specify the valid range for
    -- interrupt vector numbers.

    subtype Vector_Id is V_I_Types.Intr_Vector_Id_T;

    -- The following type is used for interrupt status

    subtype Interrupt_Status_T is V_I_Types.Intr_Status_T;

    -- Machine independent interrupt status constants

    Enable_Interrupt : constant Interrupt_Status_T :=
       V_I_Types.Enable_Intr_Status;

    Disable_Interrupt : constant Interrupt_Status_T :=
       V_I_Types.Disable_Intr_Status;


    -- The following exceptions may be raised by interrupt services.

    Invalid_Interrupt_Vector : exception;

    -- INVALID_INTERRUPT_VECTOR is raised if the vector number passed to the
    -- service is not a valid vector number.

    Vector_In_Use : exception;

    -- VECTOR_IN_USE is raised if an attempt is made to attach an ISR
    -- to a vector that is already attached to an ISR.

    Unexpected_V_Interrupts_Error : exception;

    -- UNEXPECTED_V_INTERRUPTS_ERROR may be raised if an unexpected
    -- error occurs in an V_INTERRUPTS routine.

    generic
        with procedure Interrupt_Handler;
    procedure Isr;
    pragma Share_Code (Isr, False);

    -- Purpose:     ISR provides the wrapper required for all
    --              interrupt service routines.  It may be instantiated
    --              with a parameterless procedure which provides the
    --              handler for a particular interrupt.  The address
    --              of the resulting instantiation should be passed to
    --              ATTACH_ISR to attach the interrupt service routine
    --              to a particular vector.
    --
    -- Notes:       This wrapper doesn't save/restore the floating point
    --              context.
    --
    --              This generic must be instantiated at the library
    --              package level.


    generic
        with procedure Interrupt_Handler;
    procedure Fast_Isr;
    pragma Share_Code (Fast_Isr, False);

    -- Purpose:     Faster version of the above ISR wrapper.  Refer
    --              to V_INTERRUPTS's machine dependent body in
    --              V_INTR_B.A file for additional restrictions imposed
    --              on the INTERRUPT_HANDLER procedure.


    generic
        with procedure Float_Handler;
    procedure Float_Wrapper;
    pragma Share_Code (Float_Wrapper, False);

    -- Purpose:     FLOAT_WRAPPER saves/restores the floating point state.
    --              Before FLOAT_HANDLER is called, the floating point state
    --              is reset and float exceptions are enabled according to
    --              the FLOATING_POINT_CONTROL parameter in the kernel
    --              program's configuration package (V_KRN_CONF).
    --              See the body of this generic for further details.
    --
    --              The resultant instantiation is normally used as an input
    --              procedure parameter to the above ISR generic.


    procedure Attach_Isr (Vector : in Vector_Id; Isr : in System.Address);

    -- Purpose:       To attach an interrupt service routine to a given
    --                interrupt vector.
    -- Where:
    --
    --   vector       specifies the interrupt vector number to which
    --                the interrupt service routine is to be attached.
    --                The vector number is the number, not address,
    --                of the interrupt vector.
    --
    --   isr          specifies the address of the interrupt service routine.
    --
    -- Exceptions:
    --
    --   INVALID_INTERRUPT_VECTOR is raised if the vector number is
    --   out-of-range.
    --
    --   VECTOR_IN_USE is raised if an interrupt handler has already been
    --   assigned to the vector.


    procedure Detach_Isr (Vector : in Vector_Id);

    -- Purpose:       To detach an interrupt routine from a given
    --                interrupt vector (the attachment may have been
    --                performed during VADS kernel initialization if the vector
    --                was given an initial value in the user's interrupt
    --                vector table).
    --
    -- Where:
    --
    --   vector       specifies the number of the interrupt vector
    --                which is to be detach.  The vector number is
    --                the number, not address, of the interrupt vector.
    --
    -- Notes:         The interrupt service routine V_DEFAULT_ISR
    --                defined in the V_KRN_CONF package will
    --                be attached to the vector.
    --
    -- Exceptions:
    --
    --   INVALID_INTERRUPT_VECTOR is raised if the vector number is
    --   out-of-range.


    function Current_Interrupt_Status return Interrupt_Status_T;

    -- Purpose:       To get the current CPU interrupt status (mask or priority
    --                level.


    function Set_Interrupt_Status
                (New_Status : in Interrupt_Status_T) return Interrupt_Status_T;

    -- Purpose:       To set the interrupt status (mask or priority) to a
    --                different setting.  The previous interrupt status
    --                is returned.
    -- Where:
    --
    --   new_status   specifies the new interrupt status setting.

    procedure Enter_Supervisor_State;

    -- Purpose:       To enter supervisor state for the current task.
    --                This allows subsequent execution of privilege
    --                instructions.

    procedure Leave_Supervisor_State;

    -- Purpose:       To leave supervisor state for the current task.
    --                Subsequent execution of privilege instructions results
    --                in a CPU exception.

end V_Interrupts;



E3 Meta Data

    nblk1=f
    nid=0
    hdr6=1e
        [0x00] rec0=17 rec1=00 rec2=01 rec3=004
        [0x01] rec0=17 rec1=00 rec2=02 rec3=040
        [0x02] rec0=17 rec1=00 rec2=03 rec3=04a
        [0x03] rec0=13 rec1=00 rec2=04 rec3=004
        [0x04] rec0=14 rec1=00 rec2=05 rec3=004
        [0x05] rec0=17 rec1=00 rec2=06 rec3=044
        [0x06] rec0=1c rec1=00 rec2=07 rec3=00a
        [0x07] rec0=14 rec1=00 rec2=08 rec3=042
        [0x08] rec0=1e rec1=00 rec2=09 rec3=07a
        [0x09] rec0=1a rec1=00 rec2=0a rec3=008
        [0x0a] rec0=1a rec1=00 rec2=0b rec3=026
        [0x0b] rec0=17 rec1=00 rec2=0c rec3=062
        [0x0c] rec0=19 rec1=00 rec2=0d rec3=012
        [0x0d] rec0=1e rec1=00 rec2=0e rec3=042
        [0x0e] rec0=08 rec1=00 rec2=0f rec3=000
    tail 0x21739b6be85657424a27f 0x42a00088462060003