diff options
author | Matt Caswell <matt@openssl.org> | 2015-10-06 11:25:16 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-11-20 23:34:35 +0000 |
commit | 636ca4ff64d0c512b5f9e01ddc644e5f7661849e (patch) | |
tree | f8ba43256b35baad448da9eb614b1bce384cabb0 /crypto/async/arch | |
parent | 134b28f883b0a24c625600b328f4c5750c849a24 (diff) |
Normalise ASYNC naming
Tidied up the naming of functions and structures to be consistent
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/async/arch')
-rw-r--r-- | crypto/async/arch/async_null.h | 15 | ||||
-rw-r--r-- | crypto/async/arch/async_posix.c | 8 | ||||
-rw-r--r-- | crypto/async/arch/async_posix.h | 24 | ||||
-rw-r--r-- | crypto/async/arch/async_win.c | 8 | ||||
-rw-r--r-- | crypto/async/arch/async_win.h | 20 |
5 files changed, 37 insertions, 38 deletions
diff --git a/crypto/async/arch/async_null.h b/crypto/async/arch/async_null.h index 796a13dd15..e9344f5874 100644 --- a/crypto/async/arch/async_null.h +++ b/crypto/async/arch/async_null.h @@ -63,15 +63,14 @@ typedef struct async_fibre_st { int dummy; -} ASYNC_FIBRE; +} async_fibre; - -# define ASYNC_set_ctx(nctx) 0 -# define ASYNC_get_ctx() ((ASYNC_CTX *)NULL) -# define ASYNC_FIBRE_swapcontext(o,n,r) 0 -# define ASYNC_FIBRE_makecontext(c) -# define ASYNC_FIBRE_free(f) -# define ASYNC_FIBRE_init_dispatcher(f) +# define async_set_ctx(nctx) 0 +# define async_get_ctx() ((async_ctx *)NULL) +# define async_fibre_swapcontext(o,n,r) 0 +# define async_fibre_makecontext(c) +# define async_fibre_free(f) +# define async_fibre_init_dispatcher(f) #endif diff --git a/crypto/async/arch/async_posix.c b/crypto/async/arch/async_posix.c index 4333c87f1d..b01e69a5f5 100644 --- a/crypto/async/arch/async_posix.c +++ b/crypto/async/arch/async_posix.c @@ -54,14 +54,14 @@ #include "../async_locl.h" #include <openssl/async.h> -#ifdef ASYNC_SYSV +#ifdef ASYNC_POSIX # include <stddef.h> # include <ucontext.h> # include <unistd.h> # include <openssl/crypto.h> # include <openssl/async.h> -__thread ASYNC_CTX *sysvctx; +__thread async_ctx *sysvctx; #define STACKSIZE 32768 @@ -69,7 +69,7 @@ __thread size_t pool_max_size = 0; __thread size_t pool_curr_size = 0; __thread STACK_OF(ASYNC_JOB) *pool = NULL; -int ASYNC_FIBRE_init(ASYNC_FIBRE *fibre) +int async_fibre_init(async_fibre *fibre) { void *stack = NULL; @@ -85,7 +85,7 @@ int ASYNC_FIBRE_init(ASYNC_FIBRE *fibre) return 1; } -void ASYNC_FIBRE_free(ASYNC_FIBRE *fibre) +void async_fibre_free(async_fibre *fibre) { if (fibre->fibre.uc_stack.ss_sp) OPENSSL_free(fibre->fibre.uc_stack.ss_sp); diff --git a/crypto/async/arch/async_posix.h b/crypto/async/arch/async_posix.h index 43cea6d9b0..650d918ed4 100644 --- a/crypto/async/arch/async_posix.h +++ b/crypto/async/arch/async_posix.h @@ -58,25 +58,25 @@ # if _POSIX_VERSION >= 200112L -# define ASYNC_SYSV +# define ASYNC_POSIX # define ASYNC_ARCH # include <ucontext.h> # include <setjmp.h> # include "e_os.h" -extern __thread ASYNC_CTX *sysvctx; +extern __thread async_ctx *sysvctx; typedef struct async_fibre_st { ucontext_t fibre; jmp_buf env; int env_init; -} ASYNC_FIBRE; +} async_fibre; -# define ASYNC_set_ctx(nctx) (sysvctx = (nctx)) -# define ASYNC_get_ctx() (sysvctx) +# define async_set_ctx(nctx) (sysvctx = (nctx)) +# define async_get_ctx() (sysvctx) -static inline int ASYNC_FIBRE_swapcontext(ASYNC_FIBRE *o, ASYNC_FIBRE *n, int r) +static inline int async_fibre_swapcontext(async_fibre *o, async_fibre *n, int r) { o->env_init = 1; @@ -90,14 +90,14 @@ static inline int ASYNC_FIBRE_swapcontext(ASYNC_FIBRE *o, ASYNC_FIBRE *n, int r) return 1; } -# define ASYNC_FIBRE_makecontext(c) \ - (ASYNC_FIBRE_init(c) \ +# define async_fibre_makecontext(c) \ + (async_fibre_init(c) \ && !getcontext(&(c)->fibre) \ - && (makecontext(&(c)->fibre, ASYNC_start_func, 0), 1)) -# define ASYNC_FIBRE_init_dispatcher(d) + && (makecontext(&(c)->fibre, async_start_func, 0), 1)) +# define async_fibre_init_dispatcher(d) -int ASYNC_FIBRE_init(ASYNC_FIBRE *fibre); -void ASYNC_FIBRE_free(ASYNC_FIBRE *fibre); +int async_fibre_init(async_fibre *fibre); +void async_fibre_free(async_fibre *fibre); # endif #endif diff --git a/crypto/async/arch/async_win.c b/crypto/async/arch/async_win.c index 2afa306bc0..5cb14ce986 100644 --- a/crypto/async/arch/async_win.c +++ b/crypto/async/arch/async_win.c @@ -64,9 +64,9 @@ struct winpool { size_t max_size; }; -void ASYNC_start_func(void); +void async_start_func(void); -int ASYNC_FIBRE_init_dispatcher(ASYNC_FIBRE *fibre) +int async_fibre_init_dispatcher(async_fibre *fibre) { LPVOID dispatcher; @@ -82,9 +82,9 @@ int ASYNC_FIBRE_init_dispatcher(ASYNC_FIBRE *fibre) return 1; } -VOID CALLBACK ASYNC_start_func_win(PVOID unused) +VOID CALLBACK async_start_func_win(PVOID unused) { - ASYNC_start_func(); + async_start_func(); } int async_pipe(int *pipefds) diff --git a/crypto/async/arch/async_win.h b/crypto/async/arch/async_win.h index 4ecaa02af6..42574a77bb 100644 --- a/crypto/async/arch/async_win.h +++ b/crypto/async/arch/async_win.h @@ -66,19 +66,19 @@ typedef struct async_fibre_st { LPVOID fibre; -} ASYNC_FIBRE; +} async_fibre; -# define ASYNC_set_ctx(nctx) \ +# define async_set_ctx(nctx) \ (CRYPTO_set_thread_local(CRYPTO_THREAD_LOCAL_ASYNC_CTX, (void *)(nctx))) -# define ASYNC_get_ctx() \ - ((ASYNC_CTX *)CRYPTO_get_thread_local(CRYPTO_THREAD_LOCAL_ASYNC_CTX)) -# define ASYNC_FIBRE_swapcontext(o,n,r) \ +# define async_get_ctx() \ + ((async_ctx *)CRYPTO_get_thread_local(CRYPTO_THREAD_LOCAL_ASYNC_CTX)) +# 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)) +# 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); +int async_fibre_init_dispatcher(async_fibre *fibre); +VOID CALLBACK async_start_func_win(PVOID unused); #endif |