API参考
载入中...
搜索中...
未找到
uio_abstraction.h
1/*
2 * This file is part of the openHiTLS project.
3 *
4 * openHiTLS is licensed under the Mulan PSL v2.
5 * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 * You may obtain a copy of Mulan PSL v2 at:
7 *
8 * http://license.coscl.org.cn/MulanPSL2
9 *
10 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13 * See the Mulan PSL v2 for more details.
14 */
15
16#ifndef UIO_ABSTRACTION_H
17#define UIO_ABSTRACTION_H
18
19#include "hitls_build.h"
20#ifdef HITLS_BSL_UIO_PLT
21
22#include <stdint.h>
23#include <stdbool.h>
24#include "uio_base.h"
25#include "sal_atomic.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#define IP_ADDR_V4_LEN 4
32#define IP_ADDR_V6_LEN 16
33#define IP_ADDR_MAX_LEN IP_ADDR_V6_LEN
34
35struct UIO_ControlBlock {
36 struct BSL_UIO_MethodStruct method;
37
38 uint32_t flags; // Read/write retry flag. For details, see BSL_UIO_FLAGS_* in bsl_uio.h
39 bool init; // Initialization flag. 1 means it's initialized, and 0 means it's not initialized.
40
41 int64_t writeNum; // count of write
42 int64_t readNum; // count of read
43
44 void *ctx; // Context
45 uint32_t ctxLen; // Context length
46
47 void *userData; // User data
48 BSL_UIO_USERDATA_FREE_FUNC userDataFreeFunc; // Release User Data
49
50 struct UIO_ControlBlock *prev; // Previous UIO object of the current UIO object in the UIO chain
51 struct UIO_ControlBlock *next; // Next UIO object of the current UIO object in the UIO chain
52
53 bool isUnderlyingClosedByUio; // Indicates whether related resources are released together with the UIO.
54 BSL_SAL_RefCount references; // reference count
55};
56
57typedef struct {
58 uint8_t *data;
59 uint64_t size;
60} BSL_UIO_CtrlGetInfoParam;
61
70bool UioIsNonFatalErr(int32_t err);
71
72#ifdef __cplusplus
73}
74#endif
75
76#endif /* HITLS_BSL_UIO_PLT */
77
78#endif // UIO_ABSTRACTION_H
79
void(* BSL_UIO_USERDATA_FREE_FUNC)(void *)
userData release function
定义 bsl_uio.h:86