diff options
author | Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> | 2018-02-11 12:54:04 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2018-02-12 18:07:07 +0300 |
commit | cf3aaa01b620da6f2bc25df23ad2c129d650ea43 (patch) | |
tree | 17d7567ac4cec1d47ec0d912cd3a43d7866f9d0b /helper | |
parent | a0002111f4f41d8d292400257c2ccf2707659bb4 (diff) |
helper: adjust strong types to remove high bit truncation
Strong types interface was truncating 32 MSB on 64-bit platforms, which
is plain wrong. Prevent it from doing that by using uintptr_t
internally.
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'helper')
-rw-r--r-- | helper/include/odp/helper/strong_types.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/helper/include/odp/helper/strong_types.h b/helper/include/odp/helper/strong_types.h index 501d0f28f..f1acf6cc7 100644 --- a/helper/include/odp/helper/strong_types.h +++ b/helper/include/odp/helper/strong_types.h @@ -29,10 +29,10 @@ #endif /** Internal macro to get value of an ODP handle */ -#define _odph_typeval(handle) ((uint32_t)(uintptr_t)(handle)) +#define _odph_typeval(handle) ((uintptr_t)(handle)) /** Internal macro to get printable value of an ODP handle */ -#define _odph_pri(handle) ((uint64_t)_odph_typeval(handle)) +#define _odph_pri(handle) ((uint64_t)(uintptr_t)(handle)) /** Internal macro to convert a scalar to a typed handle */ #define _odph_cast_scalar(type, val) ((type)(uintptr_t)(val)) |