Commit 231bba8d by Arnaud Charlet Committed by Arnaud Charlet

s-vxwext__kernel-smp.adb, [...]: New file.

	* libgnarl/s-vxwext__kernel-smp.adb,
	libgnarl/s-tpopsp__vxworks-rtp.adb, libgnarl/s-vxwext__noints.adb:
	New file.

From-SVN: r252075
parent 4395a473
2017-09-13 Arnaud Charlet <charlet@adacore.com>
* libgnarl/s-vxwext__kernel-smp.adb,
libgnarl/s-tpopsp__vxworks-rtp.adb, libgnarl/s-vxwext__noints.adb:
New file.
2017-09-13 Hristian Kirtchev <kirtchev@adacore.com>
* einfo.adb: Flag42 is now Is_Controlled_Active.
......
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- SYSTEM.TASK_PRIMITIVES.OPERATIONS.SPECIFIC --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2017, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This is a VxWorks version of this package for RTPs where foreign threads
-- are recognized. The implementation is based on VxWorks tlsLib or oldTlsLib.
separate (System.Task_Primitives.Operations)
package body Specific is
ATCB_Key : int := 0;
-- Key used to find the Ada Task_Id associated with a thread
----------------
-- Initialize --
----------------
procedure Initialize is
begin
ATCB_Key := tlsKeyCreate;
pragma Assert (ATCB_Key /= ERROR);
end Initialize;
-------------------
-- Is_Valid_Task --
-------------------
function Is_Valid_Task return Boolean is
begin
return tlsValueGet (ATCB_Key) /= System.Null_Address;
end Is_Valid_Task;
---------
-- Set --
---------
procedure Set (Self_Id : Task_Id) is
Result : STATUS;
begin
Result := tlsValueSet (ATCB_Key, To_Address (Self_Id));
pragma Assert (Result /= ERROR);
end Set;
----------
-- Self --
----------
function Self return Task_Id is
begin
return To_Task_Id (tlsValueGet (ATCB_Key));
end Self;
end Specific;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . V X W O R K S . E X T --
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2017, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
------------------------------------------------------------------------------
-- This package provides vxworks specific support functions needed
-- by System.OS_Interface.
-- This is the VxWorks 6 SMP kernel version of this package
package body System.VxWorks.Ext is
ERROR : constant := -1;
--------------
-- Int_Lock --
--------------
function Int_Lock return int is
begin
return ERROR;
end Int_Lock;
----------------
-- Int_Unlock --
----------------
function Int_Unlock (Old : int) return int is
pragma Unreferenced (Old);
begin
return ERROR;
end Int_Unlock;
---------------
-- semDelete --
---------------
function semDelete (Sem : SEM_ID) return int is
function Os_Sem_Delete (Sem : SEM_ID) return int;
pragma Import (C, Os_Sem_Delete, "semDelete");
begin
return Os_Sem_Delete (Sem);
end semDelete;
------------------------
-- taskCpuAffinitySet --
------------------------
function taskCpuAffinitySet (tid : t_id; CPU : int) return int
is
function Set_Affinity (tid : t_id; CPU : int) return int;
pragma Import (C, Set_Affinity, "__gnat_set_affinity");
begin
return Set_Affinity (tid, CPU);
end taskCpuAffinitySet;
-------------------------
-- taskMaskAffinitySet --
-------------------------
function taskMaskAffinitySet (tid : t_id; CPU_Set : unsigned) return int is
function Set_Affinity (tid : t_id; CPU_Set : unsigned) return int;
pragma Import (C, Set_Affinity, "__gnat_set_affinity_mask");
begin
return Set_Affinity (tid, CPU_Set);
end taskMaskAffinitySet;
--------------
-- taskCont --
--------------
function Task_Cont (tid : t_id) return int is
function taskCont (tid : t_id) return int;
pragma Import (C, taskCont, "taskCont");
begin
return taskCont (tid);
end Task_Cont;
--------------
-- taskStop --
--------------
function Task_Stop (tid : t_id) return int is
function taskStop (tid : t_id) return int;
pragma Import (C, taskStop, "taskStop");
begin
return taskStop (tid);
end Task_Stop;
end System.VxWorks.Ext;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . V X W O R K S . E X T --
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2017, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
------------------------------------------------------------------------------
-- This package provides vxworks specific support functions needed
-- by System.OS_Interface.
-- This is a version for VxWorks 5 based systems with no interrupts:
-- HI-Ravenscar for VxWorks 5, VxWorks 653 vThreads (not ravenscar-cert)
package body System.VxWorks.Ext is
ERROR : constant := -1;
--------------
-- Int_Lock --
--------------
function Int_Lock return int is
begin
return ERROR;
end Int_Lock;
----------------
-- Int_Unlock --
----------------
function Int_Unlock (Old : int) return int is
pragma Unreferenced (Old);
begin
return ERROR;
end Int_Unlock;
-----------------------
-- Interrupt_Connect --
-----------------------
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;
-----------------------
-- Interrupt_Context --
-----------------------
function Interrupt_Context return int is
begin
-- For VxWorks 653 vThreads, never in an interrupt context
return 0;
end Interrupt_Context;
--------------------------------
-- Interrupt_Number_To_Vector --
--------------------------------
function Interrupt_Number_To_Vector
(intNum : int) return Interrupt_Vector
is
pragma Unreferenced (intNum);
begin
return 0;
end Interrupt_Number_To_Vector;
---------------
-- semDelete --
---------------
function semDelete (Sem : SEM_ID) return int is
function Os_Sem_Delete (Sem : SEM_ID) return int;
pragma Import (C, Os_Sem_Delete, "semDelete");
begin
return Os_Sem_Delete (Sem);
end semDelete;
------------------------
-- taskCpuAffinitySet --
------------------------
function taskCpuAffinitySet (tid : t_id; CPU : int) return int is
pragma Unreferenced (tid, CPU);
begin
return ERROR;
end taskCpuAffinitySet;
-------------------------
-- taskMaskAffinitySet --
-------------------------
function taskMaskAffinitySet (tid : t_id; CPU_Set : unsigned) return int is
pragma Unreferenced (tid, CPU_Set);
begin
return ERROR;
end taskMaskAffinitySet;
end System.VxWorks.Ext;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment