summaryrefslogtreecommitdiff
path: root/gcc/ada/s-osinte-mingw.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-14 08:44:02 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-14 08:44:02 +0000
commit89ce0207a2cbb8db3490005868cca90b94dc6e6e (patch)
treec0fcdfb991e1fa07e98bedeff17e18a4ec61598a /gcc/ada/s-osinte-mingw.ads
parent6925ea9f399f9d12d3de44754eec7d5af40e620c (diff)
downloadgcc-89ce0207a2cbb8db3490005868cca90b94dc6e6e.tar.gz
2007-08-14 Pascal Obry <obry@adacore.com>
* s-osinte-mingw.ads: Add support for Ada.Execution_Time on Windows. (SYSTEM_INFO): New record. (SetThreadIdealProcessor): New imported routine needed for supporting task_info pragma on Windows. * s-taprop-mingw.adb (Enter_Task): Check if CPU number given in task info can be applied to the current host. (Create_Task): Set the ideal processor if information is present. * s-tasinf-mingw.adb, s-tasinf-mingw.ads, a-exetim-mingw.adb, a-exetim-mingw.ads: New files. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127434 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-osinte-mingw.ads')
-rw-r--r--gcc/ada/s-osinte-mingw.ads34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/ada/s-osinte-mingw.ads b/gcc/ada/s-osinte-mingw.ads
index af5a8fc20c9..0fc713f774f 100644
--- a/gcc/ada/s-osinte-mingw.ads
+++ b/gcc/ada/s-osinte-mingw.ads
@@ -95,6 +95,25 @@ package System.OS_Interface is
NO_ERROR : constant := 0;
FUNC_ERR : constant := -1;
+ ------------------------
+ -- System Information --
+ ------------------------
+
+ type SYSTEM_INFO is record
+ dwOemId : DWORD;
+ dwPageSize : DWORD;
+ lpMinimumApplicationAddress : PVOID;
+ lpMaximumApplicationAddress : PVOID;
+ dwActiveProcessorMask : DWORD;
+ dwNumberOfProcessors : DWORD;
+ dwProcessorType : DWORD;
+ dwAllocationGranularity : DWORD;
+ dwReserved : DWORD;
+ end record;
+
+ procedure GetSystemInfo (SI : access SYSTEM_INFO);
+ pragma Import (Stdcall, GetSystemInfo, "GetSystemInfo");
+
-------------
-- Signals --
-------------
@@ -194,6 +213,14 @@ package System.OS_Interface is
procedure SwitchToThread;
pragma Import (Stdcall, SwitchToThread, "SwitchToThread");
+ function GetThreadTimes
+ (hThread : HANDLE;
+ lpCreationTime : access Long_Long_Integer;
+ lpExitTime : access Long_Long_Integer;
+ lpKernelTime : access Long_Long_Integer;
+ lpUserTime : access Long_Long_Integer) return BOOL;
+ pragma Import (Stdcall, GetThreadTimes, "GetThreadTimes");
+
-----------------------
-- Critical sections --
-----------------------
@@ -221,6 +248,8 @@ package System.OS_Interface is
-- Thread Creation, Activation, Suspension And Termination --
-------------------------------------------------------------
+ subtype ProcessorId is DWORD;
+
type PTHREAD_START_ROUTINE is access function
(pThreadParameter : PVOID) return DWORD;
pragma Convention (Stdcall, PTHREAD_START_ROUTINE);
@@ -329,6 +358,11 @@ package System.OS_Interface is
fAlertable : BOOL) return DWORD;
pragma Import (Stdcall, WaitForSingleObjectEx, "WaitForSingleObjectEx");
+ function SetThreadIdealProcessor
+ (hThread : HANDLE;
+ dwIdealProcessor : ProcessorId) return DWORD;
+ pragma Import (Stdcall, SetThreadIdealProcessor, "SetThreadIdealProcessor");
+
Wait_Infinite : constant := DWORD'Last;
WAIT_TIMEOUT : constant := 16#0000_0102#;
WAIT_FAILED : constant := 16#FFFF_FFFF#;