|
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 - download
Length: 10240 (0x2800) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package V_I_Callout, seg_04b9a7
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« └─⟦this⟧
-- Copyright 1989, 1991, 1992 Verdix Corporation ------------------------------------------------------------------------------ -- User interface to the program / task callout services -- -- 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 callout data structures and -- subprograms found in ada_krn_defs.a and ada_krn_i.a. -- -- Differences from earlier releases: -- [1] Only the callout events, EXIT_EVENT and UNEXPECTED_EXIT_EVENT -- are supported by all the underlying RTS kernels. The --\x09\x09VADS_MICRO RTS continues to support the events: --\x09\x09PROGRAM_SWITCH_EVENT, TASK_CREATE_EVENT, TASK_SWITCH_EVENT --\x09\x09and TASK_COMPLETE_EVENT. The event, IDLE_EVENT has been --\x09\x09added for the VADS_MICRO RTS. -- [2] For VADS_MICRO: the task events are called with a pointer to --\x09\x09the micro kernel's task control block, not the Ada task_id as was --\x09\x09done in earlier releases. -- [3] For VADS_MICRO: the program events are called with a pointer to --\x09\x09the micro kernel's program control block, not the Ada program_id as was --\x09\x09done in earlier releases. -- [4] Added the service, get_task_storage2() to get the address of -- task storage using the underlying kernel's task_id (not the -- Ada task_id as is used for get_task_storage()). This was added --\x09\x09because the task callouts are called with the kernel's task_id --\x09\x09and not the Ada task_id. ------------------------------------------------------------------------------ with System; use System; with Ada_Krn_Defs; package V_I_Callout is pragma Suppress (All_Checks); pragma Suppress (Exception_Tables); pragma Not_Elaborated; -- Underlying kernel task and program id's type Krn_Task_Id is new Ada_Krn_Defs.Krn_Task_Id; type Krn_Program_Id is new Ada_Krn_Defs.Krn_Task_Id; -- Callout events type Callout_Event_T is new Ada_Krn_Defs.Callout_Event_T; -- Id for accessing user defined storage in the task control block type Task_Storage_Id is new Ada_Krn_Defs.Task_Storage_Id; -- NO_TASK_STORAGE_ID: constant task_storage_id := --\x09\x09task_storage_id(ada_krn_defs.NO_TASK_STORAGE_ID); function No_Task_Storage_Id return Task_Storage_Id; pragma Inline_Only (No_Task_Storage_Id); -- Service to install a program or task callout. procedure Install_Callout (Event : Callout_Event_T; Proc : Address); pragma Inline_Only (Install_Callout); -- The following information is only applicable to the -- VADS_MICRO kernel. -- -- If not enough memory in the kernel for the callout control -- block, then, the STORAGE_ERROR exception is raised. -- -- For EXIT_EVENT or UNEXPECTED_EXIT_EVENT, the callout procedures -- are called LIFO. They are called in FIFO order for the other -- events. -- -- The callouts reside in the user program's -- space. The EXIT_EVENT and UNEXPECTED_EXIT_EVENT callouts are -- called in the context of the main program's task. The IDLE_EVENT -- callouts are called in the context of the idle task. The remaining -- callouts are called directly from kernel logic (use the kernel's -- stack) and can only call kernel services that are re-entrant, the -- same services callable from ISR's. The service of most interest is -- TS_CURRENT_TIME which would be called for time stamping. -- -- Before any non-PROGRAM_SWITCH_EVENT callout procedure is -- invoked, the STACK_LIMIT in the user program is set to 0 to -- negate any stack limit checking. Therefore, the callout -- procedures don't need to be compiled with stack limit checking -- suppressed. However, the STACK_LIMIT isn't zeroed before calling -- the PROGRAM_SWITCH_EVENT callout. It needs to be compiled with -- stack checking suppressed. -- -- Except for the PROGRAM_SWITCH_EVENT, the callouts are only -- installed and called for the program where they reside. -- -- An overview of each callout follows: -- -- EXIT_EVENT --\x09\x09Called when the program exits or terminates itself. Not --\x09\x09called when the program is terminated from another program. --\x09\x09Still called when the UNEXPECTED_EXIT_EVENT callout is called. -- -- UNEXPECTED_EXIT_EVENT --\x09\x09Called when the program is abandoned due to an unhandled Ada --\x09\x09exception. -- --\x09 IDLE_EVENT --\x09\x09Called repetitively whenever the idle task is executing. --\x09\x09 --\x09 PROGRAM_SWITCH_EVENT --\x09\x09Called before switching to a task that resides in a --\x09\x09program different from the current program. Called for --\x09\x09all program switches, not just switches to and from the --\x09\x09program containing the callout. -- --\x09 TASK_CREATE_EVENT --\x09\x09Called whenever a task is created in the program containing -- the callout. Since the TASK_CREATE_EVENT callout can be --\x09\x09called after numerous tasks have already been created, the --\x09\x09install_callout service loops through all existing tasks --\x09\x09invoking the just installed TASK_CREATE_EVENT callout before --\x09\x09returning. -- --\x09 TASK_SWITCH_EVENT --\x09\x09Called before switching to a different task in the same --\x09\x09program. For a program switch, the TASK_SWITCH_EVENT -- callout is called with the tsk parameter set to --\x09\x09system.NO_TASK_ID. -- --\x09 TASK_SWITCH_COMPLETE --\x09\x09Called whenever any task in the callout's program completes or --\x09\x09is aborted. -- -- -- An EXIT_EVENT or UNEXPECTED_EXIT_EVENT callout procedure -- is called as follows: --\x09 procedure exit_callout_proc( --\x09\x09\x09status:\x09\x09\x09integer);\x09-- main subprogram --\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09-- return status -- -- An IDLE_EVENT callout procedure is called as follows: --\x09\x09procedure idle_callout_proc; -- -- A PROGRAM_SWITCH_EVENT callout procedure is called as follows: --\x09 procedure program_switch_callout_proc( --\x09 new_prg: \x09krn_program_id; --\x09\x09\x09\x09-- NOTE: in earlier releases, new_prg was of --\x09\x09\x09\x09-- type, system.program_id. --\x09\x09\x09new_key:\x09\x09address); -- -- A TASK_CREATE_EVENT, TASK_SWITCH_EVENT or TASK_COMPLETE_EVENT -- callout procedure is called as follows: --\x09 procedure task_callout_proc( --\x09 tsk: \x09\x09krn_task_id); --\x09\x09\x09\x09-- NOTE: in earlier releases, tsk was of --\x09\x09\x09\x09-- type, system.task_id. -- Service to allocate storage in the task control block function Allocate_Task_Storage (Size : Integer) return Task_Storage_Id; pragma Inline_Only (Allocate_Task_Storage); -- If not enough memory in the task control block for the -- task storage, then, the STORAGE_ERROR exception is raised. -- The configuration parameter, TASK_STORAGE_SIZE, defines -- the size of the storage area set aside in the -- control block for each task. -- Each allocation from this area is aligned on a 4 or 8 -- byte boundary (the alignment is CPU dependent). -- The task storage allocation is only applicable to tasks in the -- current program. -- This service returns the starting address of the task storage area -- given the Ada task_id. function Get_Task_Storage (Ada_Tsk : System.Task_Id; Storage_Id : Task_Storage_Id) return Address; pragma Inline_Only (Get_Task_Storage); -- The storage_id parameter, contains the value returned by -- a previous call to allocate_task_storage. Its only -- applicable to tasks in the program where the -- allocate_task_storage service was called from. -- This service is called using the task's underlying kernel id -- instead of its Ada task_id as is done for the above get_task_storage(). -- Normally, get_task_storage2() is called from the task_callouts. function Get_Task_Storage2 (Krn_Tsk : Krn_Task_Id; Storage_Id : Task_Storage_Id) return Address; pragma Inline_Only (Get_Task_Storage2); end V_I_Callout;
nblk1=9 nid=0 hdr6=12 [0x00] rec0=16 rec1=00 rec2=01 rec3=086 [0x01] rec0=17 rec1=00 rec2=02 rec3=04a [0x02] rec0=17 rec1=00 rec2=03 rec3=06a [0x03] rec0=11 rec1=00 rec2=04 rec3=052 [0x04] rec0=18 rec1=00 rec2=05 rec3=04c [0x05] rec0=19 rec1=00 rec2=06 rec3=008 [0x06] rec0=18 rec1=00 rec2=07 rec3=070 [0x07] rec0=18 rec1=00 rec2=08 rec3=00e [0x08] rec0=0a rec1=00 rec2=09 rec3=000 tail 0x21750bd328684380daee1 0x42a00088462060003