aboutsummaryrefslogtreecommitdiff
path: root/include/odp/api
diff options
context:
space:
mode:
Diffstat (limited to 'include/odp/api')
-rw-r--r--include/odp/api/abi-default/dma.h20
-rw-r--r--include/odp/api/dma.h2
-rw-r--r--include/odp/api/spec/crypto.h4
-rw-r--r--include/odp/api/spec/crypto_types.h114
-rw-r--r--include/odp/api/spec/dma_types.h55
-rw-r--r--include/odp/api/spec/event.h38
-rw-r--r--include/odp/api/spec/init.h3
-rw-r--r--include/odp/api/spec/packet.h4
-rw-r--r--include/odp/api/spec/pool_types.h75
-rw-r--r--include/odp/api/spec/sync.h67
-rw-r--r--include/odp/api/spec/timer.h39
11 files changed, 340 insertions, 81 deletions
diff --git a/include/odp/api/abi-default/dma.h b/include/odp/api/abi-default/dma.h
new file mode 100644
index 000000000..e7e0ad970
--- /dev/null
+++ b/include/odp/api/abi-default/dma.h
@@ -0,0 +1,20 @@
+/* Copyright (c) 2023, Nokia
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef ODP_ABI_DMA_H_
+#define ODP_ABI_DMA_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Empty header required due to the inline functions */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/odp/api/dma.h b/include/odp/api/dma.h
index 4720f57c9..10e00a506 100644
--- a/include/odp/api/dma.h
+++ b/include/odp/api/dma.h
@@ -17,6 +17,8 @@
extern "C" {
#endif
+#include <odp/api/abi/dma.h>
+
#include <odp/api/spec/dma.h>
#ifdef __cplusplus
diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h
index 1c477336e..453eb9eeb 100644
--- a/include/odp/api/spec/crypto.h
+++ b/include/odp/api/spec/crypto.h
@@ -255,9 +255,7 @@ int odp_crypto_result(odp_crypto_packet_result_t *result,
* input packet to the output packet and then the crypto operation
* was applied to the output packet.
*
- * Crypto range and auth range of null cipher and auth algorithms are
- * ignored, i.e. not copied in the output packet. Auth range of (AEAD)
- * algorithms that ignore auth range is not copied.
+ * Auth range of (AEAD) algorithms that ignore auth range is not copied.
*
* The offset of the crypto range and auth range in the output packet is
* the same as in the input packet, adjusted by dst_offset_shift operation
diff --git a/include/odp/api/spec/crypto_types.h b/include/odp/api/spec/crypto_types.h
index 46d9ae3f7..6aa3f38a6 100644
--- a/include/odp/api/spec/crypto_types.h
+++ b/include/odp/api/spec/crypto_types.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2014-2018, Linaro Limited
- * Copyright (c) 2021-2022, Nokia
+ * Copyright (c) 2021-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -509,7 +509,7 @@ typedef struct odp_crypto_key {
*/
typedef enum odp_crypto_op_type_t {
/**
- * Input packet data and metadata are copied in the output packet
+ * Input packet data and metadata are copied to the output packet
* and then processed. Output packet is allocated by the caller
* or by ODP.
*
@@ -518,7 +518,7 @@ typedef enum odp_crypto_op_type_t {
ODP_CRYPTO_OP_TYPE_LEGACY,
/**
- * Input packet data and metadata are copied in the output packet
+ * Input packet data and metadata are copied to the output packet
* and then processed. Output packet is allocated by ODP.
*/
ODP_CRYPTO_OP_TYPE_BASIC,
@@ -560,6 +560,30 @@ typedef struct odp_crypto_session_param_t {
*/
odp_crypto_op_type_t op_type;
+ /** Cipher range unit
+ *
+ * When this flag is true, cipher range offset and length are in bits.
+ * Otherwise the offset and length are in bytes.
+ *
+ * If cipher capabilities do not include bit_mode, setting this to
+ * true causes a session creation failure.
+ *
+ * The default value is false.
+ */
+ odp_bool_t cipher_range_in_bits;
+
+ /** Auth range unit
+ *
+ * When this flag is true, auth range offset and length are in bits.
+ * Otherwise the offset and length are in bytes.
+ *
+ * If auth capabilities do not include bit_mode, setting this to
+ * true causes a session creation failure.
+ *
+ * The default value is false.
+ */
+ odp_bool_t auth_range_in_bits;
+
/** Authenticate cipher vs. plain text
*
* Controls ordering of authentication and cipher operations,
@@ -725,23 +749,41 @@ typedef struct odp_crypto_packet_op_param_t {
/** Data range to be ciphered.
*
+ * The range is given in bits or bytes as configured at session
+ * creation.
+ *
* Ignored by the null cipher with operation types other than
- * ODP_CRYPTO_OP_TYPE_OOP. Must be set to zero range (zero offset
- * and zero length) with the null cipher used with the out-of-place
- * operation type.
+ * ODP_CRYPTO_OP_TYPE_OOP.
+ *
+ * With the OOP operation type the cipher range is copied to the
+ * output packet even with the null cipher. Non-zero-length ranges
+ * are not necessarily supported with the null cipher and the OOP
+ * operation type. If the requested range is not supported, the
+ * crypto operation will fail. The failure is indicated through
+ * odp_crypto_result() or through a negative return value of
+ * odp_crypto_op()/odp_crypto_op_enq().
**/
odp_packet_data_range_t cipher_range;
/** Data range to be authenticated
*
+ * The range is given in bits or bytes as configured at session
+ * creation.
+ *
* The value is ignored with authenticated encryption algorithms,
* such as AES-GCM, which authenticate data in the cipher range
* and the AAD.
*
* Ignored by the null auth algorithm with operation types other than
- * ODP_CRYPTO_OP_TYPE_OOP. Must be set to zero range (zero offset
- * and zero length) with the null cipher used with the out-of-place
- * operation type.
+ * ODP_CRYPTO_OP_TYPE_OOP.
+ *
+ * With the OOP operation type the auth range is copied to the
+ * output packet even with the null auth algorithm. Non-zero-length
+ * ranges are not necessarily supported with the null algorithm and
+ * the OOP operation type. If the requested range is not supported,
+ * the crypto operation will fail. The failure is indicated through
+ * odp_crypto_result() or through a negative return value of
+ * odp_crypto_op()/odp_crypto_op_enq().
*
* As a special case AES-GMAC uses this field instead of aad_ptr
* for the data bytes to be authenticated.
@@ -937,22 +979,23 @@ typedef struct odp_crypto_cipher_capability_t {
/** IV length in bytes */
uint32_t iv_len;
- /** Cipher is operating in bitwise mode
+ /** Cipher supports bit mode
*
- * This cipher works on series of bits, rather than sequences of bytes:
- * cipher_range in odp_crypto_op_param_t and
- * odp_crypto_packet_op_param_t will use bits, rather than bytes.
+ * This cipher can work on a range of bits in addition to a range of
+ * bytes. When this capability is not present, only byte ranges are
+ * supported. The unit of cipher range is selected at session creation
+ * through the cipher_range_in_bits session parameter.
*
- * Note: data buffer MUST start on the byte boundary, using offset
- * which is not divisible by 8 is unsupported and will result in
- * unspecified behaviour.
+ * Note: In bit mode the cipher range must start on a byte boundary.
+ * Using an offset which is not divisible by 8 will result in
+ * undefined behaviour.
*
- * Note2: If the data length is not a multiple of 8, the remaining
- * bits of the data in the last byte of the input/output will be the
- * most significant bits, i.e. the most significant bit is considered
- * to be the first bit of a byte for the purpose of input and output
- * data range. The output bits that fall out of the output range are
- * undefined.
+ * Note2: If the range length in bit mode is not a multiple of 8,
+ * the remaining bits of the data in the last byte of the input/output
+ * will be the most significant bits, i.e. the most significant bit is
+ * considered to be the first bit of a byte for the purpose of input
+ * and output data range. The output bits that fall out of the output
+ * range are undefined.
*/
odp_bool_t bit_mode;
@@ -984,22 +1027,23 @@ typedef struct odp_crypto_auth_capability_t {
uint32_t inc;
} aad_len;
- /** Auth is operating in bitstring mode
+ /** Auth algorithm supports bit mode
*
- * This auth works on series of bits, rather than sequences of bytes:
- * auth_range in odp_crypto_op_param_t and
- * odp_crypto_packet_op_param_t will use bits, rather than bytes.
+ * This auth algorithm can work on a range of bits in addition to
+ * a range of bytes. When this capability is not present, only byte
+ * ranges are supported. The unit of auth range is selected at session
+ * creation through the auth_range_in_bits session parameter.
*
- * Note: data buffer MUST start on the byte boundary, using offset
- * which is not divisible by 8 is unsupported and will result in
- * unpredictable behaviour.
+ * Note: In bit mode the auth range must start on a byte boundary.
+ * Using an offset which is not divisible by 8 will result in
+ * undefined behaviour.
*
- * Note2: If the data length is not a multiple of 8, the remaining
- * bits of the data in the last byte of the input/output will be the
- * most significant bits, i.e. the most significant bit is considered
- * to be the first bit of a byte for the purpose of input and output
- * data range. The output bits that fall out of the output range are
- * undefined.
+ * Note2: If the range length in bit mode is not a multiple of 8,
+ * the remaining bits of the data in the last byte of the input/output
+ * will be the most significant bits, i.e. the most significant bit is
+ * considered to be the first bit of a byte for the purpose of input
+ * and output data range. The output bits that fall out of the output
+ * range are undefined.
*/
odp_bool_t bit_mode;
diff --git a/include/odp/api/spec/dma_types.h b/include/odp/api/spec/dma_types.h
index 26350e998..5e18faab2 100644
--- a/include/odp/api/spec/dma_types.h
+++ b/include/odp/api/spec/dma_types.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2021-2022, Nokia
+/* Copyright (c) 2021-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -80,6 +80,12 @@ typedef struct odp_dma_pool_capability_t {
/** Maximum user area size in bytes */
uint32_t max_uarea_size;
+ /** Pool user area persistence
+ *
+ * See buf.uarea_persistence of odp_pool_capability_t for details
+ * (odp_pool_capability_t::uarea_persistence). */
+ odp_bool_t uarea_persistence;
+
/** Minimum size of thread local cache */
uint32_t min_cache_size;
@@ -104,6 +110,19 @@ typedef struct odp_dma_pool_param_t {
*/
uint32_t uarea_size;
+ /** Parameters for user area initialization */
+ struct {
+ /** See uarea_init.init_fn of odp_pool_param_t for details
+ * (odp_pool_param_t::init_fn). Function is called during
+ * odp_dma_pool_create(). */
+ void (*init_fn)(void *uarea, uint32_t size, void *args, uint32_t index);
+
+ /** See uarea_init.args of odp_pool_param_t for details
+ * (odp_pool_param_t::args). */
+ void *args;
+
+ } uarea_init;
+
/** Maximum number of events cached locally per thread
*
* See odp_pool_param_t::cache_size documentation for details. Valid values range from
@@ -365,41 +384,39 @@ typedef struct odp_dma_param_t {
* DMA segment
*/
typedef struct odp_dma_seg_t {
- /** Segment start */
+ /** Segment start address or packet handle */
union {
/** Segment start address in memory
*
- * Defines segment start when data format is ODP_DMA_FORMAT_ADDR. Ignored with
+ * Defines segment start when data format is #ODP_DMA_FORMAT_ADDR. Ignored with
* other data formats.
*/
void *addr;
- /** Segment start as an offset into a packet */
- struct {
- /** Packet handle
- *
- * Defines the packet when data format is ODP_DMA_FORMAT_PACKET. Ignored
- * with other data formats. */
- odp_packet_t packet;
+ /** Packet handle
+ *
+ * Defines the packet when data format is #ODP_DMA_FORMAT_PACKET. Ignored
+ * with other data formats. */
+ odp_packet_t packet;
- /** Segment start offset into the packet
- *
- * Defines segment start when data format is ODP_DMA_FORMAT_PACKET.
- * The offset is calculated from odp_packet_data() position, and the value
- * must not exceed odp_packet_len().
- */
- uint32_t offset;
- };
};
/** Segment length in bytes
*
* Defines segment length with all data formats. The maximum value is defined by
- * max_seg_len capability. When data format is ODP_DMA_FORMAT_PACKET, the value must not
+ * max_seg_len capability. When data format is #ODP_DMA_FORMAT_PACKET, the value must not
* exceed odp_packet_len() - 'offset'.
*/
uint32_t len;
+ /** Segment start offset into the packet
+ *
+ * Defines segment start within the packet data. The offset is calculated from
+ * odp_packet_data() position, and the value must not exceed odp_packet_len().
+ * Ignored when data format is other than #ODP_DMA_FORMAT_PACKET.
+ */
+ uint32_t offset;
+
/** Segment hints
*
* Depending on the implementation, setting these hints may improve performance.
diff --git a/include/odp/api/spec/event.h b/include/odp/api/spec/event.h
index 9dc614329..65b5dd7ff 100644
--- a/include/odp/api/spec/event.h
+++ b/include/odp/api/spec/event.h
@@ -64,6 +64,22 @@ odp_event_type_t odp_event_types(odp_event_t event,
odp_event_subtype_t *subtype);
/**
+ * Event types and subtypes of multiple events
+ *
+ * Outputs the event types and subtypes (optional) of all given events into the
+ * output arrays. Application can pass NULL as 'subtype' parameter if subtype
+ * values are not required. The types are written in the same order as input
+ * events.
+ *
+ * @param event Array of event handles
+ * @param[out] type Event type array for output
+ * @param[out] subtype Event subtype array for output, or NULL
+ * @param num Number of events, event types, and optionally subtypes
+ */
+void odp_event_types_multi(const odp_event_t event[], odp_event_type_t type[],
+ odp_event_subtype_t subtype[], int num);
+
+/**
* Event type of multiple events
*
* Returns the number of first events in the array which have the same event
@@ -94,6 +110,28 @@ int odp_event_type_multi(const odp_event_t event[], int num,
void *odp_event_user_area(odp_event_t event);
/**
+ * Event user area and flag
+ *
+ * Returns pointer to the user area and outputs value of user flag associated
+ * with the event. The user area maps to the user area of underlying event type
+ * (e.g. odp_packet_user_area() for packets). If the event does not have user
+ * area, NULL is returned.
+ *
+ * The user flag maps to the user flag value of underlying event type (e.g.
+ * odp_packet_user_flag() for packets). If the event does not have user flag, a
+ * negative value is outputted.
+ *
+ * @param event Event handle
+ * @param[out] flag User flag value pointer for output. >0 if user flag is
+ * set, 0 if flags is not set, or <0 if event does not have
+ * user flag.
+ *
+ * @return Pointer to the user area of the event
+ * @retval NULL The event does not have user area
+ */
+void *odp_event_user_area_and_flag(odp_event_t event, int *flag);
+
+/**
* Filter and convert packet events
*
* Checks event type of all input events, converts all packet events and outputs
diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h
index c4f64d4fd..371222267 100644
--- a/include/odp/api/spec/init.h
+++ b/include/odp/api/spec/init.h
@@ -51,6 +51,9 @@ typedef enum {
/** Debug */
ODP_LOG_DBG,
+ /** Warning */
+ ODP_LOG_WARN,
+
/** Error */
ODP_LOG_ERR,
diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h
index 9f41edf1a..267bf819c 100644
--- a/include/odp/api/spec/packet.h
+++ b/include/odp/api/spec/packet.h
@@ -1502,7 +1502,7 @@ uint32_t odp_packet_user_area_size(odp_packet_t pkt);
* @param pkt Packet handle
*
* @retval 0 User flag is clear
- * @retval !0 User flag is set
+ * @retval >0 User flag is set
*/
int odp_packet_user_flag(odp_packet_t pkt);
@@ -2306,7 +2306,7 @@ void *odp_packet_vector_user_area(odp_packet_vector_t pktv);
* @param pktv Packet vector handle
*
* @retval 0 User flag is clear
- * @retval !0 User flag is set
+ * @retval >0 User flag is set
*/
int odp_packet_vector_user_flag(odp_packet_vector_t pktv);
diff --git a/include/odp/api/spec/pool_types.h b/include/odp/api/spec/pool_types.h
index cf1051a07..81974abc6 100644
--- a/include/odp/api/spec/pool_types.h
+++ b/include/odp/api/spec/pool_types.h
@@ -209,6 +209,19 @@ typedef struct odp_pool_capability_t {
/** Maximum user area size in bytes */
uint32_t max_uarea_size;
+ /** Pool user area persistence
+ *
+ * When supported, implementation does not overwrite buffer user area
+ * content at any point of buffer lifetime nor after freeing a buffer
+ * back into pool.
+ *
+ * 0: User area content is maintained throughout regular buffer usage
+ * after allocation, but may be modified after free (default)
+ * 1: User area content is maintained throughout regular buffer usage
+ * and additionally also after buffer is freed into the pool (between
+ * buffer free and allocation) */
+ odp_bool_t uarea_persistence;
+
/** Minimum size of thread local cache */
uint32_t min_cache_size;
@@ -288,6 +301,11 @@ typedef struct odp_pool_capability_t {
/** Maximum user area size in bytes */
uint32_t max_uarea_size;
+ /** Pool user area persistence
+ *
+ * See buf.uarea_persistence for details. */
+ odp_bool_t uarea_persistence;
+
/** Maximum number of subparameters
*
* Maximum number of packet pool subparameters. Valid range is
@@ -318,6 +336,11 @@ typedef struct odp_pool_capability_t {
/** Maximum user area size in bytes */
uint32_t max_uarea_size;
+ /** Pool user area persistence
+ *
+ * See buf.uarea_persistence for details. */
+ odp_bool_t uarea_persistence;
+
/** Minimum size of thread local cache */
uint32_t min_cache_size;
@@ -345,6 +368,11 @@ typedef struct odp_pool_capability_t {
/** Maximum user area size in bytes */
uint32_t max_uarea_size;
+ /** Pool user area persistence
+ *
+ * See buf.uarea_persistence for details. */
+ odp_bool_t uarea_persistence;
+
/** Minimum size of thread local cache */
uint32_t min_cache_size;
@@ -581,6 +609,30 @@ typedef struct odp_pool_param_t {
uint32_t cache_size;
} vector;
+ /** Parameters for user area initialization */
+ struct {
+ /** User area initialization function
+ *
+ * Application defined user area initialization function to be
+ * called for each event of the pool during odp_pool_create(). Ignored
+ * if user area persistence is not supported
+ * (odp_pool_capability_t::uarea_persistence) or pool will not have any
+ * user area. The default value is NULL.
+ *
+ * @param uarea Pointer to the user area of an event
+ * @param size User area size
+ * @param args Pointer to application defined arguments
+ * @param index Index of the event (0..num events in pool - 1), not
+ * necessarily in order
+ */
+ void (*init_fn)(void *uarea, uint32_t size, void *args, uint32_t index);
+
+ /** Pointer to application defined arguments to be passed to every call
+ * of init_fn. The default value is NULL.
+ */
+ void *args;
+ } uarea_init;
+
/**
* Configure statistics counters
*
@@ -713,6 +765,12 @@ typedef struct odp_pool_ext_capability_t {
/** Maximum user area size in bytes */
uint32_t max_uarea_size;
+ /** Pool user area persistence
+ *
+ * See buf.uarea_persistence of odp_pool_capability_t for details
+ * (odp_pool_capability_t::uarea_persistence). */
+ odp_bool_t uarea_persistence;
+
} pkt;
} odp_pool_ext_capability_t;
@@ -724,6 +782,23 @@ typedef struct odp_pool_ext_param_t {
/** Pool type */
odp_pool_type_t type;
+ /** Parameters for user area initialization */
+ struct {
+ /** See uarea_init.init_fn of odp_pool_param_t for details
+ * (odp_pool_param_t::init_fn). However, note that with external memory
+ * pools, this function is called during memory population and not during
+ * pool creation (odp_pool_ext_populate()). Depending on the implementation,
+ * the function may be called each time pool is being populated with
+ * odp_pool_ext_populate() or during the last population call
+ * (odp_pool_ext_populate() with #ODP_POOL_POPULATE_DONE). */
+ void (*init_fn)(void *uarea, uint32_t size, void *args, uint32_t index);
+
+ /** See uarea_init.args of odp_pool_param_t for details
+ * (odp_pool_param_t::args). */
+ void *args;
+
+ } uarea_init;
+
/** Maximum thread local cache size for the pool
*
* Valid value range is from min_cache_size to max_cache_size capability.
diff --git a/include/odp/api/spec/sync.h b/include/odp/api/spec/sync.h
index 0b75ffaee..18272af88 100644
--- a/include/odp/api/spec/sync.h
+++ b/include/odp/api/spec/sync.h
@@ -1,7 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2023 Nokia
*/
/**
@@ -23,15 +22,24 @@ extern "C" {
* @details
* <b> Memory barriers </b>
*
- * Memory barriers enforce ordering of memory load and store operations
- * specified before and after the barrier. These barriers may affect both
- * compiler optimizations and CPU out-of-order execution. All ODP
- * synchronization mechanisms (e.g. execution barriers, locks, queues, etc )
- * include all necessary memory barriers, so these calls are not needed when
- * using those. Also ODP atomic operations have memory ordered versions. These
- * explicit barriers may be needed when thread synchronization is based on
- * a non-ODP defined mechanism. Depending on the HW platform, heavy usage of
- * memory barriers may cause significant performance degradation.
+ * A memory barrier enforces the order between memory accesses (loads and/or stores)
+ * specified (in program order) before the barrier with those specified after the barrier.
+ * A barrier may affect both compiler optimizations and CPU out-of-order execution. Depending
+ * on the used HW platform and barrier types, heavy usage of barriers may cause significant
+ * performance degradation.
+ *
+ * An application may use these memory barrier functions e.g. to build a synchronization
+ * mechanism between its threads in shared memory, or when it accesses memory mapped registers
+ * of a device.
+ *
+ * An application does not need to use these memory barriers when using other ODP APIs for thread
+ * synchronization (execution barriers, spinlocks, etc.), or when exchanging data through ODP API
+ * mechanisms (queues, stashes, etc.). Those ODP calls include necessary (acquire and release)
+ * memory barriers to maintain coherency between data producers and consumers.
+ *
+ * Some ODP atomic operations include a memory barrier - see for example odp_atomic_load_acq_u32()
+ * or odp_atomic_store_rel_u32(). Application may use also those (non-relaxed) atomic operations
+ * to enforce memory ordering while using atomic variables.
*
* @{
*/
@@ -80,6 +88,39 @@ void odp_mb_acquire(void);
void odp_mb_full(void);
/**
+ * Memory barrier for load and store synchronization
+ *
+ * This memory barrier ensures that all memory accesses (loads and stores) specified before the
+ * barrier (in program order) are complete prior to any memory access specified after the barrier
+ * begins execution.
+ *
+ * This is a stronger barrier than odp_mb_full(), as in addition to visibility order also memory
+ * access completion is ensured. The barrier may be useful e.g. when synchronizing loads and stores
+ * into memory mapped registers of a device.
+ */
+void odp_mb_sync(void);
+
+/**
+ * Memory barrier for load synchronization
+ *
+ * This memory barrier ensures that all memory loads specified before the barrier (in program
+ * order) are complete prior to any memory load specified after the barrier begins execution.
+ *
+ * The barrier may be useful e.g. when synchronizing loads from memory mapped registers of a device.
+ */
+void odp_mb_sync_load(void);
+
+/**
+ * Memory synchronization barrier for stores
+ *
+ * This memory barrier ensures that all memory stores specified before the barrier (in program
+ * order) are complete prior to any memory store specified after the barrier begins execution.
+ *
+ * The barrier may be useful e.g. when synchronizing stores to memory mapped registers of a device.
+ */
+void odp_mb_sync_store(void);
+
+/**
* @}
*/
diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h
index bbb439692..a6ad6f2b3 100644
--- a/include/odp/api/spec/timer.h
+++ b/include/odp/api/spec/timer.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2019-2022, Nokia
+ * Copyright (c) 2019-2023, Nokia
*
* All rights reserved.
*
@@ -227,13 +227,20 @@ int odp_timer_pool_info(odp_timer_pool_t timer_pool,
/**
* Allocate a timer
*
- * Create a timer (allocating all necessary resources e.g. timeout event) from
- * the timer pool. The user_ptr is copied to timeouts and can be retrieved
- * using the odp_timeout_user_ptr() call.
+ * Allocates a timer from the timer pool. Depending on timer type, the allocated timer is started
+ * with either odp_timer_start() or odp_timer_periodic_start() call. A timer may be reused multiple
+ * times before freeing it back into the timer pool.
+ *
+ * When timer expires, the timeout event defined in timer start parameters (see
+ * odp_timer_start_t::tmo_ev or odp_timer_periodic_start_t::tmo_ev) is sent into the provided
+ * destination queue.
+ *
+ * The provided user pointer value is copied into timeout events when the event type is
+ * ODP_EVENT_TIMEOUT. The value can be retrieved from an event with odp_timeout_user_ptr() call.
*
* @param timer_pool Timer pool
- * @param queue Destination queue for timeout notifications
- * @param user_ptr User defined pointer or NULL to be copied to timeouts
+ * @param queue Destination queue for timeout events
+ * @param user_ptr User defined pointer value or NULL
*
* @return Timer handle on success
* @retval ODP_TIMER_INVALID on failure
@@ -286,9 +293,12 @@ int odp_timer_start(odp_timer_t timer, const odp_timer_start_t *start_param);
* Restart a timer
*
* A successful restart call updates the expiration time of an active timer. The timeout event
- * is not changed. The timer is not modified when a failure is returned. The call returns
- * ODP_TIMER_FAIL if the timer has expired already, or is so close to expire that it cannot be
- * restarted anymore.
+ * is not changed.
+ *
+ * The timer is not modified when a failure is returned. The call returns #ODP_TIMER_FAIL if
+ * the timer has expired already, or is so close to expire that it cannot be restarted anymore.
+ * A failure is returned also when the new expiration time is too near to the current time
+ * (#ODP_TIMER_TOO_NEAR) or too far from the current time (#ODP_TIMER_TOO_FAR).
*
* The new expiration time is passed the same way as with odp_timer_start() call.
*
@@ -478,6 +488,17 @@ int odp_timer_cancel(odp_timer_t timer, odp_event_t *tmo_ev);
odp_timeout_t odp_timeout_from_event(odp_event_t ev);
/**
+ * Convert multiple timeout events to timeout handles
+ *
+ * All events must be of type ODP_EVENT_TIMEOUT.
+ *
+ * @param[out] tmo Timeout handle array for output
+ * @param ev Array of event handles to convert
+ * @param num Number of timeouts and events
+ */
+void odp_timeout_from_event_multi(odp_timeout_t tmo[], const odp_event_t ev[], int num);
+
+/**
* Convert timeout handle to event handle
*
* @param tmo Timeout handle