diff options
Diffstat (limited to 'gcc/ada/s-intman-vxworks.adb')
-rw-r--r-- | gcc/ada/s-intman-vxworks.adb | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/gcc/ada/s-intman-vxworks.adb b/gcc/ada/s-intman-vxworks.adb index 2dcaa06c77c..d31ad56d0ff 100644 --- a/gcc/ada/s-intman-vxworks.adb +++ b/gcc/ada/s-intman-vxworks.adb @@ -33,15 +33,6 @@ -- This is the VxWorks version of this package. --- It is likely to need tailoring to fit each operating system --- and machine architecture. - --- PLEASE DO NOT add any dependences on other packages. --- This package is designed to work with or without tasking support. - --- See the other warnings in the package specification before making --- any modifications to this file. - -- Make a careful study of all signals available under the OS, -- to see which need to be reserved, kept always unmasked, -- or kept always unmasked. @@ -74,6 +65,20 @@ package body System.Interrupt_Management is -- Local Subprograms -- ----------------------- + function State (Int : Interrupt_ID) return Character; + pragma Import (C, State, "__gnat_get_interrupt_state"); + -- Get interrupt state. Defined in init.c + -- The input argument is the interrupt number, + -- and the result is one of the following: + + Runtime : constant Character := 'r'; + Default : constant Character := 's'; + -- 'n' this interrupt not set by any Interrupt_State pragma + -- 'u' Interrupt_State pragma set state to User + -- 'r' Interrupt_State pragma set state to Runtime + -- 's' Interrupt_State pragma set state to System (use "default" + -- system handler) + procedure Notify_Exception (signo : Signal); -- Identify the Ada exception to be raised using -- the information when the system received a synchronous signal. @@ -116,27 +121,21 @@ package body System.Interrupt_Management is end loop; end Initialize_Interrupts; -begin - declare - mask : aliased sigset_t; - Result : int; - - function State (Int : Interrupt_ID) return Character; - pragma Import (C, State, "__gnat_get_interrupt_state"); - -- Get interrupt state. Defined in a-init.c - -- The input argument is the interrupt number, - -- and the result is one of the following: + ---------------- + -- Initialize -- + ---------------- - Runtime : constant Character := 'r'; - Default : constant Character := 's'; - -- 'n' this interrupt not set by any Interrupt_State pragma - -- 'u' Interrupt_State pragma set state to User - -- 'r' Interrupt_State pragma set state to Runtime - -- 's' Interrupt_State pragma set state to System (use "default" - -- system handler) + Initialized : Boolean := False; + procedure Initialize is + mask : aliased sigset_t; + Result : int; begin - -- Initialize signal handling + if Initialized then + return; + end if; + + Initialized := True; -- Change this if you want to use another signal for task abort. -- SIGTERM might be a good one. @@ -176,5 +175,6 @@ begin -- The abort signal must also be unmasked Keep_Unmasked (Abort_Task_Signal) := True; - end; + end Initialize; + end System.Interrupt_Management; |