git: libc - Add quick version for the context management functions.

Matthew Dillon dillon at crater.dragonflybsd.org
Mon Dec 21 16:39:21 PST 2015


commit 819d0c163e3cb679c6376a5751ee9d195e1838e2
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Mon Dec 21 12:17:36 2015 -0800

    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.

Summary of changes:
 lib/libc/gen/Makefile.inc                      |   4 +-
 lib/libc/gen/makecontext_quick.3               | 216 +++++++++++++++++++++++++
 lib/libc/gen/ucontext.3                        |  14 +-
 lib/libc/gen/ucontext.c                        |  17 +-
 lib/libc/x86_64/Symbol.map                     |  10 +-
 lib/libc/x86_64/gen/Makefile.inc               |   1 +
 lib/libc/x86_64/gen/{mcontext.S => qcontext.S} | 176 +++++++++-----------
 lib/libc/x86_64/gen/quickcontext.c             | 117 ++++++++++++++
 sys/sys/ucontext.h                             |   7 +-
 9 files changed, 436 insertions(+), 126 deletions(-)
 create mode 100644 lib/libc/gen/makecontext_quick.3
 rename lib/libc/x86_64/gen/{mcontext.S => qcontext.S} (53%)
 create mode 100644 lib/libc/x86_64/gen/quickcontext.c

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/819d0c163e3cb679c6376a5751ee9d195e1838e2


-- 
DragonFly BSD source repository


More information about the Commits mailing list