Major libcaps work to support userland threading. Stage 1/2.
Hook the system's upcall mechanism into the globaldata structure
and hook up the LWKT thread switching primitives. Integrate the
mp_lock code from DragonFly into libcaps to serve as a master lock
for userland threading as well (it turns out that the BGL support in
DragonFly could be trivially ported to the userland threading code).
Still todo: hook up critical section handling, deal with FP regs,
hook up rfork support for multiple virtual cpu's via the upcall mechanism,
and testing of same.
Work by: Galen Sampson <galen_sampson@yahoo.com> and
Matthew Dillon <dillon@backplane.com>