summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPeter Lieven <pl@kamp.de>2016-09-27 11:58:42 +0200
committerKevin Wolf <kwolf@redhat.com>2016-09-29 14:13:39 +0200
commit8adcd6fb6d14ff7fbb47179384dcddbd6dfd95a3 (patch)
tree247facc597439a6273b23ad0f7dd39fdcca3778c
parentbe87a393f9aed6f9406a728d4d55199aee0ebbb4 (diff)
downloadfocaccia-qemu-8adcd6fb6d14ff7fbb47179384dcddbd6dfd95a3.tar.gz
focaccia-qemu-8adcd6fb6d14ff7fbb47179384dcddbd6dfd95a3.zip
coroutine: add a macro for the coroutine stack size
Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--include/qemu/coroutine_int.h2
-rw-r--r--util/coroutine-sigaltstack.c2
-rw-r--r--util/coroutine-ucontext.c2
-rw-r--r--util/coroutine-win32.c2
4 files changed, 5 insertions, 3 deletions
diff --git a/include/qemu/coroutine_int.h b/include/qemu/coroutine_int.h
index 6df9d33352..14d4f1d1f2 100644
--- a/include/qemu/coroutine_int.h
+++ b/include/qemu/coroutine_int.h
@@ -28,6 +28,8 @@
 #include "qemu/queue.h"
 #include "qemu/coroutine.h"
 
+#define COROUTINE_STACK_SIZE (1 << 20)
+
 typedef enum {
     COROUTINE_YIELD = 1,
     COROUTINE_TERMINATE = 2,
diff --git a/util/coroutine-sigaltstack.c b/util/coroutine-sigaltstack.c
index 171cd44b7f..a5bcb7e19e 100644
--- a/util/coroutine-sigaltstack.c
+++ b/util/coroutine-sigaltstack.c
@@ -143,7 +143,7 @@ static void coroutine_trampoline(int signal)
 
 Coroutine *qemu_coroutine_new(void)
 {
-    const size_t stack_size = 1 << 20;
+    const size_t stack_size = COROUTINE_STACK_SIZE;
     CoroutineSigAltStack *co;
     CoroutineThreadState *coTS;
     struct sigaction sa;
diff --git a/util/coroutine-ucontext.c b/util/coroutine-ucontext.c
index 2bb7e10d4b..31254abd4c 100644
--- a/util/coroutine-ucontext.c
+++ b/util/coroutine-ucontext.c
@@ -82,7 +82,7 @@ static void coroutine_trampoline(int i0, int i1)
 
 Coroutine *qemu_coroutine_new(void)
 {
-    const size_t stack_size = 1 << 20;
+    const size_t stack_size = COROUTINE_STACK_SIZE;
     CoroutineUContext *co;
     ucontext_t old_uc, uc;
     sigjmp_buf old_env;
diff --git a/util/coroutine-win32.c b/util/coroutine-win32.c
index 02e28e825f..de6bd4fd3e 100644
--- a/util/coroutine-win32.c
+++ b/util/coroutine-win32.c
@@ -71,7 +71,7 @@ static void CALLBACK coroutine_trampoline(void *co_)
 
 Coroutine *qemu_coroutine_new(void)
 {
-    const size_t stack_size = 1 << 20;
+    const size_t stack_size = COROUTINE_STACK_SIZE;
     CoroutineWin32 *co;
 
     co = g_malloc0(sizeof(*co));