summaryrefslogtreecommitdiff
path: root/gcc/ada/5vinterr.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/5vinterr.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/5vinterr.adb')
-rw-r--r--gcc/ada/5vinterr.adb220
1 files changed, 51 insertions, 169 deletions
diff --git a/gcc/ada/5vinterr.adb b/gcc/ada/5vinterr.adb
index 33e6a1da468..798fd80473d 100644
--- a/gcc/ada/5vinterr.adb
+++ b/gcc/ada/5vinterr.adb
@@ -6,9 +6,9 @@
-- --
-- B o d y --
-- --
--- $Revision: 1.1 $
+-- $Revision$
-- --
--- Copyright (C) 1991-2000 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). --
-- --
------------------------------------------------------------------------------
@@ -84,13 +83,8 @@ with System.Interrupt_Management.Operations;
-- Set_Interrupt_Mask
-- IS_Member
-- Environment_Mask
--- All_Tasks_Mask
pragma Elaborate_All (System.Interrupt_Management.Operations);
-with System.Error_Reporting;
-pragma Warnings (Off, System.Error_Reporting);
--- used for Shutdown
-
with System.Task_Primitives.Operations;
-- used for Write_Lock
-- Unlock
@@ -125,12 +119,15 @@ with System.Tasking.Initialization;
-- used for Defer_Abort
-- Undefer_Abort
+with System.Parameters;
+-- used for Single_Lock
+
with Unchecked_Conversion;
package body System.Interrupts is
use Tasking;
- use System.Error_Reporting;
+ use System.Parameters;
use Ada.Exceptions;
package PRI renames System.Task_Primitives;
@@ -146,11 +143,13 @@ 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 Detach_Interrupt_Entries (T : Task_ID);
+
entry Initialize (Mask : IMNG.Interrupt_Mask);
entry Attach_Handler
@@ -174,8 +173,6 @@ package body System.Interrupts is
E : Task_Entry_Index;
Interrupt : Interrupt_ID);
- entry Detach_Interrupt_Entries (T : Task_ID);
-
entry Block_Interrupt (Interrupt : Interrupt_ID);
entry Unblock_Interrupt (Interrupt : Interrupt_ID);
@@ -260,109 +257,20 @@ package body System.Interrupts is
Access_Hold : Server_Task_Access;
-- variable used to allocate Server_Task using "new".
- L : aliased PRI.RTS_Lock;
- -- L protects contents in tables above corresponding to interrupts
- -- for which Server_ID (T) = null.
- --
- -- If Server_ID (T) /= null then protection is via
- -- per-task (TCB) lock of Server_ID (T).
- --
- -- For deadlock prevention, L should not be locked after
- -- any other lock is held.
-
- Task_Lock : array (Interrupt_ID'Range) of Boolean := (others => False);
- -- Boolean flags to give matching Locking and Unlocking. See the comments
- -- in Lock_Interrupt.
-
-----------------------
-- Local Subprograms --
-----------------------
- procedure Lock_Interrupt
- (Self_ID : Task_ID;
- Interrupt : Interrupt_ID);
- -- protect the tables using L or 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);
-
function Is_Registered (Handler : Parameterless_Handler) return Boolean;
+ -- See if the Handler has been "pragma"ed using Interrupt_Handler.
+ -- Always consider a null handler as registered.
- --------------------
- -- 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
-
- -- We need to use per-task lock.
-
- POP.Unlock (L'Access);
- POP.Write_Lock (Server_ID (Interrupt));
-
- -- Rely on the fact that once Server_ID is set to a non-null
- -- value it will never be set back to null.
-
- elsif Server_ID (Interrupt) /= Null_Task then
-
- -- We need to use per-task lock.
-
- Task_Lock (Interrupt) := True;
- POP.Unlock (L'Access);
- POP.Write_Lock (Server_ID (Interrupt));
- end if;
- end Lock_Interrupt;
-
- ----------------------
- -- Unlock_Interrupt --
- ----------------------
-
- procedure Unlock_Interrupt
- (Self_ID : Task_ID;
- Interrupt : Interrupt_ID)
- is
- begin
- if Task_Lock (Interrupt) then
- POP.Unlock (Server_ID (Interrupt));
- else
- POP.Unlock (L'Access);
- end if;
-
- Initialization.Undefer_Abort (Self_ID);
- end Unlock_Interrupt;
-
- ----------------------------------
- -- Register_Interrupt_Handler --
- ----------------------------------
+ --------------------------------
+ -- Register_Interrupt_Handler --
+ --------------------------------
procedure Register_Interrupt_Handler (Handler_Addr : System.Address) is
New_Node_Ptr : R_Link;
-
begin
-- This routine registers the Handler as usable for Dynamic
-- Interrupt Handler. Routines attaching and detaching Handler
@@ -393,11 +301,7 @@ package body System.Interrupts is
-- Is_Registered --
-------------------
- -- See if the 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;
Handler_Addr : System.Address;
@@ -529,8 +433,7 @@ package body System.Interrupts is
procedure Attach_Handler
(New_Handler : in Parameterless_Handler;
Interrupt : in Interrupt_ID;
- Static : in Boolean := False)
- is
+ Static : in Boolean := False) is
begin
if Is_Reserved (Interrupt) then
Raise_Exception (Program_Error'Identity, "Interrupt" &
@@ -557,8 +460,7 @@ package body System.Interrupts is
(Old_Handler : out Parameterless_Handler;
New_Handler : in Parameterless_Handler;
Interrupt : in Interrupt_ID;
- Static : in Boolean := False)
- is
+ Static : in Boolean := False) is
begin
if Is_Reserved (Interrupt) then
Raise_Exception (Program_Error'Identity, "Interrupt" &
@@ -583,8 +485,7 @@ package body System.Interrupts is
procedure Detach_Handler
(Interrupt : in Interrupt_ID;
- Static : in Boolean := False)
- is
+ Static : in Boolean := False) is
begin
if Is_Reserved (Interrupt) then
Raise_Exception (Program_Error'Identity, "Interrupt" &
@@ -592,7 +493,6 @@ package body System.Interrupts is
end if;
Interrupt_Manager.Detach_Handler (Interrupt, Static);
-
end Detach_Handler;
---------------
@@ -623,7 +523,7 @@ package body System.Interrupts is
E : Task_Entry_Index;
Int_Ref : System.Address)
is
- Interrupt : constant Interrupt_ID :=
+ Interrupt : constant Interrupt_ID :=
Interrupt_ID (Storage_Elements.To_Integer (Int_Ref));
begin
@@ -678,9 +578,7 @@ package body System.Interrupts is
------------------
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" &
@@ -724,9 +622,9 @@ package body System.Interrupts is
task body Interrupt_Manager is
- ----------------------
- -- Local Variables --
- ----------------------
+ ---------------------
+ -- Local Variables --
+ ---------------------
Intwait_Mask : aliased IMNG.Interrupt_Mask;
Ret_Interrupt : Interrupt_ID;
@@ -757,15 +655,12 @@ package body System.Interrupts is
New_Handler : in Parameterless_Handler;
Interrupt : in Interrupt_ID;
Static : in Boolean;
- Restoration : in Boolean := False)
- is
+ Restoration : in Boolean := False) is
begin
if User_Entry (Interrupt).T /= Null_Task then
-
-- In case we have an Interrupt Entry already installed.
-- raise a program error. (propagate it to the caller).
- Unlock_Interrupt (Self_ID, Interrupt);
Raise_Exception (Program_Error'Identity,
"An interrupt is already installed");
end if;
@@ -778,7 +673,6 @@ package body System.Interrupts is
-- may be detaching a static handler to restore a dynamic one.
if not Restoration and then not Static
-
-- Tries to overwrite a static Interrupt Handler with a
-- dynamic Handler
@@ -789,7 +683,6 @@ package body System.Interrupts is
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 " &
"dynamic Handler");
@@ -842,11 +735,9 @@ package body System.Interrupts is
begin
if User_Entry (Interrupt).T /= Null_Task then
-
-- In case we have an Interrupt Entry installed.
-- raise a 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;
@@ -856,11 +747,9 @@ package body System.Interrupts is
-- status of the current_Handler.
if not Static and then User_Handler (Interrupt).Static then
-
-- Tries to detach a static Interrupt Handler.
-- raise a program error.
- Unlock_Interrupt (Self_ID, Interrupt);
Raise_Exception (Program_Error'Identity,
"Trying to detach a static Interrupt Handler");
end if;
@@ -933,7 +822,6 @@ package body System.Interrupts is
declare
Old_Handler : Parameterless_Handler;
-
begin
select
@@ -943,10 +831,8 @@ package body System.Interrupts is
Static : in Boolean;
Restoration : in 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
@@ -955,19 +841,15 @@ package body System.Interrupts is
Interrupt : in Interrupt_ID;
Static : in 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 : in Interrupt_ID;
Static : in 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
@@ -975,15 +857,12 @@ package body System.Interrupts is
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;
@@ -1014,16 +893,12 @@ package body System.Interrupts is
POP.Wakeup (Server_ID (Interrupt),
Interrupt_Server_Idle_Sleep);
end if;
-
- Unlock_Interrupt (Self_ID, Interrupt);
end Bind_Interrupt_To_Entry;
or accept Detach_Interrupt_Entries (T : Task_ID)
do
for I in Interrupt_ID'Range loop
if not Is_Reserved (I) then
- Lock_Interrupt (Self_ID, I);
-
if User_Entry (I).T = T then
-- The interrupt should no longer be ignored if
@@ -1034,8 +909,6 @@ package body System.Interrupts is
(T => Null_Task, E => Null_Task_Entry);
IMOP.Interrupt_Self_Process (IMNG.Interrupt_ID (I));
end if;
-
- Unlock_Interrupt (Self_ID, I);
end if;
end loop;
@@ -1063,7 +936,6 @@ package body System.Interrupts is
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.
@@ -1071,15 +943,10 @@ package body System.Interrupts is
null;
when others =>
- pragma Assert
- (Shutdown ("Interrupt_Manager---exception not expected"));
+ pragma Assert (False);
null;
end;
-
end loop;
-
- pragma Assert (Shutdown ("Interrupt_Manager---should not get here"));
-
end Interrupt_Manager;
-----------------
@@ -1131,6 +998,10 @@ package body System.Interrupts is
-- from status change (Unblocked -> Blocked). If that is not
-- the case, we should exceute the attached Procedure or Entry.
+ if Single_Lock then
+ POP.Lock_RTS;
+ end if;
+
POP.Write_Lock (Self_ID);
if User_Handler (Interrupt).H = null
@@ -1144,7 +1015,6 @@ package body System.Interrupts is
Self_ID.Common.State := Runnable;
else
-
Self_ID.Common.State := Interrupt_Server_Blocked_On_Event_Flag;
Ret_Interrupt := IMOP.Interrupt_Wait (Intwait_Mask'Access);
Self_ID.Common.State := Runnable;
@@ -1160,9 +1030,17 @@ package body System.Interrupts is
POP.Unlock (Self_ID);
+ if Single_Lock then
+ POP.Unlock_RTS;
+ end if;
+
Tmp_Handler.all;
POP.Write_Lock (Self_ID);
+ if Single_Lock then
+ POP.Lock_RTS;
+ end if;
+
elsif User_Entry (Interrupt).T /= Null_Task then
Tmp_ID := User_Entry (Interrupt).T;
Tmp_Entry_Index := User_Entry (Interrupt).E;
@@ -1171,22 +1049,33 @@ package body System.Interrupts is
POP.Unlock (Self_ID);
+ if Single_Lock then
+ POP.Unlock_RTS;
+ end if;
+
System.Tasking.Rendezvous.Call_Simple
(Tmp_ID, Tmp_Entry_Index, System.Null_Address);
POP.Write_Lock (Self_ID);
+
+ if Single_Lock then
+ POP.Lock_RTS;
+ end if;
end if;
end if;
end if;
POP.Unlock (Self_ID);
+
+ if Single_Lock then
+ POP.Unlock_RTS;
+ end if;
+
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;
-
- pragma Assert (Shutdown ("Server_Task---should not get here"));
end Server_Task;
-------------------------------------
@@ -1239,8 +1128,7 @@ package body System.Interrupts is
procedure Install_Handlers
(Object : access Static_Interrupt_Protection;
- New_Handlers : in New_Handler_Array)
- is
+ New_Handlers : in New_Handler_Array) is
begin
for N in New_Handlers'Range loop
@@ -1268,12 +1156,6 @@ begin
Interrupt_Manager_ID := To_System (Interrupt_Manager'Identity);
- -- Initialize the lock L.
-
- Initialization.Defer_Abort (Self);
- POP.Initialize_Lock (L'Access, POP.ATCB_Level);
- Initialization.Undefer_Abort (Self);
-
-- During the elaboration of this package body we want RTS to
-- inherit the interrupt mask from the Environment Task.