diff options
author | Matias Elo <matias.elo@nokia.com> | 2018-02-19 17:16:20 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2018-02-26 19:06:08 +0300 |
commit | 92fd43fcb2e4d6c2cee5655ceb5a62a11f82817b (patch) | |
tree | f9755ca96af1e3fbb2c135f1f48f705303c3228a | |
parent | e4178458b1e93766fdad3de25d4694a976af8f23 (diff) |
linux-gen: pool: pool_t.base_addr offset has to be 64-bit
Enables using pools larger than UINT32_MAX.
Fixes: https://bugs.linaro.org/show_bug.cgi?id=3632
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r-- | platform/linux-generic/odp_pool.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 9e4ad1c74..687edb8f0 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -83,10 +83,10 @@ static inline pool_t *pool_from_buf(odp_buffer_t buf) static inline odp_buffer_hdr_t *buf_hdr_from_index(pool_t *pool, uint32_t buffer_idx) { - uint32_t block_offset; + uint64_t block_offset; odp_buffer_hdr_t *buf_hdr; - block_offset = buffer_idx * pool->block_size; + block_offset = buffer_idx * (uint64_t)pool->block_size; /* clang requires cast to uintptr_t */ buf_hdr = (odp_buffer_hdr_t *)(uintptr_t)&pool->base_addr[block_offset]; @@ -236,7 +236,7 @@ static pool_t *reserve_pool(void) static void init_buffers(pool_t *pool) { - uint32_t i; + uint64_t i; odp_buffer_hdr_t *buf_hdr; odp_packet_hdr_t *pkt_hdr; odp_shm_info_t shm_info; |