libc - Add quick version for the context management functions.
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 21 Dec 2015 20:17:36 +0000 (12:17 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 22 Dec 2015 00:39:08 +0000 (16:39 -0800)
commit819d0c163e3cb679c6376a5751ee9d195e1838e2
tree76db84c5670930e4077423ba432baf06ddd09e37
parent63261abbc5bc59d5ff6f9015d352ce1782cd1dd7
libc - Add quick version for the context management functions.

* Add makecontext_quick(), setcontext_quick(), and swapcontext_quick().
  These functions work similarly to the non-quick versions but are designed
  for fast synchronous switching.  These functions do not mess with the
  signal mask or stack at all and do not save or restore scratch registers.

* These functions make no system calls.  Switching time can be as low as
  ~5 nanoseconds.

* These functions also provide optimizations for coroutine fall-through
  linkages.

* Note that the coroutine / start-function callback arguments are somewhat
  different.  Start functions are called back as cofunc(ucp, arg).  Var-args
  are not supported and the stack is minimally aligned and initialized.

* Remove the old internal set_mcontext() and get_mcontext() routines.
lib/libc/gen/Makefile.inc
lib/libc/gen/makecontext_quick.3 [new file with mode: 0644]
lib/libc/gen/ucontext.3
lib/libc/gen/ucontext.c
lib/libc/x86_64/Symbol.map
lib/libc/x86_64/gen/Makefile.inc
lib/libc/x86_64/gen/qcontext.S [moved from lib/libc/x86_64/gen/mcontext.S with 53% similarity]
lib/libc/x86_64/gen/quickcontext.c [new file with mode: 0644]
sys/sys/ucontext.h