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

⟦c8b91c8b1⟧ Ada Source

    Length: 17408 (0x4400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, generic, package V_Krn_Conf_I, seg_04ce21

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_KRN_CONF_I.A
--
--  UNIT:     VADS Interface for Configuring the Tasking (or No
--            Tasking) Kernel Program for the M68000 Processor Family Cross
--            Targets.
--
--  PURPOSE:  This package provides the interface to the VADS kernel used by
--            the package V_KRN_CONF.  It contains types, objects,
--            and subprograms used to convey configuration information to and
--            from the kernel. It also contains a generic for an
--            interrupt handler linked into the kernel program and the kernel
--            subprograms that can be called from interrupt handler packages
--            linked into the kernel program.
--
--            This package consists of the following type definitions,
--            constants, generics and kernel subprogram interfaces:
--            1.  Startup table
--            2.  Interrupt vector table
--            3.  Configuration table
--            4.  Misc kernel program variables
--            5.  VADS supplied kernel ISRs
--            6.  Boot subprogram
--            7.  Execute subprogram
--            8.  Interrupt handler generic
--            9 . Kernel service subprograms
--
--  NOTES:    Do not modify this package.
--
--            This package may only be included in the kernel program.
--            It MAY NOT be included in the user or TDM programs.
--
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
--
--  Revision History:
--
--  870706:2132     A00     Initial version.
--
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------

with System;
use System;
with Krn_Defs;
with V_I_Types;
with Link_Block;
with Unchecked_Conversion;

package V_Krn_Conf_I is

    pragma Suppress (All_Checks);
    pragma Suppress (Exception_Tables);


--------------------------- #i1: Startup Table ---------------------------------

    type Startup_Table_T is
        record
            Startup_Stack_Base : Address;
            -- specifies the address at which the
            -- stack used during system
            -- startup should begin.  The stack
            -- will grow from this address towards
            -- lower memory.
            --
            -- Normally set to top of the heap/stack
            -- area.
            --
            -- This stack is only used during startup.
            Startup_Stack_Size : Integer;
            -- is the size in BYTES of the startup
            -- stack.
        end record;


----------------------- #i2: Interrupt Vector Table ----------------------------


    type Interrupt_Vector_Table_T is array (Natural range <>) of Address;

    Untouchable_Vector : constant Address :=
       System.Memory_Address (16#FFFF_FFFF#);


-------------------------- #i3: Configuration Table ----------------------------

    subtype Floating_Point_Control_T is V_I_Types.Floating_Point_Control_T;

    type Configuration_Table_T is
        record
            Heap_Stack_Bottom : Address;
            Heap_Stack_Top : Address;
            -- Bottom and top of memory where heaps
            -- and stacks are allocated from.
            -- Normally, HEAP_STACK_BOTTOM will be
            -- set to first ram address following
            -- end of kernel/TDM/user programs and
            -- HEAP_STACK_TOP set to highest ram
            -- location.

            -- If HEAP_STACK_BOTTOM is set to the
            -- constant,
            -- v_krn_conf_i.END_OF_USER_PROGRAM,
            -- then, this value is computed
            -- dynamically by reading the user
            -- program's group tables.
            Krn_Stack_Size : Integer;
            -- Size of kernel's stack.
            Intr_Stack_Size : Integer;
            -- Size of interrupt stack.
            -- Stack size excludes room at bottom for
            -- exception handling.
            Krn_Exception_Stack_Size : Natural;
            -- Space below the bottom of the
            -- interrupt handlers' stack or the
            -- kernel task stacks for exception
            -- unwinding.
            Task_Supervisor_Stack_Size : Integer;
            -- Size of supervisor stack needed for
            -- tasks executing in user state.  The
            -- task's supervisor stack is used for
            -- kernel traps, numeric exception
            -- handling and external interrupt
            -- handling (before switching to interrupt
            -- stack). Not used if
            -- SUPERVISOR_TASKS_ENABLED parameter
            -- is TRUE.
            Zero_Stacks_Enabled : Boolean;
            -- When true, at task create its
            -- stack area is zeroed. Since the
            -- stack area for all tasks is zeroed
            -- at startup, normally only set to true
            -- when using the debugger's "lt use"
            -- command for dynamically terminated and
            -- re-created tasks.
            Supervisor_Tasks_Enabled : Boolean;
            -- Set to TRUE to enable execution
            -- of all user tasks in supervisor state.
            Master_State_Enabled : Boolean;
            -- When TRUE, the kernel and
            -- supervisor tasks use the master
            -- stack instead of the interrupt stack.
            -- Not applicable to mc68000 or mc68010
            -- processors.
            User_Status : Short_Integer;
            -- Setting of status register when user
            -- program is started at completion of
            -- kernel startup. If above
            -- SUPERVISOR_TASKS_ENABLED parameter
            -- is TRUE, then, user program is
            -- started in supervisor state
            -- irregardless of the S bit value for
            -- this parameter. The above
            -- MASTER_STATE_ENABLED parameter
            -- is used to determine the setting
            -- of the M bit.
            Disable_Intr_Priority : Short_Integer;
            -- Setting of interrupt priority mask
            -- within status register when interrupts
            -- are disabled within kernel.
            --
            -- Note only bits 8 .. 10 are used.
            Vector_Base_Register : Address;
            -- starting location of the interrupt
            -- vector table.
            Interrupt_Vector_Size : Integer;
            -- indicates the number of interrupt
            -- vectors associated with this processor.
            Interrupt_Vector_Image : Address;
            -- starting location of the user's image
            -- of the vector table.
            Floating_Point_Control : Floating_Point_Control_T;
            -- is the initial value for the fpcr
            -- register on the MC68881.
            Time_Slicing_Enabled : Boolean;
            -- Set to TRUE to enable time slicing.
            Time_Slice_Interval : Duration;
            -- Task's initial time slice value.
            Time_Slice_Priority : Priority;
            -- If time slicing is enabled, then, it
            -- is only applicable to tasks whose
            -- priority is less than or equal to
            -- this threshold priority.
            Idle_Stack_Size : Integer;
            -- specifies the size in BYTES of the
            -- internal Idle Task's stack.
            Task_Storage_Size : Integer;
            -- specifies the size in BYTES of the
            -- area allocated in the task control
            -- block for user storage
            Pending_Count : Integer;
            -- specifies the maximum number of kernel
            -- service requests from an ISR (or
            -- nested ISR) held pending until the
            -- outer-most ISR completes. When
            -- the outer-most ISR completes,
            -- the kernel processes the queue of
            -- pending requests.
        end record;

    type A_Configuration_Table_T is access Configuration_Table_T;
    function To_A_Configuration_Table_T is
       new Unchecked_Conversion (Address, A_Configuration_Table_T);

    Untouchable_Vbr : constant Address := System.Memory_Address (16#FFFF_FFFF#);
    No_Vbr : constant Address := System.Memory_Address (16#FFFF_FFFE#);
    Untouchable_Table : constant Address :=
       System.Memory_Address (16#FFFF_FFFF#);

    End_Of_User_Program : constant Address :=
       System.Memory_Address (16#FFFF_FFFF#);


--------------------- #i4: Misc Kernel Program Variables -----------------------

    Stack_Limit : Address;
    pragma Interface_Name (Stack_Limit, "STACK_LIMIT");
    -- Bottom of kernel/interrupt stack

    User_Link_Block : Link_Block.Link_Block_T;
    pragma Interface_Name (User_Link_Block, "USER_LINK_BLOCK");
    -- Link block in user's program.

    Group_Table : array (1 .. 1) of Character;
    pragma Interface_Name (Group_Table, "GROUP_TABLE");
    -- Table generated by the cross linker that defines the
    -- memory locations of the different program groups (text, constant,
    -- data, bss and void). Compiler defined dope vector information
    -- precedes the group records.


------------------------- #i5: VADS Supplied ISRs ------------------------------

    procedure Bus_Error_Handler;
    pragma Interface (Ada, Bus_Error_Handler);
    pragma Interface_Name (Bus_Error_Handler, "KRN_BUS_ERROR_HANDLER");
    --  #2
    procedure Address_Error_Handler;
    pragma Interface (Ada, Address_Error_Handler);
    pragma Interface_Name (Address_Error_Handler, "KRN_ADDRESS_ERROR_HANDLER");
    --  #3
    procedure Zero_Divide_Handler;
    pragma Interface (Ada, Zero_Divide_Handler);
    pragma Interface_Name (Zero_Divide_Handler, "KRN_ZERO_DIVIDE_HANDLER");
    --  #5
    procedure Chk_Instr_Handler;
    pragma Interface (Ada, Chk_Instr_Handler);
    pragma Interface_Name (Chk_Instr_Handler, "KRN_CHK_INSTR_HANDLER");
    --  #6
    procedure Trapv_Cc_Instr_Handler;
    pragma Interface (Ada, Trapv_Cc_Instr_Handler);
    pragma Interface_Name (Trapv_Cc_Instr_Handler,
                           "KRN_TRAPV_CC_INSTR_HANDLER");
    --  #7

    procedure Float_Error_Handler;
    pragma Interface (Ada, Float_Error_Handler);
    pragma Interface_Name (Float_Error_Handler, "KRN_FLOAT_ERROR_HANDLER");
    --  #50, 52, 53, 54

    procedure Enter_From_User;
    pragma Interface (Ada, Enter_From_User);
    pragma Interface_Name (Enter_From_User, "__KRN_ENTER_FROM_USER");
    -- Kernel service trap
    --  #32 - trap 0 (default)


------------------------- #i6: Boot Subprogram ---------------------------------

    procedure V_Boot (Configuration_Table_A : Address);
    --  specifies the user's configuration table
    --  declared in the configuration package.
    pragma Interface (Ada, V_Boot);
    pragma Interface_Name (V_Boot, "V_BOOT");

    -- V_BOOT is called from the kernel startup program to
    -- boot/initialize the kernel's tasking data structures.


------------------------ #i7: Execute Subprogram -------------------------------

    procedure V_Execute;
    pragma Interface (Ada, V_Execute);
    pragma Interface_Name (V_Execute, "V_EXECUTE");

    -- V_EXECUTE is called at the end of the kernel startup program to
    -- start execution of the user program


---------------------- #i8: Interrupt Handler Generic --------------------------

    generic
        with procedure Process_Interrupt;
    procedure Interrupt_Handler;
    pragma Share_Body (Interrupt_Handler, False);
    -- Interrupt handler wrapper
    --
    -- Instantiate your handler by:
    -- my_interrupt_handler is new
    --      V_KRN_CONF_I.interrupt_handler(my_process_interrupt);
    --
    -- See generic body below for details.


----------------------- #i9: Kernel Service Subprograms ------------------------

    subtype Intr_Status_T is Krn_Defs.Intr_Status_T;

    procedure Interrupts_Disable (Old_Status : out Intr_Status_T);
    pragma Interface (Ada, Interrupts_Disable);
    pragma Interface_Name (Interrupts_Disable, "__KRN_INTERRUPTS_DISABLE");
    -- Disables interrupts by setting the Status Register's Interrupt
    -- Priority Level (IPL) according to the DISABLE_INTR_PRIORITY
    -- configuration parameter. The IPL is read before it is modified.

    procedure Interrupts_Restore (Restore_Status : Intr_Status_T);
    pragma Interface (Ada, Interrupts_Restore);
    pragma Interface_Name (Interrupts_Restore, "__KRN_INTERRUPTS_RESTORE");
    -- Restores IPL using status returned by previous
    -- DISABLE_INTERRUPTS invocation.

    function Replace_Vector
                (Iv : Krn_Defs.Intr_Vector_Id_T; Isr : Address) return Address;
    pragma Interface (Ada, Replace_Vector);
    pragma Interface_Name (Replace_Vector, "__KRN_REPLACE_VECTOR");
    -- Replace interrupt vector
    --
    --  intr_num        - interrupt vector number
    --  handler_address - the address of the handler to be placed
    --                    in the interrupt vector table, NO_ADDR
    --                    implies replace with RTS kernel's null handler
    --
    --  Returns the address of the previously installed handler.

    procedure Isr_Enter;
    pragma Interface (Ada, Isr_Enter);
    pragma Interface_Name (Isr_Enter, "__KRN_ISR_ENTER");
    -- Enter ISR handler
    --
    -- Increments the interrupt depth and switches to the interrupt stack
    -- if the depth was incremented from 0 to 1.
    --
    -- Note: if MASTER_STATE is enabled for mc68020, the CPU already did
    -- a switch from master to interrupt stack for an external interrupt.
    --
    -- The scratch registers (d0/d1/d2/d3/a0/a1) must be saved before calling
    -- ISR_ENTER.
    --
    -- The address of the previous
    -- stack is pushed on the new stack. This address is also pushed
    -- for nested interrupts. The address points to last entry
    -- pushed on the stack before the call.
    --
    --

    procedure Isr_Complete;
    pragma Interface (Ada, Isr_Complete);
    pragma Interface_Name (Isr_Complete, "__KRN_ISR_COMPLETE");
    -- Complete ISR handler
    --
    -- ISR_COMPLETE expects stack to look as follows   --     0 - return pc back to handler
    --     4 - pointer to previous stack (see below) (normally, the
    --           address pushed on the new stack by ISR_ENTER)
    --
    --  where previous stack looks as follows:
    --     0 - d0/d1/d2/d3/a0/a1 (saved scratch registers)
    --    24 - handler's exception stack frame
    --
    -- ISR_ENTER must have been previously called for this interrupt.
    --
    --
    -- Note: no return back to interrupt handler.

    procedure Post_Alarm;
    pragma Interface (Ada, Post_Alarm);
    pragma Interface_Name (Post_Alarm, "__KRN_POST_ALARM");
    -- Post alarm
    --
    -- This procedure is called by the timer interrupt handler
    -- (in V_KRN_CONF.V_TIMER_SUPPORT package) to notify the
    -- RTS that the scheduled alarm has been reached.



end V_Krn_Conf_I;



E3 Meta Data

    nblk1=10
    nid=0
    hdr6=20
        [0x00] rec0=14 rec1=00 rec2=01 rec3=030
        [0x01] rec0=17 rec1=00 rec2=02 rec3=020
        [0x02] rec0=22 rec1=00 rec2=03 rec3=050
        [0x03] rec0=1d rec1=00 rec2=04 rec3=026
        [0x04] rec0=17 rec1=00 rec2=05 rec3=062
        [0x05] rec0=16 rec1=00 rec2=06 rec3=008
        [0x06] rec0=16 rec1=00 rec2=07 rec3=00a
        [0x07] rec0=15 rec1=00 rec2=08 rec3=00a
        [0x08] rec0=15 rec1=00 rec2=09 rec3=056
        [0x09] rec0=1c rec1=00 rec2=0a rec3=014
        [0x0a] rec0=17 rec1=00 rec2=0b rec3=056
        [0x0b] rec0=1c rec1=00 rec2=0c rec3=076
        [0x0c] rec0=1b rec1=00 rec2=0d rec3=07a
        [0x0d] rec0=16 rec1=00 rec2=0e rec3=030
        [0x0e] rec0=1b rec1=00 rec2=0f rec3=002
        [0x0f] rec0=1b rec1=00 rec2=10 rec3=000
    tail 0x2175424ae874f7c381bab 0x42a00088462060003