diff options
author | Petri Savolainen <petri.savolainen@nokia.com> | 2022-10-26 13:52:58 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2022-11-30 12:43:46 +0200 |
commit | dea479ddd04ea7bfb565e2c97017f7c8571d98e7 (patch) | |
tree | e9c3f686ae6fa522c8d4e79578d930d752ce9172 /include | |
parent | b1c312eced6e45d542d98bba43cfb4f44a19140e (diff) |
api: shm: memory sharebility with no flags
Define odp_shm_reserve() operation with the default
options (no flags). Also, remove unnecessary promise of
odp_shm_info() call handling correctly any random SHM
handle value.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Harman Kalra <hkalra@marvell.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/odp/api/spec/shared_memory.h | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/include/odp/api/spec/shared_memory.h b/include/odp/api/spec/shared_memory.h index c1ca724c9..36b38782f 100644 --- a/include/odp/api/spec/shared_memory.h +++ b/include/odp/api/spec/shared_memory.h @@ -40,8 +40,6 @@ extern "C" { * Maximum shared memory block name length in chars including null char */ - /* Shared memory flags */ - /** * @def ODP_SHM_IOVA_INVALID * Invalid IOVA address @@ -217,22 +215,25 @@ int odp_shm_capability(odp_shm_capability_t *capa); * Reserve a contiguous block of shared memory * * Reserve a contiguous block of shared memory that fulfills size, alignment - * and shareability (ODP_SHM_* flags) requirements. In general, a name is - * optional and does not need to be unique. However, if the block will be + * and shareability (ODP_SHM_* flags) requirements. By default (without flags), the memory + * block can be shared between all threads of the ODP instance. Memory address (odp_shm_addr()) + * shareability depends on application memory model and #ODP_SHM_SINGLE_VA flag usage. + * + * Name is optional and does not need to be unique. However, if the block will be * searched with odp_shm_lookup() or odp_shm_import(), a unique name is needed * for correct match. * - * @param name Name of the block or NULL. Maximum string length is - * ODP_SHM_NAME_LEN. + * @param name Name of the block or NULL. Maximum string length is ODP_SHM_NAME_LEN. * @param size Block size in bytes * @param align Block alignment in bytes * @param flags Shared memory parameter flags (ODP_SHM_*). Default value is 0. * * @return Handle of the reserved block * @retval ODP_SHM_INVALID on failure + * + * @see odp_mem_model_t */ -odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, - uint32_t flags); +odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, uint32_t flags); /** * Free a contiguous block of shared memory @@ -293,9 +294,7 @@ void *odp_shm_addr(odp_shm_t shm); /** * Shared memory block info * - * Get information about the specified shared memory block. This is the only - * shared memory API function which accepts invalid shm handles (any bit value) - * without causing undefined behavior. + * Get information about the specified shared memory block. * * @param shm Block handle * @param[out] info Block info pointer for output |