Reorganize code.
authorEd Falis <falis@adacore.com>
Wed, 15 Apr 2009 12:45:27 +0000 (12:45 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 15 Apr 2009 12:45:27 +0000 (14:45 +0200)
From-SVN: r146109

gcc/ada/ChangeLog
gcc/ada/s-vxwext-rtp.adb
gcc/ada/s-vxwext-rtp.ads

index 4a332504eb7e5aac809971447f1c73a52ceff920..6872b651ca3f87f4f396ed65d4e7647ea03dc7a0 100644 (file)
@@ -28,7 +28,8 @@
 
        * s-osinte-vxworks-kernel.adb, s-osinte-vxworks.adb,
        s-osinte-vxworks.ads s-vxwext.ads, s-vxwext-kernel.adb,
-       s-vxwext-kernel.ads: Reorganize s-osinte-vxworks* and s-vxwext*.
+       s-vxwext-kernel.ads, s-vxwext-rtp.ads, s-vxwext-rtp.adb: Reorganize
+       s-osinte-vxworks* and s-vxwext*.
 
 2009-04-15  Arnaud Charlet  <charlet@adacore.com>
 
index 74ff505f096b75632125717ef552885f8395ead3..809ee91f0068417569f84a8ba05452a45e896feb 100644 (file)
 --                                                                          --
 ------------------------------------------------------------------------------
 
---  This is the VxWorks 6 rtp version of this package
+--  This package provides vxworks specific support functions needed
+--  by System.OS_Interface.
+
+--  This is the VxWorks 6 RTP version of this package
 
 package body System.VxWorks.Ext is
 
-   function Task_Cont (tid : t_id) return int is
-      pragma Unreferenced (tid);
-   begin
-      --  Operation not allowed in an RTP
-      return 0;
-   end Task_Cont;
+   ERROR : constant := -1;
 
-   function Task_Stop (tid : t_id) return int is
-      pragma Unreferenced (tid);
-   begin
-      --  Operation not allowed in an RTP
-      return 0;
-   end Task_Stop;
+   --------------
+   -- Int_Lock --
+   --------------
 
    function Int_Lock return int is
    begin
-      --  Operation not allowed in an RTP
-      return 0;
+      return ERROR;
    end Int_Lock;
 
+   ----------------
+   -- Int_Unlock --
+   ----------------
+
    function Int_Unlock return int is
    begin
-      --  Operation not allowed in an RTP
-      return 0;
+      return ERROR;
    end Int_Unlock;
 
+   --------------------
+   -- Set_Time_Slice --
+   --------------------
+
    function Set_Time_Slice (ticks : int) return int is
       pragma Unreferenced (ticks);
    begin
-      return 0;
+      return ERROR;
    end Set_Time_Slice;
 
+   function Interrupt_Connect
+     (Vector    : Interrupt_Vector;
+      Handler   : Interrupt_Handler;
+      Parameter : System.Address := System.Null_Address) return int is
+      pragma Unreferenced (Vector, Handler, Parameter);
+   begin
+      return ERROR;
+   end Interrupt_Connect;
+
+   function Interrupt_Number_To_Vector
+     (intNum : int) return Interrupt_Vector is
+      pragma Unreferenced (intNum);
+   begin
+      return 0;
+   end Interrupt_Number_To_Vector;
+
 end System.VxWorks.Ext;
index bba9cbcf95715baeab16b6c59f0ea89da0e4ade6..8d094412c6dde5f191bdff33e158ce131dfdf39e 100644 (file)
@@ -29,7 +29,7 @@
 --  This package provides vxworks specific support functions needed
 --  by System.OS_Interface.
 
---  This is the VxWorks 6 rtp version of this package
+--  This is the VxWorks 6 RTP version of this package
 
 with Interfaces.C;
 
@@ -39,11 +39,10 @@ package System.VxWorks.Ext is
    type t_id is new Long_Integer;
    subtype int is Interfaces.C.int;
 
-   function Task_Cont (tid : t_id) return int;
-   pragma Inline (Task_Cont);
+   type Interrupt_Handler is access procedure (parameter : System.Address);
+   pragma Convention (C, Interrupt_Handler);
 
-   function Task_Stop (tid : t_id) return int;
-   pragma Inline (Task_Stop);
+   type Interrupt_Vector is new System.Address;
 
    function Int_Lock return int;
    pragma Inline (Int_Lock);
@@ -51,13 +50,29 @@ package System.VxWorks.Ext is
    function Int_Unlock return int;
    pragma Inline (Int_Unlock);
 
+   function Interrupt_Connect
+     (Vector    : Interrupt_Vector;
+      Handler   : Interrupt_Handler;
+      Parameter : System.Address := System.Null_Address) return int;
+   pragma Convention (C, Interrupt_Connect);
+
+   function Interrupt_Number_To_Vector
+     (intNum : int) return Interrupt_Vector;
+   pragma Convention (C, Interrupt_Number_To_Vector);
+
+   function Task_Cont (tid : t_id) return int;
+   pragma Import (C, Task_Cont, "taskResume");
+
+   function Task_Stop (tid : t_id) return int;
+   pragma Import (C, Task_Stop, "taskSuspend");
+
    function kill (pid : t_id; sig : int) return int;
    pragma Import (C, kill, "taskKill");
 
-   function Set_Time_Slice (ticks : int) return int;
-   pragma Inline (Set_Time_Slice);
-
    function getpid return t_id;
    pragma Import (C, getpid, "getpid");
 
+   function Set_Time_Slice (ticks : int) return int;
+   pragma Inline (Set_Time_Slice);
+
 end System.VxWorks.Ext;