summaryrefslogtreecommitdiffstats
path: root/libc/bionic
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2014-04-29 20:25:26 +0100
committerCalin Juravle <calin@google.com>2014-04-30 14:30:15 +0100
commitb743790ccabd9b0b93355ff693066478d10dae0d (patch)
tree7594a0cbcc9703fbd5ae9f7dcb48daaad1e2ff69 /libc/bionic
parenteab395e4a88ee8ca7eeb7b6b2d6dfde364afbfcc (diff)
downloadbionic-b743790ccabd9b0b93355ff693066478d10dae0d.zip
bionic-b743790ccabd9b0b93355ff693066478d10dae0d.tar.gz
bionic-b743790ccabd9b0b93355ff693066478d10dae0d.tar.bz2
Fix cpu_set_t
- extend CPU_SETSIZE for LP64 - fix CPU_(AND|OR|XOR) macros - fix CPU_OP_S macro - fix __sched_cpucount - tidy up the code Change-Id: I741afff4d0c473e8a1ee6b4141981dc24467e0d4
Diffstat (limited to 'libc/bionic')
-rw-r--r--libc/bionic/sched_cpucount.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/libc/bionic/sched_cpucount.c b/libc/bionic/sched_cpucount.c
index 9458dc8..2ea1d3f 100644
--- a/libc/bionic/sched_cpucount.c
+++ b/libc/bionic/sched_cpucount.c
@@ -28,13 +28,14 @@
#define _GNU_SOURCE 1
#include <sched.h>
-int __sched_cpucount(size_t setsize, cpu_set_t* set)
-{
- int nn = 0, nn_max = setsize / sizeof(__CPU_BITTYPE);
- int count = 0;
+int __sched_cpucount(size_t setsize, cpu_set_t* set) {
+ int nn = 0;
+ int nn_max = setsize / sizeof(__CPU_BITTYPE);
+ int count = 0;
- for ( ; nn < nn_max; nn++ )
- count += __builtin_popcount(set->__bits[nn]);
+ for ( ; nn < nn_max; nn++ ) {
+ count += __builtin_popcountl(set->__bits[nn]);
+ }
- return count;
+ return count;
}