Patchwork [v2,3/3] coroutine: adding configure option for sigaltstack coroutine backend

login
register
mail settings
Submitter Alex Barcelo
Date Feb. 28, 2012, 11:25 a.m.
Message ID <1330428351-6605-4-git-send-email-abarcelo@ac.upc.edu>
Download mbox | patch
Permalink /patch/143417/
State New
Headers show

Comments

Alex Barcelo - Feb. 28, 2012, 11:25 a.m.
It's possible to use sigaltstack backend with --with-coroutine=sigaltstack

v2: changed from enable/disable configure flags

Signed-off-by: Alex Barcelo <abarcelo@ac.upc.edu>
---
 Makefile.objs |    4 ++++
 configure     |    6 +++++-
 2 files changed, 9 insertions(+), 1 deletions(-)

Patch

diff --git a/Makefile.objs b/Makefile.objs
index 808de6a..9dcd226 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -17,8 +17,12 @@  coroutine-obj-y += qemu-coroutine-sleep.o
 ifeq ($(CONFIG_UCONTEXT_COROUTINE),y)
 coroutine-obj-$(CONFIG_POSIX) += coroutine-ucontext.o
 else
+ifeq ($(CONFIG_SIGALTSTACK_COROUTINE),y)
+coroutine-obj-$(CONFIG_POSIX) += coroutine-sigaltstack.o
+else
 coroutine-obj-$(CONFIG_POSIX) += coroutine-gthread.o
 endif
+endif
 coroutine-obj-$(CONFIG_WIN32) += coroutine-win32.o
 
 #######################################################################
diff --git a/configure b/configure
index 5a12c56..b473936 100755
--- a/configure
+++ b/configure
@@ -1099,7 +1099,7 @@  echo "  --enable-usb-redir       enable usb network redirection support"
 echo "  --disable-guest-agent    disable building of the QEMU Guest Agent"
 echo "  --enable-guest-agent     enable building of the QEMU Guest Agent"
 echo "  --with-coroutine=BACKEND coroutine backend. Supported options:"
-echo "                           gthread, ucontext, windows"
+echo "                           gthread, ucontext, sigaltstack, windows"
 echo ""
 echo "NOTE: The object files are built at the place where configure is launched"
 exit 1
@@ -2752,6 +2752,8 @@  elif test "$coroutine" = "gthread" ; then
   coroutine_backend=gthread
 elif test "$coroutine" = "windows" ; then
   coroutine_backend=windows
+elif test "$coroutine" = "sigaltstack" ; then
+  coroutine_backend=sigaltstack
 else
   echo
   echo "Error: unknown coroutine backend $coroutine"
@@ -3274,6 +3276,8 @@  fi
 
 if test "$coroutine_backend" = "ucontext" ; then
   echo "CONFIG_UCONTEXT_COROUTINE=y" >> $config_host_mak
+elif test "$coroutine_backend" = "sigaltstack" ; then
+  echo "CONFIG_SIGALTSTACK_COROUTINE=y" >> $config_host_mak
 fi
 
 if test "$open_by_handle_at" = "yes" ; then