Commit d1fa78e3 by Jose Ruiz Committed by Arnaud Charlet

s-osinte-vxworks.ads, [...]:

2006-10-31  Jose Ruiz  <ruiz@adacore.com>

	* s-osinte-vxworks.ads, s-osinte-vxworks.adb: 
	(getpid): New body for this function that uses the underlying taskIdSelf
	function for VxWorks 5 and VxWorks 6 in kernel mode.
	(unsigned_int): New type, modular to allow logical bit operations.
	(taskOptionsGet): New imported function.

	* s-taspri-vxworks.ads (Private_Data): Change the type for the LWP
	field to be compliant with the type used by the corresponding operating
	system primitive.

From-SVN: r118239
parent 8dbb621e
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1997-2005 Free Software Foundation -- -- Copyright (C) 1997-2006 Free Software Foundation --
-- -- -- --
-- GNARL is free software; you can redistribute it and/or modify it under -- -- GNARL 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -47,6 +47,18 @@ package body System.OS_Interface is ...@@ -47,6 +47,18 @@ package body System.OS_Interface is
Low_Priority : constant := 255; Low_Priority : constant := 255;
-- VxWorks native (default) lowest scheduling priority. -- VxWorks native (default) lowest scheduling priority.
------------
-- getpid --
------------
function getpid return t_id is
begin
-- VxWorks 5 (and VxWorks 6 in kernel mode) does not have a getpid
-- function. taskIdSelf is the equivalent routine.
return taskIdSelf;
end getpid;
---------- ----------
-- kill -- -- kill --
---------- ----------
......
...@@ -48,6 +48,7 @@ package System.OS_Interface is ...@@ -48,6 +48,7 @@ package System.OS_Interface is
subtype int is Interfaces.C.int; subtype int is Interfaces.C.int;
subtype short is Short_Integer; subtype short is Short_Integer;
type unsigned_int is mod 2 ** int'Size;
type long is new Long_Integer; type long is new Long_Integer;
type unsigned_long is mod 2 ** long'Size; type unsigned_long is mod 2 ** long'Size;
type size_t is mod 2 ** Standard'Address_Size; type size_t is mod 2 ** Standard'Address_Size;
...@@ -154,8 +155,7 @@ package System.OS_Interface is ...@@ -154,8 +155,7 @@ package System.OS_Interface is
pragma Inline (kill); pragma Inline (kill);
function getpid return t_id; function getpid return t_id;
pragma Import (C, getpid, "taskIdSelf"); pragma Inline (getpid);
-- VxWorks doesn't have getpid; taskIdSelf is the equivalent routine.
---------- ----------
-- Time -- -- Time --
...@@ -218,6 +218,9 @@ package System.OS_Interface is ...@@ -218,6 +218,9 @@ package System.OS_Interface is
function taskIdSelf return t_id; function taskIdSelf return t_id;
pragma Import (C, taskIdSelf, "taskIdSelf"); pragma Import (C, taskIdSelf, "taskIdSelf");
function taskOptionsGet (tid : t_id; pOptions : access int) return int;
pragma Import (C, taskOptionsGet, "taskOptionsGet");
function taskSuspend (tid : t_id) return int; function taskSuspend (tid : t_id) return int;
pragma Import (C, taskSuspend, "taskSuspend"); pragma Import (C, taskSuspend, "taskSuspend");
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2001-2005 Free Software Foundation, Inc. -- -- Copyright (C) 2001-2006 Free Software Foundation, Inc. --
-- -- -- --
-- GNARL is free software; you can redistribute it and/or modify it under -- -- GNARL 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -102,7 +102,7 @@ private ...@@ -102,7 +102,7 @@ private
-- use lock on those operations and the only thing we have to -- use lock on those operations and the only thing we have to
-- make sure is that they are updated in atomic fashion. -- make sure is that they are updated in atomic fashion.
LWP : aliased System.Address; LWP : aliased System.OS_Interface.t_id := 0;
-- The purpose of this field is to provide a better tasking support on -- The purpose of this field is to provide a better tasking support on
-- gdb. The order of the two first fields (Thread and LWP) is important. -- gdb. The order of the two first fields (Thread and LWP) is important.
-- On targets where lwp is not relevant, this is equivalent to Thread. -- On targets where lwp is not relevant, this is equivalent to Thread.
......
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