|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ T V ┃
Length: 5830 (0x16c6) Types: TextFile Names: »V«
└─⟦516dceb10⟧ Bits:30000751 8mm tape, Rational 1000, RCI_VADS └─ ⟦9a14c9417⟧ »DATA« └─⟦this⟧
-- Copyright 1989, 1991 Verdix Corporation ------------------------------------------------------------------------------ -- User interface to the program / task callout services ------------------------------------------------------------------------------ with V_I_Types; use V_I_Types; with System; use System; package V_I_Callout is pragma Suppress (All_Checks); pragma Suppress (Exception_Tables); pragma Not_Elaborated; -- Callout events type Callout_Event_T is (Exit_Event, Unexpected_Exit_Event, Program_Switch_Event, -- stack limit checking must be suppressed Task_Create_Event, Task_Switch_Event, Task_Complete_Event); for Callout_Event_T'Size use Integer'Size; -- Id for accessing user defined storage in the task control block type Task_Storage_Id is new Integer; No_Task_Storage_Id : constant Task_Storage_Id := Task_Storage_Id (0); -- Service to install a program or task callout. procedure Install_Callout (Event : Callout_Event_T; Proc : Address); -- If not enough memory in the kernel for the callout control -- block, then, the STORAGE_ERROR exception is raised. -- -- Callout procedures are called in the order they are installed. -- 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 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 -- Called when the program exits or terminates itself. Not -- called when the program is terminated from another program. -- Still called when the UNEXPECTED_EXIT_EVENT callout is called. -- -- UNEXPECTED_EXIT_EVENT -- Called when the program is abandoned due to an unhandled Ada -- exception. -- -- PROGRAM_SWITCH_EVENT -- Called before switching to a task that resides in a -- program different from the current program. Called for -- all program switches, not just switches to and from the -- program containing the callout. -- -- TASK_CREATE_EVENT -- Called whenever a task is created in the program containing -- the callout. Since the TASK_CREATE_EVENT callout can be -- called after numerous tasks have already been created, the -- install_callout service loops through all existing tasks -- invoking the just installed TASK_CREATE_EVENT callout before -- returning. -- -- TASK_SWITCH_EVENT -- Called before switching to a different task in the same -- program. For a program switch, the TASK_SWITCH_EVENT -- callout is called with the tsk parameter set to -- v_i_types.null_task. -- -- TASK_SWITCH_COMPLETE -- Called whenever any task in the callout's program completes or -- is aborted. -- -- -- An EXIT_EVENT or UNEXPECTED_EXIT_EVENT callout procedure -- is called as follows: -- procedure exit_callout_proc( -- status: integer); -- main subprogram -- -- return status -- -- A PROGRAM_SWITCH_EVENT callout procedure is called as follows: -- procedure program_switch_callout_proc( -- new_prg: a_progam_t; -- new_key: address); -- -- A TASK_CREATE_EVENT, TASK_SWITCH_EVENT or TASK_COMPLETE_EVENT -- callout procedure is called as follows: -- procedure task_callout_proc( -- tsk: a_task_t); -- Service to allocate storage in the task control block function Allocate_Task_Storage (Size : Integer) return Task_Storage_Id; -- 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 function Get_Task_Storage (Tsk : A_Task_T; Storage_Id : Task_Storage_Id) return Address; -- 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. private pragma Interface (Ada, Install_Callout); pragma Interface_Name (Install_Callout, "__INSTALL_CALLOUT"); pragma Interface (Ada, Allocate_Task_Storage); pragma Interface_Name (Allocate_Task_Storage, "TS_ALLOCATE_TASK_STORAGE"); pragma Interface (Ada, Get_Task_Storage); pragma Interface_Name (Get_Task_Storage, "__GET_TASK_STORAGE"); end V_I_Callout;