diff options
Diffstat (limited to 'Cryptlib/OpenSSL/crypto/async/arch')
-rw-r--r-- | Cryptlib/OpenSSL/crypto/async/arch/async_null.c | 23 | ||||
-rw-r--r-- | Cryptlib/OpenSSL/crypto/async/arch/async_null.h | 30 | ||||
-rw-r--r-- | Cryptlib/OpenSSL/crypto/async/arch/async_posix.c | 58 | ||||
-rw-r--r-- | Cryptlib/OpenSSL/crypto/async/arch/async_posix.h | 58 | ||||
-rw-r--r-- | Cryptlib/OpenSSL/crypto/async/arch/async_win.c | 55 | ||||
-rw-r--r-- | Cryptlib/OpenSSL/crypto/async/arch/async_win.h | 36 |
6 files changed, 0 insertions, 260 deletions
diff --git a/Cryptlib/OpenSSL/crypto/async/arch/async_null.c b/Cryptlib/OpenSSL/crypto/async/arch/async_null.c deleted file mode 100644 index 3eaf170f..00000000 --- a/Cryptlib/OpenSSL/crypto/async/arch/async_null.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -/* This must be the first #include file */ -#include "../async_locl.h" - -#ifdef ASYNC_NULL -int ASYNC_is_capable(void) -{ - return 0; -} - -void async_local_cleanup(void) -{ -} -#endif - diff --git a/Cryptlib/OpenSSL/crypto/async/arch/async_null.h b/Cryptlib/OpenSSL/crypto/async/arch/async_null.h deleted file mode 100644 index aef40b5d..00000000 --- a/Cryptlib/OpenSSL/crypto/async/arch/async_null.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -#include <openssl/async.h> - -/* - * If we haven't managed to detect any other async architecture then we default - * to NULL. - */ -#ifndef ASYNC_ARCH -# define ASYNC_NULL -# define ASYNC_ARCH - -typedef struct async_fibre_st { - int dummy; -} async_fibre; - - -# define async_fibre_swapcontext(o,n,r) 0 -# define async_fibre_makecontext(c) 0 -# define async_fibre_free(f) -# define async_fibre_init_dispatcher(f) - -#endif diff --git a/Cryptlib/OpenSSL/crypto/async/arch/async_posix.c b/Cryptlib/OpenSSL/crypto/async/arch/async_posix.c deleted file mode 100644 index 02c342d3..00000000 --- a/Cryptlib/OpenSSL/crypto/async/arch/async_posix.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -/* This must be the first #include file */ -#include "../async_locl.h" - -#ifdef ASYNC_POSIX - -# include <stddef.h> -# include <unistd.h> - -#define STACKSIZE 32768 - -int ASYNC_is_capable(void) -{ - ucontext_t ctx; - - /* - * Some platforms provide getcontext() but it does not work (notably - * MacOSX PPC64). Check for a working getcontext(); - */ - return getcontext(&ctx) == 0; -} - -void async_local_cleanup(void) -{ -} - -int async_fibre_makecontext(async_fibre *fibre) -{ - fibre->env_init = 0; - if (getcontext(&fibre->fibre) == 0) { - fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE); - if (fibre->fibre.uc_stack.ss_sp != NULL) { - fibre->fibre.uc_stack.ss_size = STACKSIZE; - fibre->fibre.uc_link = NULL; - makecontext(&fibre->fibre, async_start_func, 0); - return 1; - } - } else { - fibre->fibre.uc_stack.ss_sp = NULL; - } - return 0; -} - -void async_fibre_free(async_fibre *fibre) -{ - OPENSSL_free(fibre->fibre.uc_stack.ss_sp); - fibre->fibre.uc_stack.ss_sp = NULL; -} - -#endif diff --git a/Cryptlib/OpenSSL/crypto/async/arch/async_posix.h b/Cryptlib/OpenSSL/crypto/async/arch/async_posix.h deleted file mode 100644 index 3c61f7f7..00000000 --- a/Cryptlib/OpenSSL/crypto/async/arch/async_posix.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -#ifndef OPENSSL_ASYNC_ARCH_ASYNC_POSIX_H -#define OPENSSL_ASYNC_ARCH_ASYNC_POSIX_H -#include <openssl/e_os2.h> - -#if (defined(OPENSSL_SYS_UNIX) || defined(OPENSSL_SYS_CYGWIN)) \ - && defined(OPENSSL_THREADS) && !defined(OPENSSL_NO_ASYNC) \ - && !defined(__ANDROID__) && !defined(__OpenBSD__) - -# include <unistd.h> - -# if _POSIX_VERSION >= 200112L - -# include <pthread.h> - -# define ASYNC_POSIX -# define ASYNC_ARCH - -# include <ucontext.h> -# include <setjmp.h> -# include "e_os.h" - -typedef struct async_fibre_st { - ucontext_t fibre; - jmp_buf env; - int env_init; -} async_fibre; - -static ossl_inline int async_fibre_swapcontext(async_fibre *o, async_fibre *n, int r) -{ - o->env_init = 1; - - if (!r || !_setjmp(o->env)) { - if (n->env_init) - _longjmp(n->env, 1); - else - setcontext(&n->fibre); - } - - return 1; -} - -# define async_fibre_init_dispatcher(d) - -int async_fibre_makecontext(async_fibre *fibre); -void async_fibre_free(async_fibre *fibre); - -# endif -#endif -#endif /* OPENSSL_ASYNC_ARCH_ASYNC_POSIX_H */ diff --git a/Cryptlib/OpenSSL/crypto/async/arch/async_win.c b/Cryptlib/OpenSSL/crypto/async/arch/async_win.c deleted file mode 100644 index 077d56ce..00000000 --- a/Cryptlib/OpenSSL/crypto/async/arch/async_win.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -/* This must be the first #include file */ -#include "../async_locl.h" - -#ifdef ASYNC_WIN - -# include <windows.h> -# include "internal/cryptlib.h" - -int ASYNC_is_capable(void) -{ - return 1; -} - -void async_local_cleanup(void) -{ - async_ctx *ctx = async_get_ctx(); - if (ctx != NULL) { - async_fibre *fibre = &ctx->dispatcher; - if (fibre != NULL && fibre->fibre != NULL && fibre->converted) { - ConvertFiberToThread(); - fibre->fibre = NULL; - } - } -} - -int async_fibre_init_dispatcher(async_fibre *fibre) -{ - fibre->fibre = ConvertThreadToFiber(NULL); - if (fibre->fibre == NULL) { - fibre->converted = 0; - fibre->fibre = GetCurrentFiber(); - if (fibre->fibre == NULL) - return 0; - } else { - fibre->converted = 1; - } - - return 1; -} - -VOID CALLBACK async_start_func_win(PVOID unused) -{ - async_start_func(); -} - -#endif diff --git a/Cryptlib/OpenSSL/crypto/async/arch/async_win.h b/Cryptlib/OpenSSL/crypto/async/arch/async_win.h deleted file mode 100644 index 61cfdd72..00000000 --- a/Cryptlib/OpenSSL/crypto/async/arch/async_win.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -/* - * This is the same detection used in cryptlib to set up the thread local - * storage that we depend on, so just copy that - */ -#if defined(_WIN32) && !defined(OPENSSL_NO_ASYNC) -#include <openssl/async.h> -# define ASYNC_WIN -# define ASYNC_ARCH - -# include <windows.h> -# include "internal/cryptlib.h" - -typedef struct async_fibre_st { - LPVOID fibre; - int converted; -} async_fibre; - -# define async_fibre_swapcontext(o,n,r) \ - (SwitchToFiber((n)->fibre), 1) -# define async_fibre_makecontext(c) \ - ((c)->fibre = CreateFiber(0, async_start_func_win, 0)) -# define async_fibre_free(f) (DeleteFiber((f)->fibre)) - -int async_fibre_init_dispatcher(async_fibre *fibre); -VOID CALLBACK async_start_func_win(PVOID unused); - -#endif |