summaryrefslogtreecommitdiffstats
path: root/gcc/ada/s-multip.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-11 07:14:08 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-11 07:14:08 +0000
commited8e5b8319e37114b39dd88e6ed9a4e51e8b894a (patch)
tree6ec3d69c3f4021f1aad41adf4ef0be271bd70e6e /gcc/ada/s-multip.adb
parent217f707ea34d07153cb8441be1af0b756224760f (diff)
downloadppe42-gcc-ed8e5b8319e37114b39dd88e6ed9a4e51e8b894a.tar.gz
ppe42-gcc-ed8e5b8319e37114b39dd88e6ed9a4e51e8b894a.zip
2010-10-11 Vincent Celier <celier@adacore.com>
* Makefile.rtl: Add s-multip. * adaint.c: New function __gnat_number_of_cpus, implemented for Linux, defaulting to 1 for other platforms. * adaint.h: New function __gnat_number_of_cpus. * impunit.adb (Non_Imp_File_Names_12): New file list for Ada 2012, with a single component "s-multip". * impunit.ads (Kind_Of_Unit): New enumerated value Ada_12_Unit for Ada 2012. * rtsfind.ads (RTU_Id): New enumerated value System_Multiprocessors * s-multip.ads, s-multip.adb: New Ada 2012 package. * sem_ch10.adb (Analyze_With_Clause): Check also Ada 2012 units. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165274 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-multip.adb')
-rw-r--r--gcc/ada/s-multip.adb44
1 files changed, 44 insertions, 0 deletions
diff --git a/gcc/ada/s-multip.adb b/gcc/ada/s-multip.adb
new file mode 100644
index 00000000000..ce6c9dcfa77
--- /dev/null
+++ b/gcc/ada/s-multip.adb
@@ -0,0 +1,44 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- S Y S T E M . M U L T I P R O C E S S O R S --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2010, Free Software Foundation, Inc. --
+-- --
+-- 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- --
+-- 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/>. --
+-- --
+------------------------------------------------------------------------------
+
+with Interfaces.C; use Interfaces.C;
+
+package body System.Multiprocessors is
+ function Gnat_Number_Of_CPUs return int;
+ pragma Import (C, Gnat_Number_Of_CPUs, "__gnat_number_of_cpus");
+
+ --------------------
+ -- Number_Of_CPUs --
+ --------------------
+
+ function Number_Of_CPUs return CPU is
+ begin
+ return CPU (Gnat_Number_Of_CPUs);
+ end Number_Of_CPUs;
+
+end System.Multiprocessors;
OpenPOWER on IntegriCloud