openssl3.1/openssl-alt-e2k-makecontext.patch

30 lines
973 B
Diff

diff --git a/openssl/crypto/async/arch/async_posix.c b/openssl/crypto/async/arch/async_posix.c
index 02c342d..a11f451 100644
--- a/crypto/async/arch/async_posix.c
+++ b/crypto/async/arch/async_posix.c
@@ -40,8 +40,15 @@ int async_fibre_makecontext(async_fibre *fibre)
if (fibre->fibre.uc_stack.ss_sp != NULL) {
fibre->fibre.uc_stack.ss_size = STACKSIZE;
fibre->fibre.uc_link = NULL;
+#ifndef __e2k__
makecontext(&fibre->fibre, async_start_func, 0);
return 1;
+#else
+ if (makecontext_e2k(&fibre->fibre, async_start_func, 0))
+ return 1;
+ else
+ return 0;
+#endif
}
} else {
fibre->fibre.uc_stack.ss_sp = NULL;
@@ -53,6 +60,9 @@ void async_fibre_free(async_fibre *fibre)
{
OPENSSL_free(fibre->fibre.uc_stack.ss_sp);
fibre->fibre.uc_stack.ss_sp = NULL;
+#ifdef __e2k__
+ freecontext_e2k(&fibre->fibre);
+#endif
}
#endif