1
1

add uintptr_t to prevent the possibility of a signed extension occuring

This commit was SVN r17456.
Этот коммит содержится в:
Donald Kerr 2008-02-14 19:16:34 +00:00
родитель 3ffe845187
Коммит 58bf7f5a1d
3 изменённых файлов: 14 добавлений и 10 удалений

Просмотреть файл

@ -92,7 +92,7 @@ static int udapl_reg_mr(void *reg_data, void *base, size_t size,
int rc;
region.for_va = base;
udapl_reg->lmr_triplet.virtual_address = (DAT_VADDR)base;
udapl_reg->lmr_triplet.virtual_address = (DAT_VADDR)(uintptr_t)base;
udapl_reg->lmr_triplet.segment_length = size;
udapl_reg->lmr = NULL;
@ -849,7 +849,8 @@ mca_btl_base_descriptor_t* mca_btl_udapl_alloc(
* that rdma can be used to transfer the fragment the
* triplet.segment_len will have to change.
*/
frag->triplet.virtual_address = (DAT_VADDR)frag->segment.seg_addr.pval;
frag->triplet.virtual_address =
(DAT_VADDR)(uintptr_t)frag->segment.seg_addr.pval;
frag->triplet.segment_length =
frag->segment.seg_len + sizeof(mca_btl_udapl_footer_t);
assert(frag->triplet.lmr_context ==
@ -956,7 +957,7 @@ mca_btl_base_descriptor_t* mca_btl_udapl_prepare_src(
frag->segment.seg_len = max_data;
frag->segment.seg_addr.pval = iov.iov_base;
frag->triplet.segment_length = max_data;
frag->triplet.virtual_address = (DAT_VADDR)iov.iov_base;
frag->triplet.virtual_address = (DAT_VADDR)(uintptr_t)iov.iov_base;
frag->triplet.lmr_context =
((mca_btl_udapl_reg_t*)registration)->lmr_triplet.lmr_context;
@ -1005,7 +1006,8 @@ mca_btl_base_descriptor_t* mca_btl_udapl_prepare_src(
frag->segment.seg_len = max_data + reserve;
frag->triplet.segment_length =
max_data + reserve + sizeof(mca_btl_udapl_footer_t);
frag->triplet.virtual_address = (DAT_VADDR)frag->segment.seg_addr.pval;
frag->triplet.virtual_address =
(DAT_VADDR)(uintptr_t)frag->segment.seg_addr.pval;
/* initialize base descriptor */
frag->base.des_src = &frag->segment;
@ -1149,7 +1151,7 @@ int mca_btl_udapl_put(
remote_buffer.rmr_context =
(DAT_RMR_CONTEXT)dst_segment->seg_key.key32[0];
remote_buffer.target_address =
(DAT_VADDR)dst_segment->seg_addr.lval;
(DAT_VADDR)(uintptr_t)dst_segment->seg_addr.lval;
remote_buffer.segment_length = dst_segment->seg_len;
cookie.as_ptr = frag;

Просмотреть файл

@ -869,7 +869,7 @@ int mca_btl_udapl_component_progress()
assert(frag->base.des_src_cnt == 0);
assert(frag->type == MCA_BTL_UDAPL_RECV);
assert(frag->triplet.virtual_address ==
(DAT_VADDR)frag->segment.seg_addr.pval);
(DAT_VADDR)(uintptr_t)frag->segment.seg_addr.pval);
assert(frag->triplet.segment_length == frag->size);
assert(frag->btl == btl);

Просмотреть файл

@ -127,7 +127,7 @@ int mca_btl_udapl_endpoint_write_eager(mca_btl_base_endpoint_t* endpoint,
/* establish remote memory region */
remote_buffer.rmr_context =
(DAT_RMR_CONTEXT)endpoint->endpoint_eager_rdma_remote.rkey;
remote_buffer.target_address = (DAT_VADDR)remote_buf;
remote_buffer.target_address = (DAT_VADDR)(uintptr_t)remote_buf;
remote_buffer.segment_length = frag->triplet.segment_length;
/* write the data out */
@ -773,7 +773,7 @@ static int mca_btl_udapl_endpoint_finish_max(mca_btl_udapl_endpoint_t* endpoint)
cookie.as_ptr = frag;
assert(frag->triplet.virtual_address ==
(DAT_VADDR)frag->segment.seg_addr.pval);
(DAT_VADDR)(uintptr_t)frag->segment.seg_addr.pval);
assert(frag->triplet.segment_length ==
frag->segment.seg_len + sizeof(mca_btl_udapl_footer_t));
assert(frag->size ==
@ -861,7 +861,8 @@ static int mca_btl_udapl_endpoint_post_recv(mca_btl_udapl_endpoint_t* endpoint,
assert(size == frag->size);
/* Set up the LMR triplet from the frag segment */
/* Note that this triplet defines a sub-region of a registered LMR */
frag->triplet.virtual_address = (DAT_VADDR)frag->segment.seg_addr.pval;
frag->triplet.virtual_address =
(DAT_VADDR)(uintptr_t)frag->segment.seg_addr.pval;
frag->triplet.segment_length = frag->size;
frag->btl = endpoint->endpoint_btl;
@ -1009,7 +1010,8 @@ static mca_btl_base_descriptor_t* mca_btl_udapl_endpoint_initialize_control_mess
/* Set up the LMR triplet from the frag segment */
frag->segment.seg_len = (uint32_t)size;
frag->triplet.virtual_address = (DAT_VADDR)frag->segment.seg_addr.pval;
frag->triplet.virtual_address =
(DAT_VADDR)(uintptr_t)frag->segment.seg_addr.pval;
/* assume send/recv as default when computing segment_length */
frag->triplet.segment_length =