[Ada] VxWorks inconsistent use of return type (Int_Unlock)

Message ID 20210922151540.GA1907698@adacore.com
State Committed
Commit 064056d7b54538dbe47834e8951edf837ee91dc4
Headers
Series [Ada] VxWorks inconsistent use of return type (Int_Unlock) |

Commit Message

Pierre-Marie de Rodat Sept. 22, 2021, 3:15 p.m. UTC
  Int_Unlock/intUnlock is incorrectly declared as a function. In the
VxWorks headers intUnlock is type void.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* libgnarl/s-osinte__vxworks.ads: Make procedure vice function.
	* libgnarl/s-vxwext.ads: Likewise.
	* libgnarl/s-vxwext__kernel-smp.adb: Likewise.
	* libgnarl/s-vxwext__kernel.adb: Likewise.
	* libgnarl/s-vxwext__kernel.ads: Likewise.
	* libgnarl/s-vxwext__rtp-smp.adb: Likewise.
	* libgnarl/s-vxwext__rtp.adb: Likewise.
	* libgnarl/s-vxwext__rtp.ads: Likewise.
	* libgnarl/s-taprop__vxworks.adb (Stop_All_Tasks): Call
	Int_Unlock as a procedure.
  

Patch

diff --git a/gcc/ada/libgnarl/s-osinte__vxworks.ads b/gcc/ada/libgnarl/s-osinte__vxworks.ads
--- a/gcc/ada/libgnarl/s-osinte__vxworks.ads
+++ b/gcc/ada/libgnarl/s-osinte__vxworks.ads
@@ -232,8 +232,7 @@  package System.OS_Interface is
    --  If we are in the kernel space, lock interrupts. It typically maps to
    --  intLock.
 
-   function Int_Unlock (Old : int) return int
-     renames System.VxWorks.Ext.Int_Unlock;
+   procedure Int_Unlock (Old : int) renames System.VxWorks.Ext.Int_Unlock;
    --  If we are in the kernel space, unlock interrupts. It typically maps to
    --  intUnlock. The parameter Old is only used on PowerPC where it contains
    --  the returned value from Int_Lock (the old MPSR).


diff --git a/gcc/ada/libgnarl/s-taprop__vxworks.adb b/gcc/ada/libgnarl/s-taprop__vxworks.adb
--- a/gcc/ada/libgnarl/s-taprop__vxworks.adb
+++ b/gcc/ada/libgnarl/s-taprop__vxworks.adb
@@ -1268,7 +1268,7 @@  package body System.Task_Primitives.Operations is
          C := C.Common.All_Tasks_Link;
       end loop;
 
-      Dummy := Int_Unlock (Old);
+      Int_Unlock (Old);
    end Stop_All_Tasks;
 
    ---------------


diff --git a/gcc/ada/libgnarl/s-vxwext.ads b/gcc/ada/libgnarl/s-vxwext.ads
--- a/gcc/ada/libgnarl/s-vxwext.ads
+++ b/gcc/ada/libgnarl/s-vxwext.ads
@@ -57,7 +57,7 @@  package System.VxWorks.Ext is
    function Int_Lock return int;
    pragma Import (C, Int_Lock, "intLock");
 
-   function Int_Unlock (Old : int) return int;
+   procedure Int_Unlock (Old : int);
    pragma Import (C, Int_Unlock, "intUnlock");
 
    function Interrupt_Connect


diff --git a/gcc/ada/libgnarl/s-vxwext__kernel-smp.adb b/gcc/ada/libgnarl/s-vxwext__kernel-smp.adb
--- a/gcc/ada/libgnarl/s-vxwext__kernel-smp.adb
+++ b/gcc/ada/libgnarl/s-vxwext__kernel-smp.adb
@@ -48,10 +48,10 @@  package body System.VxWorks.Ext is
    -- Int_Unlock --
    ----------------
 
-   function Int_Unlock (Old : int) return int is
+   procedure Int_Unlock (Old : int) is
       pragma Unreferenced (Old);
    begin
-      return ERROR;
+      null;
    end Int_Unlock;
 
    ---------------


diff --git a/gcc/ada/libgnarl/s-vxwext__kernel.adb b/gcc/ada/libgnarl/s-vxwext__kernel.adb
--- a/gcc/ada/libgnarl/s-vxwext__kernel.adb
+++ b/gcc/ada/libgnarl/s-vxwext__kernel.adb
@@ -49,10 +49,10 @@  package body System.VxWorks.Ext is
    -- Int_Unlock --
    ----------------
 
-   function intUnlock (Old : int) return int;
+   procedure intUnlock (Old : int);
    pragma Import (C, intUnlock, "intUnlock");
 
-   function Int_Unlock (Old : int) return int renames intUnlock;
+   procedure Int_Unlock (Old : int) renames intUnlock;
 
    ---------------
    -- semDelete --


diff --git a/gcc/ada/libgnarl/s-vxwext__kernel.ads b/gcc/ada/libgnarl/s-vxwext__kernel.ads
--- a/gcc/ada/libgnarl/s-vxwext__kernel.ads
+++ b/gcc/ada/libgnarl/s-vxwext__kernel.ads
@@ -56,7 +56,7 @@  package System.VxWorks.Ext is
    function Int_Lock return int;
    pragma Convention (C, Int_Lock);
 
-   function Int_Unlock (Old : int) return int;
+   procedure Int_Unlock (Old : int);
    pragma Convention (C, Int_Unlock);
 
    function Interrupt_Connect


diff --git a/gcc/ada/libgnarl/s-vxwext__rtp-smp.adb b/gcc/ada/libgnarl/s-vxwext__rtp-smp.adb
--- a/gcc/ada/libgnarl/s-vxwext__rtp-smp.adb
+++ b/gcc/ada/libgnarl/s-vxwext__rtp-smp.adb
@@ -48,10 +48,10 @@  package body System.VxWorks.Ext is
    -- Int_Unlock --
    ----------------
 
-   function Int_Unlock (Old : int) return int is
+   procedure Int_Unlock (Old : int) is
       pragma Unreferenced (Old);
    begin
-      return ERROR;
+      null;
    end Int_Unlock;
 
    -----------------------


diff --git a/gcc/ada/libgnarl/s-vxwext__rtp.adb b/gcc/ada/libgnarl/s-vxwext__rtp.adb
--- a/gcc/ada/libgnarl/s-vxwext__rtp.adb
+++ b/gcc/ada/libgnarl/s-vxwext__rtp.adb
@@ -48,10 +48,10 @@  package body System.VxWorks.Ext is
    -- Int_Unlock --
    ----------------
 
-   function Int_Unlock (Old : int) return int is
+   procedure Int_Unlock (Old : int) is
       pragma Unreferenced (Old);
    begin
-      return ERROR;
+      null;
    end Int_Unlock;
 
    -----------------------


diff --git a/gcc/ada/libgnarl/s-vxwext__rtp.ads b/gcc/ada/libgnarl/s-vxwext__rtp.ads
--- a/gcc/ada/libgnarl/s-vxwext__rtp.ads
+++ b/gcc/ada/libgnarl/s-vxwext__rtp.ads
@@ -56,7 +56,7 @@  package System.VxWorks.Ext is
    function Int_Lock return int;
    pragma Inline (Int_Lock);
 
-   function Int_Unlock (Old : int) return int;
+   procedure Int_Unlock (Old : int);
    pragma Inline (Int_Unlock);
 
    function Interrupt_Connect