Sched_getcpu should return vcoreid. (XCC)
authorDan Cross <crossd@gmail.com>
Thu, 18 Aug 2016 19:30:23 +0000 (15:30 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 18 Aug 2016 19:42:58 +0000 (15:42 -0400)
sched_getcpu implements a Unixy interface; to a first order
approximation, Unix would only know about what we would think
of as a 'vcore': Unix and Linux view the world as if they
provide a virtual layer around the *entire* computer, but
Akaros's MCP is not like that: it's a subset of the machine.

Anyway, hide the pcore ID from the legacy interface: if someone
wants to do something esoteric where they need to know the pcore
ID they can use parlib directly.

Change-Id: I9627c9c1d6b21282cd07b24b30c097f4d3726748
Signed-off-by: Dan Cross <crossd@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/sched_getcpu.c

index dbd27ff..26da57a 100644 (file)
 
 int sched_getcpu(void)
 {
-       int vcid;
-
-       vcid = vcore_id();
-       if (vcid == -1)
-               return -1;
-
-       return __procinfo.vcoremap[vcid].pcoreid;
+       return vcore_id();
 }