|
1 | 1 | /* |
2 | 2 | * |
3 | | - * Copyright (C) 2023-2024 Intel Corporation |
| 3 | + * Copyright (C) 2023-2025 Intel Corporation |
4 | 4 | * |
5 | 5 | * Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. |
6 | 6 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
|
16 | 16 | extern "C" { |
17 | 17 | #endif |
18 | 18 |
|
| 19 | +/// @brief Version of the Memory Provider ops structure. |
| 20 | +/// NOTE: This is equal to the latest UMF version, in which the ops structure |
| 21 | +/// has been modified. |
| 22 | +#define UMF_PROVIDER_OPS_VERSION_CURRENT UMF_MAKE_VERSION(0, 11) |
| 23 | + |
19 | 24 | /// |
20 | 25 | /// @brief This structure comprises optional function pointers used |
21 | 26 | /// by corresponding umfMemoryProvider* calls. A memory provider implementation |
22 | 27 | /// can keep them NULL. |
23 | 28 | /// |
24 | | -typedef struct umf_memory_provider_ext_ops_t { |
| 29 | +typedef struct umf_memory_provider_ext_ops_0_11_t { |
25 | 30 | /// |
26 | 31 | /// @brief Discard physical pages within the virtual memory mapping associated at the given addr |
27 | 32 | /// and \p size. This call is asynchronous and may delay purging the pages indefinitely. |
@@ -78,13 +83,14 @@ typedef struct umf_memory_provider_ext_ops_t { |
78 | 83 | umf_result_t (*allocation_split)(void *hProvider, void *ptr, |
79 | 84 | size_t totalSize, size_t firstSize); |
80 | 85 |
|
81 | | -} umf_memory_provider_ext_ops_t; |
| 86 | +} umf_memory_provider_ext_ops_0_11_t; |
| 87 | +typedef umf_memory_provider_ext_ops_0_11_t umf_memory_provider_ext_ops_t; |
82 | 88 |
|
83 | 89 | /// |
84 | 90 | /// @brief This structure comprises optional IPC API. The API allows sharing of |
85 | 91 | /// memory objects across different processes. A memory provider implementation can keep them NULL. |
86 | 92 | /// |
87 | | -typedef struct umf_memory_provider_ipc_ops_t { |
| 93 | +typedef struct umf_memory_provider_ipc_ops_0_11_t { |
88 | 94 | /// |
89 | 95 | /// @brief Retrieve the size of opaque data structure required to store IPC data. |
90 | 96 | /// @param provider pointer to the memory provider. |
@@ -134,16 +140,17 @@ typedef struct umf_memory_provider_ipc_ops_t { |
134 | 140 | /// UMF_RESULT_ERROR_INVALID_ARGUMENT if invalid \p ptr is passed. |
135 | 141 | /// UMF_RESULT_ERROR_NOT_SUPPORTED if IPC functionality is not supported by this provider. |
136 | 142 | umf_result_t (*close_ipc_handle)(void *provider, void *ptr, size_t size); |
137 | | -} umf_memory_provider_ipc_ops_t; |
| 143 | +} umf_memory_provider_ipc_ops_0_11_t; |
| 144 | +typedef umf_memory_provider_ipc_ops_0_11_t umf_memory_provider_ipc_ops_t; |
138 | 145 |
|
139 | 146 | /// |
140 | 147 | /// @brief This structure comprises function pointers used by corresponding |
141 | 148 | /// umfMemoryProvider* calls. Each memory provider implementation should |
142 | 149 | /// initialize all function pointers. |
143 | 150 | /// |
144 | | -typedef struct umf_memory_provider_ops_t { |
| 151 | +typedef struct umf_memory_provider_ops_0_11_t { |
145 | 152 | /// Version of the ops structure. |
146 | | - /// Should be initialized using UMF_VERSION_CURRENT. |
| 153 | + /// Should be initialized using UMF_PROVIDER_OPS_VERSION_CURRENT. |
147 | 154 | uint32_t version; |
148 | 155 |
|
149 | 156 | /// |
@@ -245,7 +252,8 @@ typedef struct umf_memory_provider_ops_t { |
245 | 252 | /// @brief Optional IPC ops. The API allows sharing of memory objects across different processes. |
246 | 253 | /// |
247 | 254 | umf_memory_provider_ipc_ops_t ipc; |
248 | | -} umf_memory_provider_ops_t; |
| 255 | +} umf_memory_provider_ops_0_11_t; |
| 256 | +typedef umf_memory_provider_ops_0_11_t umf_memory_provider_ops_t; |
249 | 257 |
|
250 | 258 | #ifdef __cplusplus |
251 | 259 | } |
|
0 commit comments