@@ -18,16 +18,25 @@
extern "C" {
#endif
+#include <odp/std_types.h>
+#include <odp/plat/strong_types.h>
+
/** @addtogroup odp_shared_memory ODP SHARED MEMORY
* Operations on shared memory.
* @{
*/
-typedef uint32_t odp_shm_t;
+typedef odp_handle_t odp_shm_t;
-#define ODP_SHM_INVALID 0
+#define ODP_SHM_INVALID _odp_cast_scalar(odp_shm_t, 0)
#define ODP_SHM_NULL ODP_SHM_INVALID
+/** Get printable format of odp_shm_t */
+static inline uint64_t odp_shm_to_u64(odp_shm_t hdl)
+{
+ return _odp_pri(hdl);
+}
+
/**
* @}
*/
@@ -64,13 +64,13 @@ static odp_shm_table_t *odp_shm_tbl;
static inline uint32_t from_handle(odp_shm_t shm)
{
- return shm - 1;
+ return _odp_typeval(shm) - 1;
}
static inline odp_shm_t to_handle(uint32_t index)
{
- return index + 1;
+ return _odp_cast_scalar(odp_shm_t, index + 1);
}
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> --- .../linux-generic/include/odp/plat/shared_memory_types.h | 13 +++++++++++-- platform/linux-generic/odp_shared_memory.c | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-)