diff options
author | Doug Rupp <rupp@adacore.com> | 2021-07-23 12:00:04 -0700 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-09-22 15:01:48 +0000 |
commit | ab621f4ada197ec99f0b9673271c7accaa7925da (patch) | |
tree | f6f21f048efd94c0cc0b9683bb12e207c566be55 /gcc/ada/libgnarl/s-vxwext__rtp.ads | |
parent | 3d2226f1730e027808b8f9c17d4f6b7ac1eb7c44 (diff) | |
download | gcc-ab621f4ada197ec99f0b9673271c7accaa7925da.zip gcc-ab621f4ada197ec99f0b9673271c7accaa7925da.tar.gz gcc-ab621f4ada197ec99f0b9673271c7accaa7925da.tar.bz2 |
[Ada] VxWorks inconsistent use of return type (STATUS)
gcc/ada/
* libgnarl/s-interr__vxworks.adb (Interfaces.C): Remove as
unused.
(System.VxWorks.Ext): Import.
(System.VxWorks.Ext.STATUS): use type.
(STATUS): New subtype.
(OK): New constant.
(Interrupt_Connector): Return STATUS type vice int.
(Interrupt_Connect, Notify_Interrupt, Unbind_Handler,
Interrupt_Server_Task): Rename Status to Result. Assert Result =
OK.
* libgnarl/s-osinte__vxworks.adb (To_Clock_Ticks): Define constant
IERR, and return it vice ERROR.
(Binary_Semaphore_Delete): Return STATUS type vice int.
(Binary_Semaphore_Obtain): Likewise.
(Binary_Semaphore_Release): Likewise.
(Binary_Semaphore_Flush): Likewise.
* libgnarl/s-osinte__vxworks.ads (SVE): Renaming of
System.VxWorks.Ext.
(STATUS): Use SVE in declaration of subtype.
(BOOL): Likewise.
(vx_freq_t): Likewise.
(t_id): Likewise.
(gitpid): Use SVE in renaming of subprogram
(Task_Stop): Likewise.
(Task_Cont): Likewise.
(Int_Lock): Likewise.
(Int_Unlock): Likewise.
(Set_Time_Slice): Likewise.
(semDelete): Likewise.
(taskCpuAffinitySet): Likewise.
(taskMaskAffinitySet): Likewise.
(sigset_t): Use SVE in declaration of type.
(OK): Remove as unused.
(ERROR): Likewise.
(taskOptionsGet): return STATUS vice int.
(taskSuspend): Likewise.
(taskResume): Likewise.
(taskDelay): Likewise.
(taskVarAdd): Likewise.
(taskVarDelete): Likewise.
(taskVarSet): Likewise.
(tlkKeyCreate): Likewise.
(taskPrioritySet): Likewise.
(semGive): Likewise.
(semTake): Likewise.
(Binary_Semaphore_Delete): Likewise.
(Binary_Semaphore_Obtain): Likewise.
(Binary_Semaphore_Release): Likewise.
(Binary_Semaphore_Flush): Likewise.
(Interrupt_Connect): Likewise.
* libgnarl/s-taprop__vxworks.adb
(System.VxWorks.Ext.STATUS): use type.
(int): Syntactically align subtype.
(STATUS): New subtype.
(OK): New constant.
(Finalize_Lock): Check STATUS vice int. Assert OK.
(Finalize_Lock): Likewise.
(Write_Lock): Likewise.
(Write_Lock): Likewise.
(Write_Lock): Likewise.
(Unlock): Likewise.
(Unlock): Likewise.
(Unlock): Likewise.
(Unlock): Likewise.
(Sleep): Likewise.
(Sleep): Likewise.
(Sleep): Likewise.
(Timed_Sleep): Likewise and test Result.
(Timed_Delay): Likewise and test Result.
(Wakeup): Likewise.
(Yield): Likewise.
(Finalize_TCB): Likewise.
(Suspend_Until_True): Check OK.
(Stop_All_Tasks): Declare Dummy STATUS vice in. Check OK.
(Is_Task_Context): Use OSI renaming.
(Initialize): Use STATUS vice int.
* libgnarl/s-vxwext.adb
(IERR): Renamed from ERROR.
(taskCpuAffinitySet): Return IERR (int).
(taskMaskAffinitySet): Likewise.
* libgnarl/s-vxwext.ads
(STATUS): New subtype.
(OK): New STATUS constant.
(ERROR): Likewise.
* libgnarl/s-vxwext__kernel-smp.adb
(IERR): Renamed from ERROR.
(Int_Lock): Return IERR.
(semDelete): Return STATUS.
(Task_Cont): Likewise.
(Task_Stop): Likewise.
* libgnarl/s-vxwext__kernel.adb
(IERR): Renamed from ERROR.
(semDelete): Return STATUS.
(Task_Cont): Likewise.
(Task_Stop): Likewise.
(taskCpuAffinitySet): Return IERR (int)
(taskMaskAffinitySet): Likewise.
* libgnarl/s-vxwext__kernel.ads
(STATUS): New subtype.
(OK): New STATUS constant.
(ERROR): Likewise.
(Interrupt_Connect): Return STATUS
(semDelete): Likewise.
(Task_Cont): Likewise.
(Task_Stop): Likewise.
(Set_Time_Slice): Likewise.
* libgnarl/s-vxwext__rtp-smp.adb
(IERR): Renamed from ERROR.
(Int_Lock): return IERR constant vice ERROR.
(Interrupt_Connect): Return STATUS.
(semDelete): Likewise.
(Set_Time_Slice): Likewise.
* libgnarl/s-vxwext__rtp.adb
(IERR): Renamed from ERROR.
(Int_Lock): return IERR constant vice ERROR.
(Int_Unlock): Return STATUS.
(semDelete): Likewise.
(Set_Time_Slice): Likewise.
(taskCpuAffinitySet): Return IERR (int)
(taskMaskAffinitySet): Likewise.
* libgnarl/s-vxwext__rtp.ads
(STATUS): New subtype.
(OK): New STATUS constant.
(ERROR): Likewise.
(Interrupt_Connect): Return STATUS
(semDelete): Likewise.
(Task_Cont): Likewise.
(Task_Stop): Likewise.
(Set_Time_Slice): Likewise.
Diffstat (limited to 'gcc/ada/libgnarl/s-vxwext__rtp.ads')
-rw-r--r-- | gcc/ada/libgnarl/s-vxwext__rtp.ads | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/ada/libgnarl/s-vxwext__rtp.ads b/gcc/ada/libgnarl/s-vxwext__rtp.ads index 7e3a8ba..995d098 100644 --- a/gcc/ada/libgnarl/s-vxwext__rtp.ads +++ b/gcc/ada/libgnarl/s-vxwext__rtp.ads @@ -45,6 +45,12 @@ package System.VxWorks.Ext is subtype int is Interfaces.C.int; subtype unsigned is Interfaces.C.unsigned; + type STATUS is new int; + -- Equivalent of the C type STATUS + + OK : constant STATUS := 0; + ERROR : constant STATUS := -1; + type BOOL is new int; -- Equivalent of the C type BOOL @@ -65,7 +71,7 @@ package System.VxWorks.Ext is function Interrupt_Connect (Vector : Interrupt_Vector; Handler : Interrupt_Handler; - Parameter : System.Address := System.Null_Address) return int; + Parameter : System.Address := System.Null_Address) return STATUS; pragma Convention (C, Interrupt_Connect); function Interrupt_Context return BOOL; @@ -75,13 +81,13 @@ package System.VxWorks.Ext is (intNum : int) return Interrupt_Vector; pragma Convention (C, Interrupt_Number_To_Vector); - function semDelete (Sem : SEM_ID) return int; + function semDelete (Sem : SEM_ID) return STATUS; pragma Convention (C, semDelete); - function Task_Cont (tid : t_id) return int; + function Task_Cont (tid : t_id) return STATUS; pragma Import (C, Task_Cont, "taskResume"); - function Task_Stop (tid : t_id) return int; + function Task_Stop (tid : t_id) return STATUS; pragma Import (C, Task_Stop, "taskSuspend"); function kill (pid : t_id; sig : int) return int; @@ -90,7 +96,7 @@ package System.VxWorks.Ext is function getpid return t_id; pragma Import (C, getpid, "getpid"); - function Set_Time_Slice (ticks : int) return int; + function Set_Time_Slice (ticks : int) return STATUS; pragma Inline (Set_Time_Slice); -------------------------------- |