diff options
author | John David Anglin <dave.anglin@nrc-cnrc.gc.ca> | 2008-01-11 01:00:48 +0000 |
---|---|---|
committer | John David Anglin <danglin@gcc.gnu.org> | 2008-01-11 01:00:48 +0000 |
commit | 3fa87ef8fcb647c77882424daa96bf50b24b3213 (patch) | |
tree | 080e40fffc5ac22cb9862ce61a294008b6057687 | |
parent | 041313f88f98cfbe5dd58cfb23ec67865292e1a2 (diff) | |
download | gcc-3fa87ef8fcb647c77882424daa96bf50b24b3213.zip gcc-3fa87ef8fcb647c77882424daa96bf50b24b3213.tar.gz gcc-3fa87ef8fcb647c77882424daa96bf50b24b3213.tar.bz2 |
re PR ada/34466 (s-tasinf.ads:81:42: "cpu_set_t" not declared in "OS_Interface")
PR ada/34466
* s-osinte-linux-hppa.ads (SC_NPROCESSORS_ONLN): New constant for
sysconf call.
(bit_field): New packed boolean type used by cpu_set_t.
(cpu_set_t): New type corresponding to the C type with
the same name. Note that on the Ada side we use a bit
field array for the affinity mask. There is not need
for the C macro for setting individual bit.
(pthread_setaffinity_np): New imported routine.
From-SVN: r131457
-rw-r--r-- | gcc/ada/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/ada/s-osinte-linux-hppa.ads | 19 |
2 files changed, 31 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 6537c95..4dfdde6 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,15 @@ +2008-01-10 John David Anglin <dave.anglin.@nrc-cnrc.gc.ca> + + PR ada/34466 + * s-osinte-linux-hppa.ads (SC_NPROCESSORS_ONLN): New constant for + sysconf call. + (bit_field): New packed boolean type used by cpu_set_t. + (cpu_set_t): New type corresponding to the C type with + the same name. Note that on the Ada side we use a bit + field array for the affinity mask. There is not need + for the C macro for setting individual bit. + (pthread_setaffinity_np): New imported routine. + 2008-01-03 Tero Koskinen <tero.koskinen@iki.fi> PR ada/34647 diff --git a/gcc/ada/s-osinte-linux-hppa.ads b/gcc/ada/s-osinte-linux-hppa.ads index 00b79af..1c4386b 100644 --- a/gcc/ada/s-osinte-linux-hppa.ads +++ b/gcc/ada/s-osinte-linux-hppa.ads @@ -244,6 +244,7 @@ package System.OS_Interface is pragma Import (C, sysconf); SC_CLK_TCK : constant := 2; + SC_NPROCESSORS_ONLN : constant := 84; ------------------------- -- Priority Scheduling -- @@ -463,6 +464,24 @@ package System.OS_Interface is destructor : destructor_pointer) return int; pragma Import (C, pthread_key_create, "pthread_key_create"); + CPU_SETSIZE : constant := 1_024; + + type bit_field is array (1 .. CPU_SETSIZE) of Boolean; + for bit_field'Size use CPU_SETSIZE; + pragma Pack (bit_field); + pragma Convention (C, bit_field); + + type cpu_set_t is record + bits : bit_field; + end record; + pragma Convention (C, cpu_set_t); + + function pthread_setaffinity_np + (thread : pthread_t; + cpusetsize : size_t; + cpuset : access cpu_set_t) return int; + pragma Import (C, pthread_setaffinity_np, "__gnat_pthread_setaffinity_np"); + private type sigset_t is array (0 .. 31) of unsigned_long; |