Allow vcore_tick_* to be called from uthreads
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 5 Aug 2016 00:34:19 +0000 (17:34 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 10 Aug 2016 19:35:59 +0000 (15:35 -0400)
commitdbda22e8de423ced59e9d6014a3b1fcb728814af
tree3652f711b3d72f43edd066c934b7e5f534990934
parenta1919de537fbb72cab257ae9427d454f4affcd3e
Allow vcore_tick_* to be called from uthreads

Previously, they were designed for use from sched_entry(), and thus
vcore context.  There are cases where scheduler functions that aren't in
vcore context might want to mess with the *current vcore's* timer tick.

To do this, I had to stop using the TLS variable, and use a constructor
instead.  Otherwise, the uthread would use its own __vc_tick.  When a
uthread disabled notifs, it appears to be in vcore context to other
vcores and the kernel.  However, it is not actually in vcore context, at
least when it comes to TLS and stacks.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/benchutil/include/benchutil/vcore_tick.h
user/benchutil/vcore_tick.c