diff options
Diffstat (limited to 'gcc/ada/libgnarl/s-interr__vxworks.adb')
-rw-r--r-- | gcc/ada/libgnarl/s-interr__vxworks.adb | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/gcc/ada/libgnarl/s-interr__vxworks.adb b/gcc/ada/libgnarl/s-interr__vxworks.adb index d496b74..db2ca95 100644 --- a/gcc/ada/libgnarl/s-interr__vxworks.adb +++ b/gcc/ada/libgnarl/s-interr__vxworks.adb @@ -66,7 +66,6 @@ with Ada.Unchecked_Conversion; with Ada.Task_Identification; -with Interfaces.C; use Interfaces.C; with System.OS_Interface; use System.OS_Interface; with System.Interrupt_Management; with System.Task_Primitives.Operations; @@ -76,12 +75,18 @@ with System.Tasking.Utilities; with System.Tasking.Rendezvous; pragma Elaborate_All (System.Tasking.Rendezvous); +with System.VxWorks.Ext; + package body System.Interrupts is use Tasking; package POP renames System.Task_Primitives.Operations; + use type System.VxWorks.Ext.STATUS; + subtype STATUS is System.VxWorks.Ext.STATUS; + OK : constant STATUS := System.VxWorks.Ext.OK; + function To_Ada is new Ada.Unchecked_Conversion (System.Tasking.Task_Id, Ada.Task_Identification.Task_Id); @@ -199,7 +204,7 @@ package body System.Interrupts is type Interrupt_Connector is access function (Vector : Interrupt_Vector; Handler : Interrupt_Handler; - Parameter : System.Address := System.Null_Address) return int; + Parameter : System.Address := System.Null_Address) return STATUS; -- Profile must match VxWorks intConnect() Interrupt_Connect : Interrupt_Connector := @@ -515,7 +520,7 @@ package body System.Interrupts is Vec : constant Interrupt_Vector := Interrupt_Number_To_Vector (int (Interrupt)); - Status : int; + Result : STATUS; begin -- Only install umbrella handler when no Ada handler has already been @@ -525,9 +530,9 @@ package body System.Interrupts is -- number. if not Handler_Installed (Interrupt) then - Status := + Result := Interrupt_Connect.all (Vec, Handler, System.Address (Interrupt)); - pragma Assert (Status = 0); + pragma Assert (Result = OK); Handler_Installed (Interrupt) := True; end if; @@ -646,11 +651,11 @@ package body System.Interrupts is procedure Notify_Interrupt (Param : System.Address) is Interrupt : constant Interrupt_ID := Interrupt_ID (Param); Id : constant Binary_Semaphore_Id := Semaphore_ID_Map (Interrupt); - Status : int; + Result : STATUS; begin if Id /= 0 then - Status := Binary_Semaphore_Release (Id); - pragma Assert (Status = 0); + Result := Binary_Semaphore_Release (Id); + pragma Assert (Result = OK); end if; end Notify_Interrupt; @@ -787,13 +792,13 @@ package body System.Interrupts is -------------------- procedure Unbind_Handler (Interrupt : Interrupt_ID) is - Status : int; + Result : STATUS; begin -- Flush server task off semaphore, allowing it to terminate - Status := Binary_Semaphore_Flush (Semaphore_ID_Map (Interrupt)); - pragma Assert (Status = 0); + Result := Binary_Semaphore_Flush (Semaphore_ID_Map (Interrupt)); + pragma Assert (Result = OK); end Unbind_Handler; -------------------------------- @@ -1067,7 +1072,7 @@ package body System.Interrupts is Tmp_Handler : Parameterless_Handler; Tmp_ID : Task_Id; Tmp_Entry_Index : Task_Entry_Index; - Status : int; + Result : STATUS; begin Semaphore_ID_Map (Interrupt) := Int_Sema; @@ -1076,8 +1081,8 @@ package body System.Interrupts is -- Pend on semaphore that will be triggered by the umbrella handler -- when the associated interrupt comes in. - Status := Binary_Semaphore_Obtain (Int_Sema); - pragma Assert (Status = 0); + Result := Binary_Semaphore_Obtain (Int_Sema); + pragma Assert (Result = OK); if User_Handler (Interrupt).H /= null then @@ -1109,9 +1114,9 @@ package body System.Interrupts is -- Delete the associated semaphore - Status := Binary_Semaphore_Delete (Int_Sema); + Result := Binary_Semaphore_Delete (Int_Sema); - pragma Assert (Status = 0); + pragma Assert (Result = OK); -- Set status for the Interrupt_Manager |