VirtualBox

source: vbox/trunk/src/libs/openssl-3.0.3/crypto/async/async_local.h@ 96662

Last change on this file since 96662 was 94082, checked in by vboxsync, 3 years ago

libs/openssl-3.0.1: started applying and adjusting our OpenSSL changes to 3.0.1. bugref:10128

File size: 1.9 KB
Line 
1/*
2 * Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10/*
11 * Must do this before including any header files, because on MacOS/X <stlib.h>
12 * includes <signal.h> which includes <ucontext.h>
13 */
14#if defined(__APPLE__) && defined(__MACH__) && !defined(_XOPEN_SOURCE)
15# define _XOPEN_SOURCE /* Otherwise incomplete ucontext_t structure */
16# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
17#endif
18
19#if defined(_WIN32)
20# ifdef VBOX
21# include <iprt/win/windows.h>
22# else
23# include <windows.h>
24# endif
25#endif
26
27#include "crypto/async.h"
28#include <openssl/crypto.h>
29
30typedef struct async_ctx_st async_ctx;
31typedef struct async_pool_st async_pool;
32
33#include "arch/async_win.h"
34#include "arch/async_posix.h"
35#include "arch/async_null.h"
36
37struct async_ctx_st {
38 async_fibre dispatcher;
39 ASYNC_JOB *currjob;
40 unsigned int blocked;
41};
42
43struct async_job_st {
44 async_fibre fibrectx;
45 int (*func) (void *);
46 void *funcargs;
47 int ret;
48 int status;
49 ASYNC_WAIT_CTX *waitctx;
50 OSSL_LIB_CTX *libctx;
51};
52
53struct fd_lookup_st {
54 const void *key;
55 OSSL_ASYNC_FD fd;
56 void *custom_data;
57 void (*cleanup)(ASYNC_WAIT_CTX *, const void *, OSSL_ASYNC_FD, void *);
58 int add;
59 int del;
60 struct fd_lookup_st *next;
61};
62
63struct async_wait_ctx_st {
64 struct fd_lookup_st *fds;
65 size_t numadd;
66 size_t numdel;
67 ASYNC_callback_fn callback;
68 void *callback_arg;
69 int status;
70};
71
72DEFINE_STACK_OF(ASYNC_JOB)
73
74struct async_pool_st {
75 STACK_OF(ASYNC_JOB) *jobs;
76 size_t curr_size;
77 size_t max_size;
78};
79
80void async_local_cleanup(void);
81void async_start_func(void);
82async_ctx *async_get_ctx(void);
83
84void async_wait_ctx_reset_counts(ASYNC_WAIT_CTX *ctx);
85
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette