[ofw] ***SPAM*** [PATCH] Enable warning C4826

Leonid Keller leonid at mellanox.co.il
Sun Jul 13 04:32:51 PDT 2008


Applied in 1392. Thank you. 

> -----Original Message-----
> From: ofw-bounces at lists.openfabrics.org 
> [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Fab Tillier
> Sent: Saturday, July 12, 2008 3:32 AM
> To: ofw at lists.openfabrics.org
> Subject: [ofw] ***SPAM*** [PATCH] Enable warning C4826
> 
> Warning C4826 warns you if you have signed pointer extension 
> when a 32-bit pointer is extended to 64-bits.  This patch 
> turns the warning on by default (for any users of complib), 
> and fixes all instances of problematic code.  It also 
> eradicates __ptr64 usage from the Qlogic VNIC driver.
> 
> Code affected:
> - IBAL
> - MTHCA
> - MLX4
> - QLGCVNIC
> 
> Note that I didn't change DAPL because it's licensed under 
> the CPL and not BSD. So someone else will have to fix that.  
> In fact, DAPL should probably just go back into the 
> SourceForge project rather than being duplicated everywhere.  
> Code in the WinOF SVN should be BSD only according to the 
> contributor's agreement.
> 
> Lastly, this patch concludes my patch series, so once they 
> are applied we'll be in sync.  Yay.
> 
> Signed-off-by: Fab Tillier <ftillier at microsoft.com>
> 
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: 
> old\core\al\kernel\al_ndi_cm.c trunk\core\al\kernel\al_ndi_cm.c
> --- old\core\al\kernel\al_ndi_cm.c      Wed Jul 09 09:44:26 2008
> +++ trunk\core\al\kernel\al_ndi_cm.c    Fri Jul 11 13:08:00 2008
> @@ -492,7 +492,7 @@ ndi_qp_init(
> 
>  AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_NDI,
>         ("Creating h_qp %#I64x, uhdl %#I64x \n",
> -       (uint64_t)h_qp, h_qp->obj.hdl ) );
> +       (uint64_t)(ULONG_PTR)h_qp, h_qp->obj.hdl ) );
> 
>  exit:
>         AL_EXIT( AL_DBG_NDI );
> @@ -513,7 +513,7 @@ ndi_qp_destroy(
>         {
>                 AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_NDI,
>                         ("Destroying h_qp %#I64x, uhdl 
> %#I64x, cid %d\n",
> -                       (uint64_t)h_qp, h_qp->obj.hdl, 
> ((al_conn_qp_t*)h_qp)->cid ) );
> +                       (uint64_t)(ULONG_PTR)h_qp, h_qp->obj.hdl, 
> + ((al_conn_qp_t*)h_qp)->cid ) );
> 
>                 /* Move the state before flushing, so that 
> all new IRPs fail to queue. */
>                 __ndi_acquire_lock( &h_qp->p_irp_queue->csq, 
> &irql ); @@ -526,7 +526,7 @@ ndi_qp_destroy(
>                 {
>                         AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_NDI,
>                                 ("h_qp %#I64x, uhdl %#I64x, 
> ref_cnt %d\n",
> -                               (uint64_t)h_qp, 
> h_qp->obj.hdl, h_qp->obj.ref_cnt ) );
> +                               (uint64_t)(ULONG_PTR)h_qp, 
> + h_qp->obj.hdl, h_qp->obj.ref_cnt ) );
> 
>                         __ndi_complete_cancelled_irp( 
> &h_qp->p_irp_queue->csq, Irp );
>                 }
> @@ -535,13 +535,13 @@ ndi_qp_destroy(
>                 {
>                         AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_NDI,
>                                 ("h_qp %#I64x, uhdl %#I64x, 
> ref_cnt %d\n",
> -                               (uint64_t)h_qp, 
> h_qp->obj.hdl, h_qp->obj.ref_cnt ) );
> +                               (uint64_t)(ULONG_PTR)h_qp, 
> + h_qp->obj.hdl, h_qp->obj.ref_cnt ) );
> 
>                         __ndi_complete_cancelled_irp( 
> &h_qp->p_irp_queue->csq, Irp );
>                 }
>                 AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_NDI,
>                         ("h_qp %#I64x, uhdl %#I64x, ref_cnt %d\n",
> -                       (uint64_t)h_qp, h_qp->obj.hdl, 
> h_qp->obj.ref_cnt ) );
> +                       (uint64_t)(ULONG_PTR)h_qp, h_qp->obj.hdl, 
> + h_qp->obj.ref_cnt ) );
>         }
> 
>         AL_EXIT( AL_DBG_NDI );
> @@ -652,7 +652,7 @@ __ndi_proc_rej(
> 
>         AL_PRINT(TRACE_LEVEL_ERROR, AL_DBG_ERROR,
>                 ("p_rej %p, h_qp %#I64x, uhdl %#I64x, connect 
> reject, reason=%hd\n",
> -               p_rej, (uint64_t)h_qp, h_qp->obj.hdl, 
> cl_ntoh16(p_rej->reason) ) );
> +               p_rej, (uint64_t)(ULONG_PTR)h_qp, h_qp->obj.hdl, 
> + cl_ntoh16(p_rej->reason) ) );
> 
>         p_irp = IoCsqRemoveNextIrp( &h_qp->p_irp_queue->csq, NULL );
>         __ndi_notify_dreq( h_qp );
> @@ -1185,7 +1185,7 @@ __ndi_pr_query(
>         {
>                 AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,
>                         ("STATUS_CONNECTION_ACTIVE: h_qp 
> %#I64x, uhdl %#I64x, ref_cnt %d\n",
> -                       (uint64_t)h_qp, h_qp->obj.hdl, 
> h_qp->obj.ref_cnt ) );
> +                       (uint64_t)(ULONG_PTR)h_qp, h_qp->obj.hdl, 
> + h_qp->obj.ref_cnt ) );
>                 return STATUS_CONNECTION_ACTIVE;
>         }
> 
> @@ -1596,7 +1596,7 @@ __ndi_send_dreq(
>         {
>                 AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,
>                         ("STATUS_CONNECTION_ACTIVE: h_qp 
> %#I64x, uhdl %#I64x, ref_cnt %d\n",
> -                       (uint64_t)h_qp, h_qp->obj.hdl, 
> h_qp->obj.ref_cnt ) );
> +                       (uint64_t)(ULONG_PTR)h_qp, h_qp->obj.hdl, 
> + h_qp->obj.ref_cnt ) );
>                 return STATUS_CONNECTION_INVALID;
>         }
> 
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: 
> old\hw\mlx4\kernel\bus\core\iobuf.c 
> trunk\hw\mlx4\kernel\bus\core\iobuf.c
> --- old\hw\mlx4\kernel\bus\core\iobuf.c Wed Jul 09 09:44:27 2008
> +++ trunk\hw\mlx4\kernel\bus\core\iobuf.c       Fri Jul 11 
> 14:36:24 2008
> @@ -2,12 +2,10 @@
>   * Copyright (c) 2004 Topspin Corporation.  All rights reserved.
>   * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
>   * Copyright (c) 2005 Mellanox Technologies.  All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation.  All 
> rights reserved.
>   *
> - * This software is available to you under a choice of one of two
> - * licenses.  You may choose to be licensed under the terms 
> of the GNU
> - * General Public License (GPL) Version 2, available from the file
> - * COPYING in the main directory of this source tree, or the
> - * OpenIB.org BSD license below:
> + * This software is available to you under the OpenIB.org BSD license
> + * below:
>   *
>   *     Redistribution and use in source and binary forms, with or
>   *     without modification, are permitted provided that the 
> following
> @@ -399,13 +397,13 @@ int iobuf_register_with_cash(
>                         }
> 
>                         // round the subregion size to the 
> page boundary
> -                       delta = (u64)(subregion_start + 
> subregion_size) & (PAGE_SIZE - 1);
> +                       delta = (ULONG_PTR)(subregion_start + 
> + subregion_size) & (PAGE_SIZE - 1);
>                         subregion_size -= delta;
>                         if (subregion_size > rdc)
>                                 subregion_size = rdc;
> 
>                         // register the subregion
> -                       rc = iobuf_register( 
> (u64)subregion_start, subregion_size, is_user, acc, &sec_iobuf);
> +                       rc = iobuf_register( 
> (ULONG_PTR)subregion_start, 
> + subregion_size, is_user, acc, &sec_iobuf);
>                         if (rc)
>                                 goto cleanup;
> 
> @@ -426,13 +424,13 @@ int iobuf_register_with_cash(
>         }
> 
>         // round the subregion size to the page boundary
> -       delta = (u64)(subregion_start + subregion_size) & 
> (PAGE_SIZE - 1);
> +       delta = (ULONG_PTR)(subregion_start + subregion_size) & 
> + (PAGE_SIZE - 1);
>         subregion_size -= delta;
>         if (subregion_size > rdc)
>                 subregion_size = rdc;
> 
>         // register the subregion
> -       rc = iobuf_register( (u64)subregion_start, 
> subregion_size, is_user, acc, &sec_iobuf);
> +       rc = iobuf_register( (ULONG_PTR)subregion_start, 
> subregion_size, 
> + is_user, acc, &sec_iobuf);
>         if (rc)
>                 goto cleanup;
> 
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: 
> old\hw\mlx4\kernel\hca\mr.c trunk\hw\mlx4\kernel\hca\mr.c
> --- old\hw\mlx4\kernel\hca\mr.c Fri Jul 11 13:07:06 2008
> +++ trunk\hw\mlx4\kernel\hca\mr.c       Fri Jul 11 14:36:16 2008
> @@ -84,8 +84,8 @@ mlnx_register_mr (
>         }
> 
>         // register mr
> -       p_ib_mr = ibv_reg_mr(p_ib_pd, 
> (u64)(ULONG_PTR)(void*)p_mr_create->vaddr,
> -               p_mr_create->length, (uint64_t)p_mr_create->vaddr,
> +       p_ib_mr = ibv_reg_mr(p_ib_pd, (ULONG_PTR)p_mr_create->vaddr,
> +               p_mr_create->length, (ULONG_PTR)p_mr_create->vaddr,
>                 to_qp_acl(p_mr_create->access_ctrl), um_call 
> ? &umv_buf : NULL );
>         if (IS_ERR(p_ib_mr)) {
>                 err = PTR_ERR(p_ib_mr);
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: 
> old\hw\mthca\kernel\hca_memory.c trunk\hw\mthca\kernel\hca_memory.c
> --- old\hw\mthca\kernel\hca_memory.c    Fri Jul 11 13:07:06 2008
> +++ trunk\hw\mthca\kernel\hca_memory.c  Fri Jul 11 14:05:05 2008
> @@ -89,7 +89,7 @@ mlnx_register_mr (
>         // register mr
>         mr_p = ibv_reg_mr(ib_pd_p, 
> map_qp_ibal_acl(p_mr_create->access_ctrl),
>                 p_mr_create->vaddr, p_mr_create->length,
> -               (uint64_t)p_mr_create->vaddr, um_call, TRUE );
> +               (ULONG_PTR)p_mr_create->vaddr, um_call, TRUE );
>         if (IS_ERR(mr_p)) {
>                 err = PTR_ERR(mr_p);
>                 HCA_PRINT(TRACE_LEVEL_ERROR, HCA_DBG_MEMORY, 
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: 
> old\hw\mthca\kernel\mt_memory.c trunk\hw\mthca\kernel\mt_memory.c
> --- old\hw\mthca\kernel\mt_memory.c     Thu Jun 26 20:35:14 2008
> +++ trunk\hw\mthca\kernel\mt_memory.c   Fri Jul 11 13:07:58 2008
> @@ -2,6 +2,7 @@
>   * Copyright (c) 2004 Topspin Corporation.  All rights reserved.
>   * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
>   * Copyright (c) 2005 Mellanox Technologies.  All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation.  All 
> rights reserved.
>   *
>   * This software is available to you under a choice of one of two
>   * licenses.  You may choose to be licensed under the terms 
> of the GNU @@ -604,13 +605,13 @@ int iobuf_register_with_cash(
>                         }
> 
>                         // round the subregion size to the 
> page boundary
> -                       delta = (u64)(subregion_start + 
> subregion_size) & (PAGE_SIZE - 1);
> +                       delta = (ULONG_PTR)(subregion_start + 
> + subregion_size) & (PAGE_SIZE - 1);
>                         subregion_size -= delta;
>                         if (subregion_size > rdc)
>                                 subregion_size = rdc;
> 
>                         // register the subregion
> -                       rc = iobuf_register( 
> (u64)subregion_start, subregion_size, is_user, acc, &sec_iobuf);
> +                       rc = iobuf_register( 
> (ULONG_PTR)subregion_start, 
> + subregion_size, is_user, acc, &sec_iobuf);
>                         if (rc)
>                                 goto cleanup;
> 
> @@ -631,13 +632,13 @@ int iobuf_register_with_cash(
>         }
> 
>         // round the subregion size to the page boundary
> -       delta = (u64)(subregion_start + subregion_size) & 
> (PAGE_SIZE - 1);
> +       delta = (ULONG_PTR)(subregion_start + subregion_size) & 
> + (PAGE_SIZE - 1);
>         subregion_size -= delta;
>         if (subregion_size > rdc)
>                 subregion_size = rdc;
> 
>         // register the subregion
> -       rc = iobuf_register( (u64)subregion_start, 
> subregion_size, is_user, acc, &sec_iobuf);
> +       rc = iobuf_register( (ULONG_PTR)subregion_start, 
> subregion_size, 
> + is_user, acc, &sec_iobuf);
>         if (rc)
>                 goto cleanup;
> 
> Only in old\hw\mthca\kernel: mthca_log.rc diff -up -r -X 
> trunk\docs\dontdiff.txt -I \$Id: 
> old\hw\mthca\kernel\mthca_provider.c 
> trunk\hw\mthca\kernel\mthca_provider.c
> --- old\hw\mthca\kernel\mthca_provider.c        Fri Jul 11 
> 13:07:06 2008
> +++ trunk\hw\mthca\kernel\mthca_provider.c      Fri Jul 11 
> 13:07:58 2008
> @@ -1029,9 +1029,9 @@ static struct ib_mr *mthca_reg_virt_mr(s
> 
>         // try register the buffer
>         iobuf_p = &mr->iobuf;
> -       iobuf_init( (u64)vaddr, length, um_call, iobuf_p);
> +       iobuf_init( (ULONG_PTR)vaddr, length, um_call, iobuf_p);
>         ib_acc = (acc & ~MTHCA_ACCESS_REMOTE_READ) ? 
> IB_AC_LOCAL_WRITE : 0;
> -       err =  iobuf_register_with_cash( (u64)vaddr, length, um_call,
> +       err =  iobuf_register_with_cash( (ULONG_PTR)vaddr, length, 
> + um_call,
>                 &ib_acc, iobuf_p );
>         if (err)
>                 goto err_reg_mem;
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: 
> old\hw\mthca\user\mlnx_uvp_qp.c trunk\hw\mthca\user\mlnx_uvp_qp.c
> --- old\hw\mthca\user\mlnx_uvp_qp.c     Thu Jun 26 20:35:15 2008
> +++ trunk\hw\mthca\user\mlnx_uvp_qp.c   Fri Jul 11 13:07:58 2008
> @@ -1,6 +1,7 @@
>  /*
>   * Copyright (c) 2005 Topspin Communications.  All rights reserved.
>   * Copyright (c) 2005 Mellanox Technologies Ltd.  All rights 
> reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation.  All 
> rights reserved.
>   *
>   * This software is available to you under a choice of one of two
>   * licenses.  You may choose to be licensed under the terms 
> of the GNU @@ -282,7 +283,7 @@ int mthca_tavor_post_send(struct ibv_qp
>                                 ((struct mthca_tavor_ud_seg 
> *) wqe)->lkey =
>                                         cl_hton32(ah->key);
>                                 ((struct mthca_tavor_ud_seg 
> *) wqe)->av_addr =
> -                                       cl_hton64((uint64_t)ah->av);
> +                                       cl_hton64((ULONG_PTR)ah->av);
>                                 ((struct mthca_tavor_ud_seg 
> *) wqe)->dqpn = wr->dgrm.ud.remote_qp;
>                                 ((struct mthca_tavor_ud_seg 
> *) wqe)->qkey = wr->dgrm.ud.remote_qkey;
> 
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: 
> old\inc\kernel\complib\cl_types_osd.h 
> trunk\inc\kernel\complib\cl_types_osd.h
> --- old\inc\kernel\complib\cl_types_osd.h       Thu Jun 26 
> 20:35:14 2008
> +++ trunk\inc\kernel\complib\cl_types_osd.h     Fri Jul 11 
> 13:07:58 2008
> @@ -1,5 +1,6 @@
>  /*
>   * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation.  All 
> rights reserved.
>   *
>   * This software is available to you under the OpenIB.org BSD license
>   * below:
> @@ -60,6 +61,11 @@ extern "C"
>   * handlers.
>   */
>  #pragma warning( disable:4232 )
> +
> +/*
> + * Enable warnings about pointer sign extension.
> + */
> +#pragma warning( default:4826 )
> 
>  /* For DECLSPEC_EXPORT and DECLSPEC_IMPORT */  #include 
> <ntdef.h> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: 
> old\inc\user\complib\cl_types_osd.h 
> trunk\inc\user\complib\cl_types_osd.h
> --- old\inc\user\complib\cl_types_osd.h Thu Jun 26 20:35:14 2008
> +++ trunk\inc\user\complib\cl_types_osd.h       Fri Jul 11 
> 13:07:58 2008
> @@ -1,5 +1,6 @@
>  /*
>   * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation.  All 
> rights reserved.
>   *
>   * This software is available to you under the OpenIB.org BSD license
>   * below:
> @@ -58,6 +59,11 @@
>         // Include the windows header file.
>         #include <windows.h>
>  #endif // !defined( _WINDOWS_ )
> +
> +/*
> + * Enable warnings about pointer sign extension.
> + */
> +#pragma warning( default:4826 )
> 
>  #if defined( _DEBUG ) || DBG
>         #define _DEBUG_
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: 
> old\ulp\qlgcvnic\kernel\vnic_adapter.c 
> trunk\ulp\qlgcvnic\kernel\vnic_adapter.c
> --- old\ulp\qlgcvnic\kernel\vnic_adapter.c      Thu Apr 24 
> 11:29:32 2008
> +++ trunk\ulp\qlgcvnic\kernel\vnic_adapter.c    Fri Jul 11 
> 14:15:22 2008
> @@ -1,5 +1,6 @@
>  /*
>   * Copyright (c) 2007 QLogic Corporation.  All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation.  All 
> rights reserved.
>   *
>   * This software is available to you under the OpenIB.org BSD license
>   * below:
> @@ -979,7 +980,7 @@ __vnic_pnp_cb(
>         vnic_adapter_t                  *p_primary_adapter;
>  #endif
> 
> -       vnic_adapter_t * __ptr64 p_adapter = (vnic_adapter_t 
> * __ptr64)p_pnp_rec->pnp_context;
> +       vnic_adapter_t * p_adapter = (vnic_adapter_t 
> + *)p_pnp_rec->pnp_context;
> 
>         VNIC_ENTER( VNIC_DBG_PNP );
> 
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: 
> old\ulp\qlgcvnic\kernel\vnic_control.c 
> trunk\ulp\qlgcvnic\kernel\vnic_control.c
> --- old\ulp\qlgcvnic\kernel\vnic_control.c      Thu Apr 24 
> 11:29:32 2008
> +++ trunk\ulp\qlgcvnic\kernel\vnic_control.c    Fri Jul 11 
> 14:31:20 2008
> @@ -1,5 +1,6 @@
>  /*
>   * Copyright (c) 2007 QLogic Corporation.  All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation.  All 
> rights reserved.
>   *
>   * This software is available to you under the OpenIB.org BSD license
>   * below:
> @@ -186,12 +187,12 @@ control_init(
>         pIo->wrq.p_next                 = NULL;
>         pIo->wrq.wr_type                = WR_SEND;
>         pIo->wrq.send_opt               = IB_SEND_OPT_SIGNALED;
> -       pIo->wrq.wr_id                  = (uint64_t)(pIo);
> +       pIo->wrq.wr_id                  = (ULONG_PTR)pIo;
>         pIo->wrq.num_ds                 = 1;
>         pIo->wrq.ds_array               = &pControl->sendIo.dsList;
>         pIo->wrq.ds_array[0].length     = 
> sizeof(Inic_ControlPacket_t);
>         pIo->wrq.ds_array[0].lkey  = pControl->region.lkey;
> -       pIo->wrq.ds_array[0].vaddr = (uint64_t)(pkt++);
> +       pIo->wrq.ds_array[0].vaddr = (ULONG_PTR)pkt++;
> 
>         for (i = 0; i < pConfig->numRecvs; i++ )
>         {
> @@ -199,12 +200,12 @@ control_init(
>                 pIo->pViport                    = pViport;
>                 pIo->pRoutine                   = 
> control_recvComplete;
> 
> -               pIo->r_wrq.wr_id                              
>   = (uint64_t)(pIo);
> +               pIo->r_wrq.wr_id                              
>   = (ULONG_PTR)pIo;
>                 pIo->r_wrq.p_next                             
>   = NULL;
>                 pIo->r_wrq.num_ds                               = 1;
>                 pIo->r_wrq.ds_array                           
>   = &pControl->pRecvIos[i].dsList;
>                 pIo->r_wrq.ds_array[0].length   = 
> sizeof(Inic_ControlPacket_t);
> -               pIo->r_wrq.ds_array[0].vaddr    = (uint64_t)(pkt++);
> +               pIo->r_wrq.ds_array[0].vaddr    = (ULONG_PTR)pkt++;
>                 pIo->r_wrq.ds_array[0].lkey             = 
> pControl->region.lkey;
> 
>                 if ( ibqp_postRecv( &pControl->qp, pIo ) != 
> IB_SUCCESS ) diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: 
> old\ulp\qlgcvnic\kernel\vnic_data.c 
> trunk\ulp\qlgcvnic\kernel\vnic_data.c
> --- old\ulp\qlgcvnic\kernel\vnic_data.c Wed Apr 30 10:31:34 2008
> +++ trunk\ulp\qlgcvnic\kernel\vnic_data.c       Fri Jul 11 
> 14:29:55 2008
> @@ -1,5 +1,6 @@
>  /*
>   * Copyright (c) 2007 QLogic Corporation.  All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation.  All 
> rights reserved.
>   *
>   * This software is available to you under the OpenIB.org BSD license
>   * below:
> @@ -88,8 +89,6 @@ static void
>  _data_kickTimer_stop(
>                   IN    Data_t          *pData );
> 
> -#define LOCAL_IO(x) PTR64((x))
> -
>  #define INBOUND_COPY
> 
>  #ifdef VNIC_STATISTIC
> @@ -254,7 +253,7 @@ data_connect(
>         pRdmaIo->io.pRoutine         = NULL;
>         pRdmaIo->io.wrq.p_next       = NULL;
>         pRdmaIo->io.wrq.wr_type      = WR_RDMA_WRITE;
> -       pRdmaIo->io.wrq.wr_id        = PTR64( pRdmaIo );
> +       pRdmaIo->io.wrq.wr_id        = (ULONG_PTR)pRdmaIo;
>         pRdmaIo->io.wrq.num_ds       = 1;
>         pRdmaIo->io.wrq.ds_array     = pRdmaIo->dsList;
>         pRdmaIo->dsList[0].lkey      = pData->region.lkey;
> @@ -265,26 +264,26 @@ data_connect(
>         pSendIo->io.pRoutine         = NULL;
>         pSendIo->io.wrq.p_next       = NULL;
>         pSendIo->io.wrq.wr_type      = WR_SEND;
> -       pSendIo->io.wrq.wr_id        = PTR64( pSendIo );
> +       pSendIo->io.wrq.wr_id        = (ULONG_PTR)pSendIo;
>         pSendIo->io.wrq.num_ds       = 1;
>         pSendIo->io.wrq.ds_array     = &pSendIo->dsList;
> 
>         pSendIo->io.wrq.send_opt     = IB_SEND_OPT_SIGNALED;
> 
>         pSendIo->dsList.length       = 0;
> -       pSendIo->dsList.vaddr        = PTR64( pRegionData );
> +       pSendIo->dsList.vaddr        = (ULONG_PTR)pRegionData;
>         pSendIo->dsList.lkey         = pData->region.lkey;
> 
>         for ( i = 0; i < pData->p_conf->numRecvs; i++ )
>         {
>                 pRecvIo[i].io.pViport         = pData->p_viport;
>                 pRecvIo[i].io.pRoutine        = _data_receivedKick;
> -               pRecvIo[i].io.r_wrq.wr_id     = PTR64( 
> &pRecvIo[i].io );
> +               pRecvIo[i].io.r_wrq.wr_id     = 
> (ULONG_PTR)&pRecvIo[i].io;
>                 pRecvIo[i].io.r_wrq.p_next    = NULL;
>                 pRecvIo[i].io.r_wrq.num_ds    = 1;
>                 pRecvIo[i].io.r_wrq.ds_array  = &pRecvIo[i].dsList;
>                 pRecvIo[i].dsList.length      = 4;
> -               pRecvIo[i].dsList.vaddr       = PTR64( pRegionData );
> +               pRecvIo[i].dsList.vaddr       = 
> (ULONG_PTR)pRegionData;
>                 pRecvIo[i].dsList.lkey        = pData->region.lkey;
> 
>                 InitializeListHead( &pRecvIo[i].io.listPtrs 
> ); @@ -370,7 +369,7 @@ data_connect(
>                 pRdmaIo->io.pRoutine         = _data_xmitComplete;
>                 pRdmaIo->io.wrq.p_next       = NULL;
>                 pRdmaIo->io.wrq.wr_type      = WR_RDMA_WRITE;
> -               pRdmaIo->io.wrq.wr_id        = PTR64(pRdmaIo);
> +               pRdmaIo->io.wrq.wr_id        = (ULONG_PTR)pRdmaIo;
>                 pRdmaIo->io.wrq.num_ds       = MAX_NUM_SGE; 
> // will set actual number when transmit
>                 pRdmaIo->io.wrq.ds_array     = pRdmaIo->dsList;
>                 pRdmaIo->p_trailer                      =  
> (ViportTrailer_t *)&pRdmaIo->data[0];
> @@ -381,7 +380,7 @@ data_connect(
>         }
> 
>         pXmitPool->rdmaRKey      = pData->region.rkey;
> -       pXmitPool->rdmaAddr      = PTR64( pXmitPool->bufPool );
> +       pXmitPool->rdmaAddr      = (ULONG_PTR)pXmitPool->bufPool;
> 
>         data_postRecvs( pData );
> 
> @@ -1184,7 +1183,7 @@ _data_addFreeBuffer(
>         pBpe = &p_recvPool->bufPool[index];
> 
>         pBpe->rKey       = pRdmaDest->region.rkey;
> -       pBpe->remoteAddr = hton64( PTR64( pRdmaDest->data ) );
> +       pBpe->remoteAddr = hton64( (ULONG_PTR)pRdmaDest->data );
>         pBpe->valid      = (uint32_t)(pRdmaDest - 
> &p_recvPool->pRecvBufs[0]) + 1;
>         ++p_recvPool->numFreeBufs;
> 
> @@ -1338,7 +1337,7 @@ _data_sendFreeRecvBuffers(
>                 rdmaAddr = p_recvPool->eiocRdmaAddr + offset;
> 
>                 pWrq->ds_array->length  = sz;
> -               pWrq->ds_array->vaddr = PTR64((uint8_t 
> *)p_recvPool->bufPool + offset);
> +               pWrq->ds_array->vaddr = (ULONG_PTR)((uint8_t 
> + *)p_recvPool->bufPool + offset);
>                 pWrq->remote_ops.vaddr = rdmaAddr;
> 
>                 if ( ibqp_postSend( &pData->qp, 
> &pData->freeBufsIo.io ) != IB_SUCCESS ) diff -up -r -X 
> trunk\docs\dontdiff.txt -I \$Id: 
> old\ulp\qlgcvnic\kernel\vnic_ib.c trunk\ulp\qlgcvnic\kernel\vnic_ib.c
> --- old\ulp\qlgcvnic\kernel\vnic_ib.c   Mon Apr 28 12:15:17 2008
> +++ trunk\ulp\qlgcvnic\kernel\vnic_ib.c Fri Jul 11 14:30:20 2008
> @@ -1,5 +1,6 @@
>  /*
>   * Copyright (c) 2007 QLogic Corporation.  All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation.  All 
> rights reserved.
>   *
>   * This software is available to you under the OpenIB.org BSD license
>   * below:
> @@ -144,7 +145,7 @@ ibregion_init (
>         IN              viport_t                *p_viport,
>         IN      OUT     IbRegion_t              *pRegion,
>         IN              ib_pd_handle_t  hPd,
> -       IN              void* __ptr64   vaddr,
> +       IN              void*                   vaddr,
>         IN              uint64_t                len,
>         IN              ib_access_t             access_ctrl )
>  {
> @@ -172,7 +173,7 @@ ibregion_init (
>         else
>         {
>                 pRegion->len = len;
> -               pRegion->virtAddress = (uint64_t)( vaddr );
> +               pRegion->virtAddress = (ULONG_PTR)vaddr;
>         }
>         VNIC_EXIT ( VNIC_DBG_IB );
>         return ib_status;
> @@ -418,7 +419,7 @@ static void
>  _ibqp_detach_cb(
>                 IN              ib_cm_drep_rec_t        *p_drep_rec )
>  {
> -       IbQp_t  *pQp = (IbQp_t * __ptr64 )p_drep_rec->qp_context;
> +       IbQp_t  *pQp = (IbQp_t *)p_drep_rec->qp_context;
>         VNIC_ENTER( VNIC_DBG_IB );
>         CL_ASSERT( p_drep_rec );
> 
> @@ -432,7 +433,7 @@ static void
>  _ibqp_rej_cb(
>          IN             ib_cm_rej_rec_t         *p_rej_rec )
>  {
> -       IbQp_t  *pQp = (IbQp_t * __ptr64 )p_rej_rec->qp_context;
> +       IbQp_t  *pQp = (IbQp_t *)p_rej_rec->qp_context;
>         CL_ASSERT(p_rej_rec );
> 
>         InterlockedExchange( &pQp->qpState, IB_DETACHED ); @@ 
> -471,7 +472,7 @@ _ibqp_dreq_cb(  {
>         ib_api_status_t ib_status = IB_SUCCESS;
>         ib_cm_drep_t    cm_drep;
> -       IbQp_t  *pQp    = (IbQp_t * __ptr64 )p_dreq_rec->qp_context;
> +       IbQp_t  *pQp    = (IbQp_t *)p_dreq_rec->qp_context;
> 
>         VNIC_ENTER( VNIC_DBG_IB );
>         CL_ASSERT( p_dreq_rec );
> @@ -699,7 +700,7 @@ _ibqp_connect_cb(
> 
>         VNIC_ENTER( VNIC_DBG_IB );
> 
> -       pQp = (IbQp_t * __ptr64 )p_cm_rep->qp_context;
> +       pQp = (IbQp_t *)p_cm_rep->qp_context;
>         p_viport = pQp->pViport;
> 
>         ASSERT( pQp->qpState == IB_ATTACHING ); @@ -870,7 
> +871,7 @@ ib_asyncEvent(
>                 switch ( pEventRecord->code )
>                 {
>                         case IB_AE_PORT_DOWN:
> -                               p_adapter = ( vnic_adapter_t 
> * __ptr64)pEventRecord->context;
> +                               p_adapter = (vnic_adapter_t 
> + *)pEventRecord->context;
> 
>                                 if( p_adapter &&
>                                         
> p_adapter->p_currentPath->pViport && @@ -889,7 +890,7 @@ 
> ib_asyncEvent(
>                         case IB_AE_WQ_REQ_ERROR:
>                         case IB_AE_WQ_ACCESS_ERROR:
> 
> -                                       p_viport = ((IbQp_t * 
> __ptr64 )pEventRecord->context)->pViport;
> +                                       p_viport = ((IbQp_t 
> + *)pEventRecord->context)->pViport;
> 
>                                         if( p_viport && 
> !p_viport->errored )
>                                         { diff -up -r -X 
> trunk\docs\dontdiff.txt -I \$Id: 
> old\ulp\qlgcvnic\kernel\vnic_ib.h trunk\ulp\qlgcvnic\kernel\vnic_ib.h
> --- old\ulp\qlgcvnic\kernel\vnic_ib.h   Thu Apr 24 11:29:32 2008
> +++ trunk\ulp\qlgcvnic\kernel\vnic_ib.h Fri Jul 11 14:42:50 2008
> @@ -1,5 +1,6 @@
>  /*
>   * Copyright (c) 2007 QLogic Corporation.  All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation.  All 
> rights reserved.
>   *
>   * This software is available to you under the OpenIB.org BSD license
>   * below:
> @@ -219,7 +220,7 @@ ibregion_init(
>         IN              struct _viport          *p_viport,
>         OUT             IbRegion_t                      *pRegion,
>         IN              ib_pd_handle_t          hPd,
> -       IN              void* __ptr64           vaddr,
> +       IN              void*                           vaddr,
>         IN              uint64_t                        len,
>         IN              ib_access_t                     access_ctrl );
> 
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: 
> old\ulp\qlgcvnic\kernel\vnic_util.h 
> trunk\ulp\qlgcvnic\kernel\vnic_util.h
> --- old\ulp\qlgcvnic\kernel\vnic_util.h Thu Apr 24 11:29:32 2008
> +++ trunk\ulp\qlgcvnic\kernel\vnic_util.h       Fri Jul 11 
> 14:43:11 2008
> @@ -1,5 +1,6 @@
>  /*
>   * Copyright (c) 2007 QLogic Corporation.  All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation.  All 
> rights reserved.
>   *
>   * This software is available to you under the OpenIB.org BSD license
>   * below:
> @@ -36,8 +37,6 @@
> 
>  #define MAXU32 MAXULONG
>  #define MAXU64 ((uint64_t)(~0))
> -
> -#define PTR64(what) ((uint64_t)(void * __ptr64)(what))
> 
>  #ifndef min
>  #define min(a,b) ((a)<(b)?(a):(b))
> 



More information about the ofw mailing list