Atomically initialize parts of the 2LS (XCC)
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 27 Jan 2017 23:28:39 +0000 (18:28 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 9 Feb 2017 17:31:09 +0000 (12:31 -0500)
commitfd800e94260188123e4811b8f38fe3cf1f2c1044
tree9bcd21a7d51996d588f0e197051a704ac3917ab9
parent6b97652c91aba370c53a890b494657271ed835ea
Atomically initialize parts of the 2LS (XCC)

The issue is that certain parts of the 2LS must be changed atomically
with respect to syscalls, meaning no syscalls happen between the
operations.

For instance, if you change the syscall event handler, you need to switch
over to using the correct 2LS ops first.  Otherwise, the handler will go
crazy.

Likewise, we need to register for INDIRs, in case the 2LS uses INDIRs for
its syscall handling (all of them do).  Otherwise, you'd get the INDIR, but
that would get ignored (since there's no handler).

Finally, this fully removes thread0's syscall handler.  We actually had
always been running thread0's handler - the event handers chain.  It just
so happened to not be harmful.

Rebuild all apps and libraries, though maybe not glibc.  Specifically, I
needed to rebuild elfutils, since libelf.so has copies of parlib stuff in
it.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
tests/mcp_halt.c
tests/mhello.c
user/parlib/event.c
user/parlib/include/parlib/event.h
user/parlib/include/parlib/uthread.h
user/parlib/thread0_sched.c
user/parlib/uthread.c
user/pthread/pthread.c
user/vmm/sched.c