-- rendezvous.
with Ada.Task_Identification;
--- used for Task_ID type
+-- used for Task_Id type
with Ada.Exceptions;
-- used for Raise_Exception
-- Integer_Address
with System.Tasking;
--- used for Task_ID
+-- used for Task_Id
-- Task_Entry_Index
-- Null_Task
-- Self
package IMOP renames System.Interrupt_Management.Operations;
function To_System is new Unchecked_Conversion
- (Ada.Task_Identification.Task_Id, Task_ID);
+ (Ada.Task_Identification.Task_Id, Task_Id);
-----------------
-- Local Tasks --
-- nizing it.
task Interrupt_Manager is
- entry Detach_Interrupt_Entries (T : Task_ID);
+ entry Detach_Interrupt_Entries (T : Task_Id);
entry Initialize (Mask : IMNG.Interrupt_Mask);
Static : Boolean);
entry Bind_Interrupt_To_Entry
- (T : Task_ID;
+ (T : Task_Id;
E : Task_Entry_Index;
Interrupt : Interrupt_ID);
type Server_Task_Access is access Server_Task;
- --------------------------------
- -- Local Types and Variables --
- --------------------------------
+ -------------------------------
+ -- Local Types and Variables --
+ -------------------------------
type Entry_Assoc is record
- T : Task_ID;
+ T : Task_Id;
E : Task_Entry_Index;
end record;
pragma Volatile_Components (Ignored);
-- True iff the corresponding interrupt is blocked in the process level
- Last_Unblocker : constant array (Interrupt_ID'Range) of Task_ID :=
+ Last_Unblocker : constant array (Interrupt_ID'Range) of Task_Id :=
(others => Null_Task);
-- ??? pragma Volatile_Components (Last_Unblocker);
-- Holds the ID of the last Task which Unblocked this Interrupt.
-- It contains Null_Task if no tasks have ever requested the
-- Unblocking operation or the Interrupt is currently Blocked.
- Server_ID : array (Interrupt_ID'Range) of Task_ID :=
+ Server_ID : array (Interrupt_ID'Range) of Task_Id :=
(others => Null_Task);
pragma Atomic_Components (Server_ID);
- -- Holds the Task_ID of the Server_Task for each interrupt.
- -- Task_ID is needed to accomplish locking per Interrupt base. Also
+ -- Holds the Task_Id of the Server_Task for each interrupt.
+ -- Task_Id is needed to accomplish locking per Interrupt base. Also
-- is needed to decide whether to create a new Server_Task.
-- Type and Head, Tail of the list containing Registered Interrupt
-- Current_Handler --
---------------------
- function Current_Handler (Interrupt : Interrupt_ID)
- return Parameterless_Handler is
+ function Current_Handler
+ (Interrupt : Interrupt_ID) return Parameterless_Handler
+ is
begin
if Is_Reserved (Interrupt) then
Raise_Exception (Program_Error'Identity, "Interrupt" &
-- already bound.
procedure Bind_Interrupt_To_Entry
- (T : Task_ID;
+ (T : Task_Id;
E : Task_Entry_Index;
Int_Ref : System.Address)
is
-- Detach_Interrupt_Entries --
------------------------------
- procedure Detach_Interrupt_Entries (T : Task_ID) is
+ procedure Detach_Interrupt_Entries (T : Task_Id) is
begin
Interrupt_Manager.Detach_Interrupt_Entries (T);
end Detach_Interrupt_Entries;
------------------
function Unblocked_By
- (Interrupt : Interrupt_ID) return System.Tasking.Task_ID is
+ (Interrupt : Interrupt_ID) return System.Tasking.Task_Id is
begin
if Is_Reserved (Interrupt) then
Raise_Exception (Program_Error'Identity, "Interrupt" &
task body Interrupt_Manager is
- ---------------------
- -- Local Routines --
- ---------------------
+ --------------------
+ -- Local Routines --
+ --------------------
procedure Unprotected_Exchange_Handler
(Old_Handler : out Parameterless_Handler;
end if;
-- Invoke a corresponding Server_Task if not yet created.
- -- Place Task_ID info in Server_ID array.
+ -- Place Task_Id info in Server_ID array.
if Server_ID (Interrupt) = Null_Task then
Access_Hold := new Server_Task (Interrupt);
end Detach_Handler;
or accept Bind_Interrupt_To_Entry
- (T : Task_ID;
+ (T : Task_Id;
E : Task_Entry_Index;
Interrupt : Interrupt_ID)
do
T.Interrupt_Entry := True;
-- Invoke a corresponding Server_Task if not yet created.
- -- Place Task_ID info in Server_ID array.
+ -- Place Task_Id info in Server_ID array.
if Server_ID (Interrupt) = Null_Task then
end if;
end Bind_Interrupt_To_Entry;
- or accept Detach_Interrupt_Entries (T : Task_ID)
+ or accept Detach_Interrupt_Entries (T : Task_Id)
do
for J in Interrupt_ID'Range loop
if not Is_Reserved (J) then
-----------------
task body Server_Task is
- Self_ID : constant Task_ID := Self;
+ Self_ID : constant Task_Id := Self;
Tmp_Handler : Parameterless_Handler;
- Tmp_ID : Task_ID;
+ Tmp_ID : Task_Id;
Tmp_Entry_Index : Task_Entry_Index;
Intwait_Mask : aliased IMNG.Interrupt_Mask;
-------------------------------------
function Has_Interrupt_Or_Attach_Handler
- (Object : access Dynamic_Interrupt_Protection)
- return Boolean
+ (Object : access Dynamic_Interrupt_Protection) return Boolean
is
pragma Warnings (Off, Object);
return True;
end Has_Interrupt_Or_Attach_Handler;
- ----------------
- -- Finalize --
- ----------------
+ --------------
+ -- Finalize --
+ --------------
procedure Finalize (Object : in out Static_Interrupt_Protection) is
begin
-- ??? loop to be executed only when we're not doing library level
-- finalization, since in this case all interrupt tasks are gone.
+
if not Interrupt_Manager'Terminated then
for N in reverse Object.Previous_Handlers'Range loop
Interrupt_Manager.Attach_Handler
-------------------------------------
function Has_Interrupt_Or_Attach_Handler
- (Object : access Static_Interrupt_Protection)
- return Boolean
+ (Object : access Static_Interrupt_Protection) return Boolean
is
pragma Warnings (Off, Object);
begin