summaryrefslogtreecommitdiff
path: root/gcc/ada/5zinterr.adb
diff options
context:
space:
mode:
authorbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-08 20:11:04 +0000
committerbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-08 20:11:04 +0000
commitf15731c43ae5e8cea424ea40f905c19afa1bd2e4 (patch)
treeb584a79288c93215b05fb451943291ccd039388b /gcc/ada/5zinterr.adb
parent1d347c236ad815c77bd345611ed221b0bd6091de (diff)
downloadgcc-f15731c43ae5e8cea424ea40f905c19afa1bd2e4.tar.gz
* 41intnam.ads, 42intnam.ads, 4aintnam.ads, 4cintnam.ads,
4dintnam.ads, 4gintnam.ads, 4hintnam.ads, 4lintnam.ads, 4mintnam.ads, 4pintnam.ads, 4rintnam.ads, 4sintnam.ads, 4uintnam.ads, 4vcalend.adb, 4zintnam.ads, 52system.ads, 5amastop.adb, 5asystem.ads, 5ataprop.adb, 5atpopsp.adb, 5avxwork.ads, 5bosinte.adb, 5bsystem.ads, 5esystem.ads, 5fsystem.ads, 5ftaprop.adb, 5ginterr.adb, 5gmastop.adb, 5gsystem.ads, 5gtaprop.adb, 5gtasinf.adb, 5gtasinf.ads, 5hparame.ads, 5hsystem.ads, 5htaprop.adb, 5htraceb.adb, 5itaprop.adb, 5ksystem.ads, 5kvxwork.ads, 5lintman.adb, 5lsystem.ads, 5mvxwork.ads, 5ninmaop.adb, 5nosinte.ads, 5ntaprop.adb, 5ointerr.adb, 5omastop.adb, 5oosinte.adb, 5osystem.ads, 5otaprop.adb, 5otaspri.ads, 5pvxwork.ads, 5qtaprop.adb, 5sintman.adb, 5ssystem.ads, 5staprop.adb, 5stpopse.adb, 5svxwork.ads, 5tosinte.ads, 5uintman.adb, 5vasthan.adb, 5vinmaop.adb, 5vinterr.adb, 5vintman.adb, 5vmastop.adb, 5vparame.ads, 5vsystem.ads, 5vtaprop.adb, 5vtpopde.adb, 5wmemory.adb, 5wsystem.ads, 5wtaprop.adb, 5ysystem.ads, 5zinterr.adb, 5zintman.adb, 5zosinte.adb, 5zosinte.ads, 5zsystem.ads, 5ztaprop.adb, 6vcpp.adb, 6vcstrea.adb, 7sintman.adb, 7staprop.adb, 7stpopsp.adb, 9drpc.adb, Make-lang.in, Makefile.in, a-caldel.adb, a-comlin.ads, a-dynpri.adb, a-except.adb, a-except.ads, a-finali.adb, a-ncelfu.ads, a-reatim.adb, a-retide.adb, a-stream.ads, a-ststio.adb, a-ststio.ads, a-stwifi.adb, a-tags.adb, a-tasatt.adb, a-textio.adb, a-tideau.adb, a-tiflau.adb, a-tigeau.adb, a-tigeau.ads, a-tiinau.adb, a-timoau.adb, a-witeio.adb, a-wtdeau.adb, a-wtenau.adb, a-wtflau.adb, a-wtgeau.adb, a-wtgeau.ads, a-wtinau.adb, a-wtmoau.adb, ada-tree.def, ada-tree.h, adaint.c, adaint.h, ali-util.adb, ali.adb, ali.ads, atree.adb, atree.ads, atree.h, back_end.adb, bcheck.adb, bindgen.adb, bindusg.adb, checks.adb, comperr.adb, config-lang.in, csets.adb, csets.ads, cstand.adb, cstreams.c, debug.adb, debug.ads, decl.c, einfo.adb, einfo.ads, einfo.h, elists.h, errout.adb, errout.ads, eval_fat.adb, exp_aggr.adb, exp_attr.adb, exp_ch11.adb, exp_ch12.adb, exp_ch13.adb, exp_ch2.adb, exp_ch3.adb, exp_ch3.ads, exp_ch4.adb, exp_ch5.adb, exp_ch6.adb, exp_ch7.adb, exp_ch7.ads, exp_ch9.adb, exp_ch9.ads, exp_dbug.adb, exp_dbug.ads, exp_disp.ads, exp_dist.adb, exp_fixd.adb, exp_intr.adb, exp_pakd.adb, exp_prag.adb, exp_strm.adb, exp_util.adb, exp_util.ads, expander.adb, expect.c, fe.h, fmap.adb, fmap.ads, fname-uf.adb, freeze.adb, frontend.adb, g-awk.adb, g-cgideb.adb, g-comlin.adb, g-comlin.ads, g-debpoo.adb, g-dirope.adb, g-dirope.ads, g-dyntab.adb, g-expect.adb, g-expect.ads, g-io.ads, g-io_aux.adb, g-io_aux.ads, g-locfil.adb, g-locfil.ads, g-os_lib.adb, g-os_lib.ads, g-regexp.adb, g-regpat.adb, g-socket.adb, g-socket.ads, g-spipat.adb, g-table.adb, g-trasym.adb, g-trasym.ads, gigi.h, gmem.c, gnat1drv.adb, gnatbind.adb, gnatbl.c, gnatchop.adb, gnatcmd.adb, gnatdll.adb, gnatfind.adb, gnatlbr.adb, gnatlink.adb, gnatls.adb, gnatmem.adb, gnatprep.adb, gnatvsn.ads, gnatxref.adb, hlo.adb, hostparm.ads, i-cobol.adb, i-cpp.adb, i-cstrea.ads, i-cstrin.adb, i-pacdec.adb, i-vxwork.ads, impunit.adb, init.c, inline.adb, io-aux.c, layout.adb, lib-load.adb, lib-util.adb, lib-writ.adb, lib-writ.ads, lib-xref.adb, lib-xref.ads, lib.adb, lib.ads, make.adb, makeusg.adb, mdll.adb, memroot.adb, misc.c, mlib-tgt.adb, mlib-utl.adb, mlib-utl.ads, mlib.adb, namet.adb, namet.ads, namet.h, nlists.h, nmake.adb, nmake.ads, nmake.adt, opt.adb, opt.ads, osint.adb, osint.ads, output.adb, output.ads, par-ch2.adb, par-ch3.adb, par-ch5.adb, par-prag.adb, par-tchk.adb, par-util.adb, par.adb, prj-attr.adb, prj-dect.adb, prj-env.adb, prj-env.ads, prj-nmsc.adb, prj-part.adb, prj-proc.adb, prj-strt.adb, prj-tree.adb, prj-tree.ads, prj.adb, prj.ads, raise.c, raise.h, repinfo.adb, restrict.adb, restrict.ads, rident.ads, rtsfind.adb, rtsfind.ads, s-arit64.adb, s-asthan.adb, s-atacco.adb, s-atacco.ads, s-auxdec.adb, s-crc32.adb, s-crc32.ads, s-direio.adb, s-fatgen.adb, s-fileio.adb, s-finimp.adb, s-gloloc.adb, s-gloloc.ads, s-interr.adb, s-mastop.adb, s-mastop.ads, s-memory.adb, s-parame.ads, s-parint.adb, s-pooglo.adb, s-pooloc.adb, s-rpc.adb, s-secsta.adb, s-sequio.adb, s-shasto.adb, s-soflin.adb, s-soflin.ads, s-stache.adb, s-taasde.adb, s-taasde.ads, s-tadeca.adb, s-tadeca.ads, s-tadert.adb, s-tadert.ads, s-taenca.adb, s-taenca.ads, s-taprob.adb, s-taprop.ads, s-tarest.adb, s-tasdeb.adb, s-tasini.adb, s-tasini.ads, s-taskin.adb, s-taskin.ads, s-tasque.adb, s-tasque.ads, s-tasren.adb, s-tasren.ads, s-tassta.adb, s-tasuti.adb, s-tasuti.ads, s-tataat.adb, s-tataat.ads, s-tpoben.adb, s-tpoben.ads, s-tpobop.adb, s-tposen.adb, s-tposen.ads, s-traceb.adb, s-traceb.ads, s-unstyp.ads, s-widenu.adb, scn-nlit.adb, scn.adb, sem.adb, sem_aggr.adb, sem_attr.adb, sem_attr.ads, sem_case.adb, sem_ch10.adb, sem_ch11.adb, sem_ch11.ads, sem_ch12.adb, sem_ch13.adb, sem_ch13.ads, sem_ch2.adb, sem_ch3.adb, sem_ch3.ads, sem_ch4.adb, sem_ch5.adb, sem_ch6.adb, sem_ch6.ads, sem_ch7.adb, sem_ch8.adb, sem_ch8.ads, sem_ch9.adb, sem_disp.adb, sem_dist.adb, sem_elab.adb, sem_elim.adb, sem_elim.ads, sem_eval.adb, sem_intr.adb, sem_mech.adb, sem_prag.adb, sem_res.adb, sem_type.adb, sem_util.adb, sem_util.ads, sem_vfpt.adb, sem_warn.adb, sinfo.adb, sinfo.ads, sinfo.h, sinput-l.adb, sinput-l.ads, sinput.adb, sinput.ads, snames.adb, snames.ads, snames.h, sprint.adb, sprint.ads, stringt.adb, stringt.ads, stringt.h, style.adb, switch.adb, switch.ads, sysdep.c, system.ads, table.adb, targparm.adb, targparm.ads, targtyps.c, tbuild.adb, tbuild.ads, tracebak.c, trans.c, tree_gen.adb, tree_io.adb, treepr.adb, treepr.ads, treeprs.ads, treeprs.adt, ttypes.ads, types.adb, types.ads, types.h, uintp.ads, urealp.ads, usage.adb, utils.c, utils2.c, validsw.adb, xnmake.adb, xr_tabls.adb, xr_tabls.ads, xref_lib.adb, xref_lib.ads : Merge in ACT changes. * 1ssecsta.adb, 1ssecsta.ads, a-chlat9.ads, a-cwila9.ads, g-enblsp.adb, g-md5.adb, g-md5.ads, gnatname.adb, gnatname.ads, mkdir.c, osint-b.adb, osint-b.ads, osint-c.adb, osint-c.ads, osint-l.adb, osint-l.ads, osint-m.adb, osint-m.ads : New files * 3lsoccon.ads, 5qparame.ads, 5qvxwork.ads, 5smastop.adb, 5zparame.ads, gnatmain.adb, gnatmain.ads, gnatpsys.adb : Removed * mdllfile.adb, mdllfile.ads, mdlltool.adb, mdlltool.ads : Renamed to mdll-fil.ad[bs] and mdll-util.ad[bs] * mdll-fil.adb, mdll-fil.ads, mdll-utl.adb, mdll-utl.ads : Renamed from mdllfile.ad[bs] and mdlltool.ad[bs] git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50451 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/5zinterr.adb')
-rw-r--r--gcc/ada/5zinterr.adb769
1 files changed, 121 insertions, 648 deletions
diff --git a/gcc/ada/5zinterr.adb b/gcc/ada/5zinterr.adb
index e7422ef614b..dccc143a6c6 100644
--- a/gcc/ada/5zinterr.adb
+++ b/gcc/ada/5zinterr.adb
@@ -6,9 +6,9 @@
-- --
-- B o d y --
-- --
--- $Revision: 1.1 $
+-- $Revision$
-- --
--- Copyright (C) 1991-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2002, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -29,8 +29,7 @@
-- covered by the GNU Public License. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. It is --
--- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
--- State University (http://www.gnat.com). --
+-- now maintained by Ada Core Technologies, Inc. (http://www.gnat.com). --
-- --
------------------------------------------------------------------------------
@@ -46,13 +45,6 @@
-- hardware interrupts, which may be masked or unmasked using routined
-- interfaced to the relevant VxWorks system calls.
--- Note : Direct calls to sigaction, sigprocmask, pthread_sigsetmask or any
--- other low-level interface that changes the signal action or
--- signal mask needs careful consideration.
--- One may achieve the effect of system calls first masking RTS blocked
--- (by calling Block_Interrupt) for the signal under consideration.
--- This will make all the tasks in RTS blocked for the signal.
-
-- Once we associate a Signal_Server_Task with an signal, the task never
-- goes away, and we never remove the association. On the other hand, it
-- is more convenient to terminate an associated Interrupt_Server_Task
@@ -72,15 +64,13 @@
-- service requests are ensured via user calls to the Interrupt_Manager
-- entries.
--- This is the VxWorks version of this package, supporting both signals
--- and vectored hardware interrupts.
+-- This is the VxWorks version of this package, supporting vectored hardware
+-- interrupts.
with Unchecked_Conversion;
with System.OS_Interface; use System.OS_Interface;
-with System.VxWorks;
-
with Interfaces.VxWorks;
with Ada.Task_Identification;
@@ -89,39 +79,6 @@ with Ada.Task_Identification;
with Ada.Exceptions;
-- used for Raise_Exception
-with System.Task_Primitives;
--- used for RTS_Lock
--- Self
-
-with System.Interrupt_Management;
--- used for Reserve
--- Interrupt_ID
--- Interrupt_Mask
--- Abort_Task_Interrupt
-
-with System.Interrupt_Management.Operations;
--- used for Thread_Block_Interrupt
--- Thread_Unblock_Interrupt
--- Install_Default_Action
--- Install_Ignore_Action
--- Copy_Interrupt_Mask
--- Set_Interrupt_Mask
--- Empty_Interrupt_Mask
--- Fill_Interrupt_Mask
--- Add_To_Interrupt_Mask
--- Delete_From_Interrupt_Mask
--- Interrupt_Wait
--- Interrupt_Self_Process
--- Get_Interrupt_Mask
--- Set_Interrupt_Mask
--- IS_Member
--- Environment_Mask
--- All_Tasks_Mask
-pragma Elaborate_All (System.Interrupt_Management.Operations);
-
-with System.Error_Reporting;
--- used for Shutdown
-
with System.Task_Primitives.Operations;
-- used for Write_Lock
-- Unlock
@@ -130,9 +87,6 @@ with System.Task_Primitives.Operations;
-- Sleep
-- Initialize_Lock
-with System.Task_Primitives.Interrupt_Operations;
--- used for Set_Interrupt_ID
-
with System.Storage_Elements;
-- used for To_Address
-- To_Integer
@@ -152,21 +106,13 @@ with System.Tasking.Rendezvous;
-- used for Call_Simple
pragma Elaborate_All (System.Tasking.Rendezvous);
-with System.Tasking.Initialization;
--- used for Defer_Abort
--- Undefer_Abort
-
package body System.Interrupts is
use Tasking;
- use System.Error_Reporting;
use Ada.Exceptions;
package PRI renames System.Task_Primitives;
package POP renames System.Task_Primitives.Operations;
- package PIO renames System.Task_Primitives.Interrupt_Operations;
- package IMNG renames System.Interrupt_Management;
- package IMOP renames System.Interrupt_Management.Operations;
function To_Ada is new Unchecked_Conversion
(System.Tasking.Task_ID, Ada.Task_Identification.Task_Id);
@@ -178,12 +124,12 @@ package body System.Interrupts is
-- Local Tasks --
-----------------
- -- WARNING: System.Tasking.Utilities performs calls to this task
+ -- WARNING: System.Tasking.Stages performs calls to this task
-- with low-level constructs. Do not change this spec without synchro-
-- nizing it.
task Interrupt_Manager is
- entry Initialize (Mask : IMNG.Interrupt_Mask);
+ entry Detach_Interrupt_Entries (T : Task_ID);
entry Attach_Handler
(New_Handler : Parameterless_Handler;
@@ -206,18 +152,9 @@ package body System.Interrupts is
E : Task_Entry_Index;
Interrupt : Interrupt_ID);
- entry Detach_Interrupt_Entries (T : Task_ID);
-
pragma Interrupt_Priority (System.Interrupt_Priority'First);
end Interrupt_Manager;
- task type Signal_Server_Task (Interrupt : Interrupt_ID) is
- pragma Interrupt_Priority (System.Interrupt_Priority'First + 1);
- end Signal_Server_Task;
- -- Server task for signal handling
-
- type Signal_Task_Access is access Signal_Server_Task;
-
task type Interrupt_Server_Task
(Interrupt : Interrupt_ID; Int_Sema : SEM_ID) is
-- Server task for vectored hardware interrupt handling
@@ -275,33 +212,16 @@ package body System.Interrupts is
-- is needed to determine whether to create a new Server_Task.
Semaphore_ID_Map : array
- (Interrupt_ID range 0 .. System.VxWorks.Num_HW_Interrupts) of SEM_ID :=
- (others => 0);
+ (Interrupt_ID range 0 .. System.OS_Interface.Max_HW_Interrupt)
+ of SEM_ID := (others => 0);
-- Array of binary semaphores associated with vectored interrupts
-- Note that the last bound should be Max_HW_Interrupt, but this will raise
-- Storage_Error if Num_HW_Interrupts is null, so use an extra 4 bytes
-- instead.
- Signal_Access_Hold : Signal_Task_Access;
- -- Variable for allocating a Signal_Server_Task
-
Interrupt_Access_Hold : Interrupt_Task_Access;
-- Variable for allocating an Interrupt_Server_Task
- L : aliased PRI.RTS_Lock;
- -- L protects the contents of the above tables for interrupts / signals
- -- for which Server_ID (I) = Null_Task.
- --
- -- If Server_ID (I) /= Null_Task then protection is via the
- -- per-task (TCB) lock of Server_ID (I).
- --
- -- For deadlock prevention, L should not be locked after
- -- any other lock is held, hence we use PO_Level which is the highest
- -- lock level for error checking.
-
- Task_Lock : array (Interrupt_ID) of Boolean := (others => False);
- -- Booleans indicating whether the per task lock is used
-
Default_Handler : array (HW_Interrupt) of Interfaces.VxWorks.VOIDFUNCPTR;
-- Vectored interrupt handlers installed prior to program startup.
-- These are saved only when the umbrella handler is installed for
@@ -319,25 +239,9 @@ package body System.Interrupts is
-- Unbind the handlers for hardware interrupt server tasks at program
-- termination.
- procedure Lock_Interrupt
- (Self_ID : Task_ID;
- Interrupt : Interrupt_ID);
- -- Protect the tables using L or the per-task lock. Set the Boolean
- -- value Task_Lock if the lock is made using per-task lock.
- -- This information is needed so that Unlock_Interrupt
- -- performs unlocking on the same lock. The situation we are preventing
- -- is, for example, when Attach_Handler is called for the first time
- -- we lock L and create an Server_Task. For a matching unlocking, if we
- -- rely on the fact that there is a Server_Task, we will unlock the
- -- per-task lock.
-
- procedure Unlock_Interrupt
- (Self_ID : Task_ID;
- Interrupt : Interrupt_ID);
- -- Unlock interrupt previously locked by Lock_Interrupt
-
function Is_Registered (Handler : Parameterless_Handler) return Boolean;
- -- Needs comment ???
+ -- See if Handler has been "pragma"ed using Interrupt_Handler.
+ -- Always consider a null handler as registered.
procedure Notify_Interrupt (Param : System.Address);
-- Umbrella handler for vectored interrupts (not signals)
@@ -351,9 +255,6 @@ package body System.Interrupts is
-- Install the runtime umbrella handler for a vectored hardware
-- interrupt
- function To_Signal (S : Interrupt_ID) return IMNG.Interrupt_ID;
- -- Convert interrupt ID to signal number.
-
procedure Unimplemented (Feature : String);
pragma No_Return (Unimplemented);
-- Used to mark a call to an unimplemented function. Raises Program_Error
@@ -374,8 +275,7 @@ package body System.Interrupts is
procedure Attach_Handler
(New_Handler : Parameterless_Handler;
Interrupt : Interrupt_ID;
- Static : Boolean := False)
- is
+ Static : Boolean := False) is
begin
Check_Reserved_Interrupt (Interrupt);
Interrupt_Manager.Attach_Handler (New_Handler, Interrupt, Static);
@@ -395,7 +295,7 @@ package body System.Interrupts is
Int_Ref : System.Address)
is
Interrupt : constant Interrupt_ID :=
- Interrupt_ID (Storage_Elements.To_Integer (Int_Ref));
+ Interrupt_ID (Storage_Elements.To_Integer (Int_Ref));
begin
Check_Reserved_Interrupt (Interrupt);
@@ -431,9 +331,7 @@ package body System.Interrupts is
---------------------
function Current_Handler
- (Interrupt : Interrupt_ID)
- return Parameterless_Handler
- is
+ (Interrupt : Interrupt_ID) return Parameterless_Handler is
begin
Check_Reserved_Interrupt (Interrupt);
@@ -457,8 +355,7 @@ package body System.Interrupts is
procedure Detach_Handler
(Interrupt : Interrupt_ID;
- Static : Boolean := False)
- is
+ Static : Boolean := False) is
begin
Check_Reserved_Interrupt (Interrupt);
Interrupt_Manager.Detach_Handler (Interrupt, Static);
@@ -489,8 +386,7 @@ package body System.Interrupts is
(Old_Handler : out Parameterless_Handler;
New_Handler : Parameterless_Handler;
Interrupt : Interrupt_ID;
- Static : Boolean := False)
- is
+ Static : Boolean := False) is
begin
Check_Reserved_Interrupt (Interrupt);
Interrupt_Manager.Exchange_Handler
@@ -525,10 +421,9 @@ package body System.Interrupts is
-- Finalize_Interrupt_Servers --
--------------------------------
- -- Restore default handlers for interrupt servers. Signal servers
- -- restore the default handlers when they're aborted. This is called
- -- by the Interrupt_Manager task when it receives the abort signal
- -- during program finalization.
+ -- Restore default handlers for interrupt servers.
+ -- This is called by the Interrupt_Manager task when it receives the abort
+ -- signal during program finalization.
procedure Finalize_Interrupt_Servers is
begin
@@ -554,17 +449,13 @@ package body System.Interrupts is
-------------------------------------
function Has_Interrupt_Or_Attach_Handler
- (Object : access Dynamic_Interrupt_Protection)
- return Boolean
- is
+ (Object : access Dynamic_Interrupt_Protection) return Boolean is
begin
return True;
end Has_Interrupt_Or_Attach_Handler;
function Has_Interrupt_Or_Attach_Handler
- (Object : access Static_Interrupt_Protection)
- return Boolean
- is
+ (Object : access Static_Interrupt_Protection) return Boolean is
begin
return True;
end Has_Interrupt_Or_Attach_Handler;
@@ -628,12 +519,11 @@ package body System.Interrupts is
is
use Interfaces.VxWorks;
- Vec : constant Interrupt_Vector :=
- INUM_TO_IVEC (Interfaces.VxWorks.int (Interrupt));
+ Vec : constant Interrupt_Vector :=
+ INUM_TO_IVEC (Interfaces.VxWorks.int (Interrupt));
Old_Handler : constant VOIDFUNCPTR :=
- intVecGet
- (INUM_TO_IVEC (Interfaces.VxWorks.int (Interrupt)));
- Stat : Interfaces.VxWorks.STATUS;
+ intVecGet (INUM_TO_IVEC (Interfaces.VxWorks.int (Interrupt)));
+ Stat : Interfaces.VxWorks.STATUS;
begin
-- Only install umbrella handler when no Ada handler has already been
@@ -692,9 +582,6 @@ package body System.Interrupts is
-- Is_Registered --
-------------------
- -- See if Handler has been "pragma"ed using Interrupt_Handler.
- -- Always consider a null handler as registered.
-
function Is_Registered (Handler : Parameterless_Handler) return Boolean is
type Fat_Ptr is record
Object_Addr : System.Address;
@@ -725,7 +612,6 @@ package body System.Interrupts is
end loop;
return False;
-
end Is_Registered;
-----------------
@@ -734,63 +620,12 @@ package body System.Interrupts is
function Is_Reserved (Interrupt : Interrupt_ID) return Boolean is
begin
- if Interrupt < System.VxWorks.Num_HW_Interrupts then
- return False;
- else
- return IMNG.Reserve (To_Signal (Interrupt));
- end if;
+ return False;
end Is_Reserved;
- --------------------
- -- Lock_Interrupt --
- --------------------
-
- -- ?????
- -- This package has been modified several times.
- -- Do we still need this fancy locking scheme, now that more operations
- -- are entries of the interrupt manager task?
- -- ?????
- -- More likely, we will need to convert one or more entry calls to
- -- protected operations, because presently we are violating locking order
- -- rules by calling a task entry from within the runtime system.
-
- procedure Lock_Interrupt
- (Self_ID : Task_ID;
- Interrupt : Interrupt_ID) is
- begin
- Initialization.Defer_Abort (Self_ID);
-
- POP.Write_Lock (L'Access);
-
- if Task_Lock (Interrupt) then
- pragma Assert (Server_ID (Interrupt) /= null,
- "Task_Lock is true for null server task");
- pragma Assert
- (not Ada.Task_Identification.Is_Terminated
- (To_Ada (Server_ID (Interrupt))),
- "Attempt to lock per task lock of terminated server: " &
- "Task_Lock => True");
-
- POP.Unlock (L'Access);
- POP.Write_Lock (Server_ID (Interrupt));
-
- elsif Server_ID (Interrupt) /= Null_Task then
- pragma Assert
- (not Ada.Task_Identification.Is_Terminated
- (To_Ada (Server_ID (Interrupt))),
- "Attempt to lock per task lock of terminated server: " &
- "Task_Lock => False");
-
- Task_Lock (Interrupt) := True;
- POP.Unlock (L'Access);
- POP.Write_Lock (Server_ID (Interrupt));
- end if;
-
- end Lock_Interrupt;
-
- ------------------------
- -- Notify_Interrupt --
- ------------------------
+ ----------------------
+ -- Notify_Interrupt --
+ ----------------------
-- Umbrella handler for vectored hardware interrupts (as opposed to
-- signals and exceptions). As opposed to the signal implementation,
@@ -859,15 +694,6 @@ package body System.Interrupts is
end if;
end Register_Interrupt_Handler;
- ---------------
- -- To_Signal --
- ---------------
-
- function To_Signal (S : Interrupt_ID) return IMNG.Interrupt_ID is
- begin
- return IMNG.Interrupt_ID (S - System.VxWorks.Num_HW_Interrupts);
- end To_Signal;
-
-----------------------
-- Unblock_Interrupt --
-----------------------
@@ -908,28 +734,6 @@ package body System.Interrupts is
Feature & " not implemented on VxWorks");
end Unimplemented;
- ----------------------
- -- Unlock_Interrupt --
- ----------------------
-
- procedure Unlock_Interrupt
- (Self_ID : Task_ID;
- Interrupt : Interrupt_ID) is
- begin
- if Task_Lock (Interrupt) then
- pragma Assert
- (not Ada.Task_Identification.Is_Terminated
- (To_Ada (Server_ID (Interrupt))),
- "Attempt to unlock per task lock of terminated server");
-
- POP.Unlock (Server_ID (Interrupt));
- else
- POP.Unlock (L'Access);
- end if;
-
- Initialization.Undefer_Abort (Self_ID);
- end Unlock_Interrupt;
-
-----------------------
-- Interrupt_Manager --
-----------------------
@@ -939,9 +743,7 @@ package body System.Interrupts is
-- Local Variables --
---------------------
- Intwait_Mask : aliased IMNG.Interrupt_Mask;
- Old_Mask : aliased IMNG.Interrupt_Mask;
- Self_ID : Task_ID := POP.Self;
+ Self_Id : constant Task_ID := POP.Self;
--------------------
-- Local Routines --
@@ -957,10 +759,6 @@ package body System.Interrupts is
-- Otherwise, we have to interrupt Server_Task for status change
-- through an abort signal.
- -- The following two procedures are labelled Unprotected... in order to
- -- indicate that Lock/Unlock_Interrupt operations are needed around
- -- around calls to them.
-
procedure Unprotected_Exchange_Handler
(Old_Handler : out Parameterless_Handler;
New_Handler : Parameterless_Handler;
@@ -978,24 +776,8 @@ package body System.Interrupts is
procedure Bind_Handler (Interrupt : Interrupt_ID) is
begin
- if Interrupt < System.VxWorks.Num_HW_Interrupts then
- Install_Umbrella_Handler
- (HW_Interrupt (Interrupt), Notify_Interrupt'Access);
-
- else
- -- Mask this task for the given signal so that all tasks
- -- are masked for the signal and the actual delivery of the
- -- signal will be caught using "sigwait" by the
- -- corresponding Server_Task.
-
- IMOP.Thread_Block_Interrupt (To_Signal (Interrupt));
- -- We have installed a handler or an entry before we called
- -- this procedure. If the handler task is waiting to be
- -- awakened, do it here. Otherwise, the signal will be
- -- discarded.
-
- POP.Wakeup (Server_ID (Interrupt), Interrupt_Server_Idle_Sleep);
- end if;
+ Install_Umbrella_Handler
+ (HW_Interrupt (Interrupt), Notify_Interrupt'Access);
end Bind_Handler;
--------------------
@@ -1004,44 +786,17 @@ package body System.Interrupts is
procedure Unbind_Handler (Interrupt : Interrupt_ID) is
S : STATUS;
- Ret_Interrupt : IMNG.Interrupt_ID;
-
- use type IMNG.Interrupt_ID;
use type STATUS;
begin
- if Interrupt < System.VxWorks.Num_HW_Interrupts then
-
- -- Hardware interrupt
+ -- Hardware interrupt
- Install_Default_Action (HW_Interrupt (Interrupt));
-
- -- Flush server task off semaphore, allowing it to terminate
-
- S := semFlush (Semaphore_ID_Map (Interrupt));
- pragma Assert (S = 0);
-
- else
- -- Currently, there is a handler or an entry attached and
- -- the corresponding Server_Task is waiting on "sigwait."
- -- We have to wake up the Server_Task and make it
- -- wait on a condition variable by sending an
- -- Abort_Task_Interrupt
+ Install_Default_Action (HW_Interrupt (Interrupt));
- -- Make sure corresponding Server_Task is out of its own
- -- sigwait state.
+ -- Flush server task off semaphore, allowing it to terminate
- POP.Abort_Task (Server_ID (Interrupt));
- Ret_Interrupt := IMOP.Interrupt_Wait (Intwait_Mask'Access);
- pragma Assert (Ret_Interrupt = IMNG.Abort_Task_Interrupt);
-
- IMOP.Install_Default_Action (To_Signal (Interrupt));
-
- -- Unmake the Interrupt for this task in order to allow default
- -- action again.
-
- IMOP.Thread_Unblock_Interrupt (To_Signal (Interrupt));
- end if;
+ S := semFlush (Semaphore_ID_Map (Interrupt));
+ pragma Assert (S = 0);
end Unbind_Handler;
--------------------------------
@@ -1055,11 +810,9 @@ package body System.Interrupts is
Old_Handler : Parameterless_Handler;
begin
if User_Entry (Interrupt).T /= Null_Task then
-
-- If an interrupt entry is installed raise
-- Program_Error. (propagate it to the caller).
- Unlock_Interrupt (Self_ID, Interrupt);
Raise_Exception (Program_Error'Identity,
"An interrupt entry is already installed");
end if;
@@ -1069,11 +822,9 @@ package body System.Interrupts is
-- status of the Current_Handler.
if not Static and then User_Handler (Interrupt).Static then
-
-- Trying to detach a static Interrupt Handler.
-- raise Program_Error.
- Unlock_Interrupt (Self_ID, Interrupt);
Raise_Exception (Program_Error'Identity,
"Trying to detach a static Interrupt Handler");
end if;
@@ -1088,7 +839,6 @@ package body System.Interrupts is
if Old_Handler /= null then
Unbind_Handler (Interrupt);
end if;
-
end Unprotected_Detach_Handler;
----------------------------------
@@ -1103,13 +853,12 @@ package body System.Interrupts is
Restoration : Boolean := False) is
begin
if User_Entry (Interrupt).T /= Null_Task then
-
-- If an interrupt entry is already installed, raise
-- Program_Error. (propagate it to the caller).
- Unlock_Interrupt (Self_ID, Interrupt);
- Raise_Exception (Program_Error'Identity,
- "An interrupt is already installed");
+ Raise_Exception
+ (Program_Error'Identity,
+ "An interrupt is already installed");
end if;
-- Note : A null handler with Static = True will
@@ -1122,15 +871,14 @@ package body System.Interrupts is
if not Restoration and then not Static
and then (User_Handler (Interrupt).Static
- -- Trying to overwrite a static Interrupt Handler with a
- -- dynamic Handler
+ -- Trying to overwrite a static Interrupt Handler with a
+ -- dynamic Handler
- -- The new handler is not specified as an
- -- Interrupt Handler by a pragma.
+ -- The new handler is not specified as an
+ -- Interrupt Handler by a pragma.
- or else not Is_Registered (New_Handler))
+ or else not Is_Registered (New_Handler))
then
- Unlock_Interrupt (Self_ID, Interrupt);
Raise_Exception
(Program_Error'Identity,
"Trying to overwrite a static Interrupt Handler with a " &
@@ -1165,46 +913,23 @@ package body System.Interrupts is
Ada.Task_Identification.Is_Terminated
(To_Ada (Server_ID (Interrupt))))
then
- -- When a new Server_Task is created, it should have its
- -- signal mask set to the All_Tasks_Mask.
-
- IMOP.Set_Interrupt_Mask
- (IMOP.All_Tasks_Mask'Access, Old_Mask'Access);
-
- if Interrupt < System.VxWorks.Num_HW_Interrupts then
-
- -- Vectored hardware interrupt
-
- Interrupt_Access_Hold :=
- new Interrupt_Server_Task
- (Interrupt, semBCreate (SEM_Q_FIFO, SEM_EMPTY));
- Server_ID (Interrupt) :=
- To_System (Interrupt_Access_Hold.all'Identity);
-
- else
- -- Signal
-
- Signal_Access_Hold := new Signal_Server_Task (Interrupt);
- Server_ID (Interrupt) :=
- To_System (Signal_Access_Hold.all'Identity);
- end if;
-
- IMOP.Set_Interrupt_Mask (Old_Mask'Access);
+ Interrupt_Access_Hold :=
+ new Interrupt_Server_Task
+ (Interrupt, semBCreate (SEM_Q_FIFO, SEM_EMPTY));
+ Server_ID (Interrupt) :=
+ To_System (Interrupt_Access_Hold.all'Identity);
end if;
if (New_Handler = null) and then Old_Handler /= null then
-
-- Restore default handler
Unbind_Handler (Interrupt);
elsif Old_Handler = null then
-
-- Save default handler
Bind_Handler (Interrupt);
end if;
-
end Unprotected_Exchange_Handler;
-- Start of processing for Interrupt_Manager
@@ -1215,56 +940,6 @@ package body System.Interrupts is
System.Tasking.Utilities.Make_Independent;
- -- Environment task gets its own interrupt mask, saves it,
- -- and then masks all signals except the Keep_Unmasked set.
-
- -- During rendezvous, the Interrupt_Manager receives the old
- -- signal mask of the environment task, and sets its own
- -- signal mask to that value.
-
- -- The environment task will call this entry of Interrupt_Manager
- -- during elaboration of the body of this package.
-
- accept Initialize (Mask : IMNG.Interrupt_Mask) do
- declare
- The_Mask : aliased IMNG.Interrupt_Mask;
-
- begin
- IMOP.Copy_Interrupt_Mask (The_Mask, Mask);
- IMOP.Set_Interrupt_Mask (The_Mask'Access);
- end;
- end Initialize;
-
- -- Note: All tasks in RTS will have all reserved signals
- -- being masked (except the Interrupt_Manager) and Keep_Unmasked
- -- signals unmasked when created.
-
- -- Abort_Task_Interrupt is one of the signals unmasked
- -- in all tasks. We mask the signal in this particular task
- -- so that "sigwait" is can catch an explicit
- -- Abort_Task_Interrupt from a Server_Task.
-
- -- This sigwaiting is needed to ensure that a Signal_Server_Task is
- -- out of its own sigwait state. This extra synchronization is
- -- necessary to prevent following scenarios:
-
- -- 1) Interrupt_Manager sends an Abort_Task_Interrupt to a
- -- Signal_Server_Task then changes its own signal mask (OS level).
- -- If a signal (corresponding to the Signal_Server_Task) arrives
- -- in the meantime, we have the Interrupt_Manager umnasked and
- -- the Signal_Server_Task waiting on sigwait.
-
- -- 2) For unbinding a handler, we install a default action in the
- -- Interrupt_Manager. POSIX.1c states that the result of using
- -- "sigwait" and "sigaction" simultaneously on the same signal
- -- is undefined. Therefore, we need to be informed from the
- -- Signal_Server_Task that it is out of its sigwait stage.
-
- IMOP.Empty_Interrupt_Mask (Intwait_Mask'Access);
- IMOP.Add_To_Interrupt_Mask
- (Intwait_Mask'Access, IMNG.Abort_Task_Interrupt);
- IMOP.Thread_Block_Interrupt (IMNG.Abort_Task_Interrupt);
-
loop
-- A block is needed to absorb Program_Error exception
@@ -1273,142 +948,108 @@ package body System.Interrupts is
begin
select
-
accept Attach_Handler
(New_Handler : Parameterless_Handler;
Interrupt : Interrupt_ID;
Static : Boolean;
Restoration : Boolean := False)
do
- Lock_Interrupt (Self_ID, Interrupt);
Unprotected_Exchange_Handler
(Old_Handler, New_Handler, Interrupt, Static, Restoration);
- Unlock_Interrupt (Self_ID, Interrupt);
end Attach_Handler;
- or accept Exchange_Handler
- (Old_Handler : out Parameterless_Handler;
- New_Handler : Parameterless_Handler;
- Interrupt : Interrupt_ID;
- Static : Boolean)
- do
- Lock_Interrupt (Self_ID, Interrupt);
- Unprotected_Exchange_Handler
- (Old_Handler, New_Handler, Interrupt, Static);
- Unlock_Interrupt (Self_ID, Interrupt);
- end Exchange_Handler;
-
- or accept Detach_Handler
- (Interrupt : Interrupt_ID;
- Static : Boolean)
- do
- Lock_Interrupt (Self_ID, Interrupt);
- Unprotected_Detach_Handler (Interrupt, Static);
- Unlock_Interrupt (Self_ID, Interrupt);
- end Detach_Handler;
-
- or accept Bind_Interrupt_To_Entry
- (T : Task_ID;
- E : Task_Entry_Index;
- Interrupt : Interrupt_ID)
- do
- Lock_Interrupt (Self_ID, Interrupt);
-
- -- If there is a binding already (either a procedure or an
- -- entry), raise Program_Error (propagate it to the caller).
-
- if User_Handler (Interrupt).H /= null
- or else User_Entry (Interrupt).T /= Null_Task
- then
- Unlock_Interrupt (Self_ID, Interrupt);
- Raise_Exception
- (Program_Error'Identity,
- "A binding for this interrupt is already present");
- end if;
-
- User_Entry (Interrupt) := Entry_Assoc' (T => T, E => E);
-
- -- Indicate the attachment of interrupt entry in the ATCB.
- -- This is needed so when an interrupt entry task terminates
- -- the binding can be cleaned. The call to unbinding must be
- -- make by the task before it terminates.
-
- T.Interrupt_Entry := True;
-
- -- Invoke a corresponding Server_Task if not yet created.
- -- Place Task_ID info in Server_ID array.
-
- if Server_ID (Interrupt) = Null_Task or else
- Ada.Task_Identification.Is_Terminated
- (To_Ada (Server_ID (Interrupt))) then
-
- -- When a new Server_Task is created, it should have its
- -- signal mask set to the All_Tasks_Mask.
-
- IMOP.Set_Interrupt_Mask
- (IMOP.All_Tasks_Mask'Access, Old_Mask'Access);
-
- if Interrupt < System.VxWorks.Num_HW_Interrupts then
- Interrupt_Access_Hold := new Interrupt_Server_Task
- (Interrupt, semBCreate (SEM_Q_FIFO, SEM_EMPTY));
- Server_ID (Interrupt) :=
- To_System (Interrupt_Access_Hold.all'Identity);
+ or
+ accept Exchange_Handler
+ (Old_Handler : out Parameterless_Handler;
+ New_Handler : Parameterless_Handler;
+ Interrupt : Interrupt_ID;
+ Static : Boolean)
+ do
+ Unprotected_Exchange_Handler
+ (Old_Handler, New_Handler, Interrupt, Static);
+ end Exchange_Handler;
- else
- Signal_Access_Hold := new Signal_Server_Task (Interrupt);
- Server_ID (Interrupt) :=
- To_System (Signal_Access_Hold.all'Identity);
+ or
+ accept Detach_Handler
+ (Interrupt : Interrupt_ID;
+ Static : Boolean)
+ do
+ Unprotected_Detach_Handler (Interrupt, Static);
+ end Detach_Handler;
+ or
+ accept Bind_Interrupt_To_Entry
+ (T : Task_ID;
+ E : Task_Entry_Index;
+ Interrupt : Interrupt_ID)
+ do
+ -- If there is a binding already (either a procedure or an
+ -- entry), raise Program_Error (propagate it to the caller).
+
+ if User_Handler (Interrupt).H /= null
+ or else User_Entry (Interrupt).T /= Null_Task
+ then
+ Raise_Exception
+ (Program_Error'Identity,
+ "A binding for this interrupt is already present");
end if;
- IMOP.Set_Interrupt_Mask (Old_Mask'Access);
- end if;
+ User_Entry (Interrupt) := Entry_Assoc' (T => T, E => E);
- Bind_Handler (Interrupt);
- Unlock_Interrupt (Self_ID, Interrupt);
- end Bind_Interrupt_To_Entry;
+ -- Indicate the attachment of interrupt entry in the ATCB.
+ -- This is needed so when an interrupt entry task terminates
+ -- the binding can be cleaned. The call to unbinding must be
+ -- make by the task before it terminates.
- or accept Detach_Interrupt_Entries (T : Task_ID)
- do
- for Int in Interrupt_ID'Range loop
- if not Is_Reserved (Int) then
- Lock_Interrupt (Self_ID, Int);
+ T.Interrupt_Entry := True;
- if User_Entry (Int).T = T then
+ -- Invoke a corresponding Server_Task if not yet created.
+ -- Place Task_ID info in Server_ID array.
- User_Entry (Int) := Entry_Assoc'
- (T => Null_Task, E => Null_Task_Entry);
- Unbind_Handler (Int);
- end if;
-
- Unlock_Interrupt (Self_ID, Int);
+ if Server_ID (Interrupt) = Null_Task
+ or else
+ Ada.Task_Identification.Is_Terminated
+ (To_Ada (Server_ID (Interrupt)))
+ then
+ Interrupt_Access_Hold := new Interrupt_Server_Task
+ (Interrupt, semBCreate (SEM_Q_FIFO, SEM_EMPTY));
+ Server_ID (Interrupt) :=
+ To_System (Interrupt_Access_Hold.all'Identity);
end if;
- end loop;
- -- Indicate in ATCB that no interrupt entries are attached.
+ Bind_Handler (Interrupt);
+ end Bind_Interrupt_To_Entry;
+
+ or
+ accept Detach_Interrupt_Entries (T : Task_ID) do
+ for Int in Interrupt_ID'Range loop
+ if not Is_Reserved (Int) then
+ if User_Entry (Int).T = T then
+ User_Entry (Int) := Entry_Assoc'
+ (T => Null_Task, E => Null_Task_Entry);
+ Unbind_Handler (Int);
+ end if;
+ end if;
+ end loop;
- T.Interrupt_Entry := False;
- end Detach_Interrupt_Entries;
+ -- Indicate in ATCB that no interrupt entries are attached.
+ T.Interrupt_Entry := False;
+ end Detach_Interrupt_Entries;
end select;
exception
-
-- If there is a Program_Error we just want to propagate it to
-- the caller and do not want to stop this task.
when Program_Error =>
null;
- when E : others =>
- pragma Assert
- (Shutdown ("Interrupt_Manager---exception not expected" &
- ASCII.LF &
- Exception_Information (E)));
+ when others =>
+ pragma Assert (False);
null;
end;
end loop;
- pragma Assert (Shutdown ("Interrupt_Manager---should not get here"));
exception
when Standard'Abort_Signal =>
-- Flush interrupt server semaphores, so they can terminate
@@ -1416,149 +1057,6 @@ package body System.Interrupts is
raise;
end Interrupt_Manager;
- ------------------------
- -- Signal_Server_Task --
- ------------------------
-
- task body Signal_Server_Task is
- Intwait_Mask : aliased IMNG.Interrupt_Mask;
- Ret_Interrupt : IMNG.Interrupt_ID;
- Self_ID : Task_ID := Self;
- Tmp_Handler : Parameterless_Handler;
- Tmp_ID : Task_ID;
- Tmp_Entry_Index : Task_Entry_Index;
-
- use type IMNG.Interrupt_ID;
-
- begin
- -- By making this task independent of master, when the process
- -- goes away, the Server_Task will terminate gracefully.
-
- System.Tasking.Utilities.Make_Independent;
-
- -- Install default action in system level.
-
- IMOP.Install_Default_Action (To_Signal (Interrupt));
-
- -- Note: All tasks in RTS will have all reserved signals
- -- masked (except the Interrupt_Manager) and Keep_Unmasked
- -- unmasked when created.
-
- -- Abort_Task_Interrupt is one of the signals unmasked
- -- in all tasks. We mask it in this particular task
- -- so that "sigwait" can catch an explicit
- -- Abort_Task_Interrupt from the Interrupt_Manager.
-
- -- There are two signals that this task catches through
- -- "sigwait." One is the signal it is designated to catch
- -- in order to execute an user handler or entry. The other is
- -- Abort_Task_Interrupt. This signal is sent from the
- -- Interrupt_Manager to inform of status changes (e.g: become Blocked,
- -- or a handler or entry is to be detached).
-
- -- Prepare the mask to be used for sigwait.
-
- IMOP.Empty_Interrupt_Mask (Intwait_Mask'Access);
-
- IMOP.Add_To_Interrupt_Mask
- (Intwait_Mask'Access, To_Signal (Interrupt));
-
- IMOP.Add_To_Interrupt_Mask
- (Intwait_Mask'Access, IMNG.Abort_Task_Interrupt);
-
- IMOP.Thread_Block_Interrupt (IMNG.Abort_Task_Interrupt);
-
- PIO.Set_Interrupt_ID (To_Signal (Interrupt), Self_ID);
-
- loop
- System.Tasking.Initialization.Defer_Abort (Self_ID);
- POP.Write_Lock (Self_ID);
-
- if User_Handler (Interrupt).H = null
- and then User_Entry (Interrupt).T = Null_Task
- then
-
- -- No signal binding. If a signal is received,
- -- Interrupt_Manager will take the default action.
-
- Self_ID.Common.State := Interrupt_Server_Blocked_Interrupt_Sleep;
- POP.Sleep (Self_ID, Interrupt_Server_Idle_Sleep);
- Self_ID.Common.State := Runnable;
-
- else
- -- A handler or an entry is installed. At this point all tasks
- -- mask for the signal is masked. Catch it using
- -- sigwait.
-
- -- This task may wake up from sigwait by receiving a signal
- -- (Abort_Task_Interrupt) from the Interrupt_Manager for unbinding
- -- a procedure handler or an entry. Or it could be a wake up
- -- from status change (Unblocked -> Blocked). If that is not
- -- the case, we should execute the attached procedure or entry.
-
- POP.Unlock (Self_ID);
-
- Ret_Interrupt := IMOP.Interrupt_Wait (Intwait_Mask'Access);
-
- if Ret_Interrupt = IMNG.Abort_Task_Interrupt then
- -- Inform the Interrupt_Manager of wakeup from above sigwait.
-
- POP.Abort_Task (Interrupt_Manager_ID);
- POP.Write_Lock (Self_ID);
-
- else
- POP.Write_Lock (Self_ID);
-
- -- Even though we have received a signal, the status may
- -- have changed before we got the Self_ID lock above.
- -- Therefore we make sure a handler or an entry is still
- -- bound and make appropriate call.
- -- If there is no call to make we need to regenerate the
- -- signal in order not to lose it.
-
- if User_Handler (Interrupt).H /= null then
-
- Tmp_Handler := User_Handler (Interrupt).H;
-
- -- RTS calls should not be made with self being locked.
-
- POP.Unlock (Self_ID);
-
- Tmp_Handler.all;
- POP.Write_Lock (Self_ID);
-
- elsif User_Entry (Interrupt).T /= Null_Task then
-
- Tmp_ID := User_Entry (Interrupt).T;
- Tmp_Entry_Index := User_Entry (Interrupt).E;
-
- -- RTS calls should not be made with self being locked.
-
- POP.Unlock (Self_ID);
-
- System.Tasking.Rendezvous.Call_Simple
- (Tmp_ID, Tmp_Entry_Index, System.Null_Address);
-
- POP.Write_Lock (Self_ID);
- else
- -- This is a situation where this task woke up receiving a
- -- signal and before it got the lock the signal was blocked.
- -- We do not want to lose the signal so we regenerate it at
- -- the process level.
-
- IMOP.Interrupt_Self_Process (Ret_Interrupt);
- end if;
- end if;
- end if;
-
- POP.Unlock (Self_ID);
- System.Tasking.Initialization.Undefer_Abort (Self_ID);
-
- -- Undefer abort here to allow a window for this task
- -- to be aborted at the time of system shutdown.
- end loop;
- end Signal_Server_Task;
-
---------------------------
-- Interrupt_Server_Task --
---------------------------
@@ -1566,7 +1064,7 @@ package body System.Interrupts is
-- Server task for vectored hardware interrupt handling
task body Interrupt_Server_Task is
- Self_ID : Task_ID := Self;
+ Self_Id : constant Task_ID := Self;
Tmp_Handler : Parameterless_Handler;
Tmp_ID : Task_ID;
Tmp_Entry_Index : Task_Entry_Index;
@@ -1607,7 +1105,7 @@ package body System.Interrupts is
-- Wait for the Interrupt_Manager to complete its work
- POP.Write_Lock (Self_ID);
+ POP.Write_Lock (Self_Id);
-- Delete the associated semaphore
@@ -1618,9 +1116,8 @@ package body System.Interrupts is
-- Set status for the Interrupt_Manager
Semaphore_ID_Map (Interrupt) := 0;
- Task_Lock (Interrupt) := False;
Server_ID (Interrupt) := Null_Task;
- POP.Unlock (Self_ID);
+ POP.Unlock (Self_Id);
exit;
end if;
@@ -1628,31 +1125,7 @@ package body System.Interrupts is
end Interrupt_Server_Task;
begin
- -- Elaboration code for package System.Interrupts
-
-- Get Interrupt_Manager's ID so that Abort_Interrupt can be sent.
Interrupt_Manager_ID := To_System (Interrupt_Manager'Identity);
-
- -- Initialize the lock L.
-
- Initialization.Defer_Abort (Self);
- POP.Initialize_Lock (L'Access, POP.PO_Level);
- Initialization.Undefer_Abort (Self);
-
- -- During the elaboration of this package body we want the RTS to
- -- inherit its signal mask from the Environment Task.
-
- -- The Environment Task should have gotten its mask from
- -- the enclosing process during the RTS start up. (See
- -- in s-inmaop.adb). Pass the Interrupt_Mask of the Environment
- -- task to the Interrupt_Manager.
-
- -- Note : At this point we know that all tasks (including
- -- RTS internal servers) are masked for non-reserved signals
- -- (see s-taprop.adb). Only the Interrupt_Manager will have
- -- masks set up differently, inheriting the original Environment
- -- Task's mask.
-
- Interrupt_Manager.Initialize (IMOP.Environment_Mask);
end System.Interrupts;