[wsd] remove XXX_PTR64 and TO_ULONG_PTR macro use from WSD.
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sat, 28 Jun 2008 18:42:34 +0000 (18:42 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sat, 28 Jun 2008 18:42:34 +0000 (18:42 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1302 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/wsd/user/extensions.c
ulp/wsd/user/ib_cm.c
ulp/wsd/user/ibsp_iblow.c
ulp/wsd/user/ibsp_ip.c
ulp/wsd/user/ibsp_mem.c
ulp/wsd/user/ibsp_perfmon.c
ulp/wsd/user/ibsp_perfmon.h
ulp/wsd/user/ibsp_pnp.c
ulp/wsd/user/ibspdll.c
ulp/wsd/user/ibspproto.h
ulp/wsd/user/ibspstruct.h

index 6f81742..cebf3bc 100644 (file)
@@ -1,6 +1,7 @@
 /*\r
  * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.\r
  * Copyright (c) 2006 Mellanox Technologies.  All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation.  All rights reserved.\r
  *\r
  * This software is available to you under the OpenIB.org BSD license\r
  * below:\r
@@ -402,7 +403,7 @@ do_rdma_op(
 \r
        /* Format the send work request and post. */\r
        send_wr.p_next = NULL;\r
-       send_wr.wr_id = (uint64_t)(void* VOID_PTR64)wr;\r
+       send_wr.wr_id = (ULONG_PTR)wr;\r
        send_wr.wr_type = wr_type;\r
        send_wr.send_opt = 0;\r
        send_wr.num_ds = dwBufferCount;\r
@@ -414,7 +415,7 @@ do_rdma_op(
        lpOverlapped->InternalHigh = 0;\r
        for( ds_idx = 0; ds_idx < dwBufferCount; ds_idx++ )\r
        {\r
-               local_ds[ds_idx].vaddr = (uint64_t)(void* VOID_PTR64)lpBuffers[ds_idx].buf;\r
+               local_ds[ds_idx].vaddr = (ULONG_PTR)lpBuffers[ds_idx].buf;\r
                local_ds[ds_idx].length = lpBuffers[ds_idx].len;\r
                local_ds[ds_idx].lkey =\r
                        ((struct memory_node*)lpBuffers[ds_idx].handle)->p_reg1->lkey;\r
index 8852669..3b38c59 100644 (file)
@@ -1,6 +1,7 @@
 /*\r
  * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.\r
  * Copyright (c) 2006 Mellanox Technologies.  All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation.  All rights reserved.\r
  *\r
  * This software is available to you under the OpenIB.org BSD license\r
  * below:\r
@@ -113,7 +114,7 @@ cm_req_callback(
        IN                              ib_cm_req_rec_t                         *p_cm_req_rec )\r
 {\r
        struct ibsp_socket_info *socket_info =\r
-               (struct ibsp_socket_info * VOID_PTR64)p_cm_req_rec->context;\r
+               (struct ibsp_socket_info *)p_cm_req_rec->context;\r
        struct listen_incoming *incoming;\r
 \r
        IBSP_ENTER( IBSP_DBG_CM );\r
@@ -208,7 +209,7 @@ cm_rep_callback(
        IN                              ib_cm_rep_rec_t                         *p_cm_rep_rec )\r
 {\r
        struct ibsp_socket_info *socket_info =\r
-               (struct ibsp_socket_info * VOID_PTR64)p_cm_rep_rec->qp_context;\r
+               (struct ibsp_socket_info *)p_cm_rep_rec->qp_context;\r
        ib_cm_rtu_t cm_rtu;\r
        ib_api_status_t status;\r
 \r
@@ -291,7 +292,7 @@ cm_rtu_callback(
        IN                              ib_cm_rtu_rec_t                         *p_cm_rtu_rec )\r
 {\r
        struct ibsp_socket_info *socket_info =\r
-               (struct ibsp_socket_info * VOID_PTR64)p_cm_rtu_rec->qp_context;\r
+               (struct ibsp_socket_info *)p_cm_rtu_rec->qp_context;\r
 \r
        IBSP_ENTER( IBSP_DBG_CM );\r
 \r
@@ -336,7 +337,7 @@ cm_rtu_callback(
                        wr = &socket_info->recv_wr[socket_info->recv_idx];\r
 \r
                        /* Update the work request ID. */\r
-                       wr->recv.wr_id = (uint64_t)(void* VOID_PTR64)wr;\r
+                       wr->recv.wr_id = (ULONG_PTR)wr;\r
 \r
                        /*\r
                         * Increment the count before posting so it doesn't go\r
@@ -421,7 +422,7 @@ cm_rej_callback(
        IN                              ib_cm_rej_rec_t                         *p_cm_rej_rec )\r
 {\r
        struct ibsp_socket_info *socket_info =\r
-               (struct ibsp_socket_info * VOID_PTR64)p_cm_rej_rec->qp_context;\r
+               (struct ibsp_socket_info *)p_cm_rej_rec->qp_context;\r
 \r
        IBSP_ENTER( IBSP_DBG_CM );\r
 \r
@@ -504,14 +505,14 @@ cm_dreq_callback(
        ib_cm_drep_t cm_drep;\r
        struct disconnect_reason *reason;\r
        struct ibsp_socket_info *socket_info =\r
-               (struct ibsp_socket_info * VOID_PTR64)p_cm_dreq_rec->qp_context;\r
+               (struct ibsp_socket_info *)p_cm_dreq_rec->qp_context;\r
 \r
        IBSP_ENTER( IBSP_DBG_CM );\r
        IBSP_PRINT(TRACE_LEVEL_INFORMATION, IBSP_DBG_CM,\r
                ("socket=%p state=%s\n",\r
                socket_info, IBSP_SOCKET_STATE_STR( socket_info->socket_state )) );\r
 \r
-       reason = (struct disconnect_reason * VOID_PTR64)p_cm_dreq_rec->p_dreq_pdata;\r
+       reason = (struct disconnect_reason *)p_cm_dreq_rec->p_dreq_pdata;\r
 \r
        cl_spinlock_acquire( &socket_info->mutex1 );\r
 \r
index f6c9ca2..c662532 100644 (file)
@@ -1,6 +1,7 @@
 /*\r
  * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.\r
  * Copyright (c) 2006 Mellanox Technologies.  All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation.  All rights reserved.\r
  *\r
  * This software is available to you under the OpenIB.org BSD license\r
  * below:\r
@@ -66,8 +67,8 @@ complete_wq(
 \r
        IBSP_ENTER( IBSP_DBG_IO );\r
 \r
-       wr = (struct _wr * VOID_PTR64)HDL_TO_PTR(wc->wr_id);\r
-       p_recv_wr = (struct _recv_wr * VOID_PTR64)HDL_TO_PTR(wc->wr_id);\r
+       wr = (struct _wr *)(ULONG_PTR)wc->wr_id;\r
+       p_recv_wr = (struct _recv_wr *)(ULONG_PTR)wc->wr_id;\r
 \r
        CL_ASSERT( wr );\r
 \r
@@ -110,7 +111,7 @@ complete_wq(
 #ifdef IBSP_LOGGING\r
                        cl_spinlock_acquire( &socket_info->recv_lock );\r
                        DataLogger_WriteData(&socket_info->RecvDataLogger,\r
-                               p_recv_wr->idx, (void * VOID_PTR64)p_recv_wr->ds_array[0].vaddr,\r
+                               p_recv_wr->idx, (void *)p_recv_wr->ds_array[0].vaddr,\r
                                wc->length);\r
                        cl_spinlock_release( &socket_info->recv_lock );\r
 #endif\r
@@ -251,7 +252,7 @@ complete_wq(
                //      if( idx >= QP_ATTRIB_RQ_DEPTH )\r
                //              idx += QP_ATTRIB_RQ_DEPTH;\r
 \r
-               //      CL_ASSERT( wc->wr_id == (uint64_t)(void* VOID_PTR64)&socket_info->recv_wr[idx] );\r
+               //      CL_ASSERT( wc->wr_id == (ULONG_PTR)&socket_info->recv_wr[idx] );\r
                //      cl_atomic_dec( &socket_info->recv_cnt );\r
                //      cl_spinlock_release( &socket_info->recv_lock );\r
                //}\r
@@ -259,7 +260,7 @@ complete_wq(
                if( wc->status == IB_SUCCESS && p_recv_wr->ds_array[0].length >= 40 )\r
                {\r
                        debug_dump_buffer( IBSP_DBG_WQ, "RECV",\r
-                               (void * VOID_PTR64)p_recv_wr->ds_array[0].vaddr, 40 );\r
+                               (void *)(ULONG_PTR)p_recv_wr->ds_array[0].vaddr, 40 );\r
                }\r
 \r
                cl_atomic_dec( &g_ibsp.recv_count );\r
@@ -279,7 +280,7 @@ complete_wq(
                //      idx = socket_info->send_idx - (uint8_t)socket_info->send_cnt;\r
                //      if( idx >= QP_ATTRIB_SQ_DEPTH )\r
                //              idx += QP_ATTRIB_SQ_DEPTH;\r
-               //      CL_ASSERT( wc->wr_id == (uint64_t)(void* VOID_PTR64)&socket_info->send_wr[idx] );\r
+               //      CL_ASSERT( wc->wr_id == (ULONG_PTR)&socket_info->send_wr[idx] );\r
                //      cl_atomic_dec( &socket_info->send_cnt );\r
                //      cl_spinlock_release( &socket_info->send_lock );\r
                //}\r
index dbf8f33..5581b05 100644 (file)
@@ -1,6 +1,7 @@
 /*\r
  * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.\r
  * Copyright (c) 2006 Mellanox Technologies.  All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation.  All rights reserved.\r
  *\r
  * This software is available to you under the OpenIB.org BSD license\r
  * below:\r
@@ -271,7 +272,7 @@ query_guid_callback(
                                        ib_query_rec_t                          *p_query_rec )\r
 {\r
        struct query_guid_context *query_context =\r
-               (struct query_guid_context * VOID_PTR64)p_query_rec->query_context;\r
+               (struct query_guid_context *)p_query_rec->query_context;\r
        ib_service_record_t *service_record;\r
 \r
        IBSP_ENTER( IBSP_DBG_HW );\r
@@ -311,7 +312,7 @@ query_guid_address(
        ib_user_query_t user_query;\r
        struct query_guid_context query_context;\r
        ib_service_record_t service_record;\r
-       ib_query_handle_t VOID_PTR64 query_handle;\r
+       ib_query_handle_t query_handle;\r
        ib_query_req_t query_req;\r
        ib_api_status_t status;\r
 \r
@@ -392,7 +393,7 @@ query_pr_callback(
                                        ib_query_rec_t                          *p_query_rec )\r
 {\r
        struct query_pr_context *query_context =\r
-               (struct query_pr_context * VOID_PTR64)p_query_rec->query_context;\r
+               (struct query_pr_context *)p_query_rec->query_context;\r
        ib_api_status_t status;\r
 \r
        IBSP_ENTER( IBSP_DBG_HW );\r
@@ -432,7 +433,7 @@ query_pr(
 {\r
        ib_gid_pair_t user_query;\r
        struct query_pr_context query_context;\r
-       ib_query_handle_t VOID_PTR64 query_handle;\r
+       ib_query_handle_t query_handle;\r
        ib_query_req_t query_req;\r
        ib_api_status_t status;\r
        uint8_t pkt_life;\r
index f802afa..7071044 100644 (file)
@@ -1,6 +1,7 @@
 /*\r
  * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.\r
  * Copyright (c) 2006 Mellanox Technologies.  All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation.  All rights reserved.\r
  *\r
  * This software is available to you under the OpenIB.org BSD license\r
  * below:\r
@@ -51,8 +52,8 @@ __check_mr(
 {\r
        return( (p_reg->type.access_ctrl & acl_mask) == acl_mask &&\r
                start >= p_reg->type.vaddr &&\r
-               ((uintn_t)start) + len <=\r
-               ((uintn_t)(uint64_t)p_reg->type.vaddr) + p_reg->type.length );\r
+               ((ULONG_PTR)start) + len <=\r
+               ((ULONG_PTR)p_reg->type.vaddr) + p_reg->type.length );\r
 }\r
 \r
 \r
@@ -100,7 +101,7 @@ lookup_partial_mr(
 struct memory_node *\r
 ibsp_reg_mem(\r
        IN                              struct ibsp_socket_info         *s,\r
-       IN                              ib_pd_handle_t FUNC_PTR64                               pd,\r
+       IN                              ib_pd_handle_t                          pd,\r
        IN                              void                                            *start,\r
        IN                              size_t                                          len,\r
        IN                              ib_access_t                                     access_ctrl,\r
@@ -361,8 +362,8 @@ ibsp_hca_flush_mr_cache(
                p_item = cl_qlist_next( p_item );\r
 \r
                if( lpvAddress > p_reg->type.vaddr ||\r
-                       ((uintn_t)lpvAddress) + Size <\r
-                       ((uintn_t)(uint64_t)p_reg->type.vaddr) + p_reg->type.length )\r
+                       ((ULONG_PTR)lpvAddress) + Size <\r
+                       ((ULONG_PTR)p_reg->type.vaddr) + p_reg->type.length )\r
                {\r
                        continue;\r
                }\r
index 8eb383b..e4d947a 100644 (file)
@@ -1,6 +1,7 @@
 /*\r
  * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.\r
  * Copyright (c) 2006 Mellanox Technologies.  All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation.  All rights reserved.\r
  *\r
  * This software is available to you under the OpenIB.org BSD license\r
  * below:\r
@@ -43,6 +44,7 @@
 \r
 struct _ibsp_pm_definition     g_ibsp_pm_def; /* IB WSD performance object */\r
 \r
+struct _pm_stat g_pm_stat;\r
 \r
 void\r
 IBSPPmInit( void )\r
@@ -420,7 +422,7 @@ IBSPPmCollectData(
        \r
        IBSP_ENTER( IBSP_DBG_PERFMON );\r
 \r
-       p_mem = (pm_shmem_t * VOID_PTR64 )g_pm_stat.p_shmem;\r
+       p_mem = (pm_shmem_t *)g_pm_stat.p_shmem;\r
        \r
        if( p_mem == NULL )\r
        {\r
index d309868..1d94cb7 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
  * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation.  All rights reserved.\r
  *\r
  * This software is available to you under the OpenIB.org BSD license\r
  * below:\r
@@ -95,7 +96,9 @@ struct _pm_stat
        DWORD                                   idx;                    /* slot index assigned for this process */\r
        LONG64                                  fall_back_data[IBSP_PM_NUM_COUNTERS];\r
 \r
-}      g_pm_stat;\r
+};\r
+\r
+extern struct _pm_stat g_pm_stat;\r
 \r
 \r
 void\r
index ebe6a65..efd1ef9 100644 (file)
@@ -1,6 +1,7 @@
 /*\r
  * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.\r
  * Copyright (c) 2006 Mellanox Technologies.  All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation.  All rights reserved.\r
  *\r
  * This software is available to you under the OpenIB.org BSD license\r
  * below:\r
@@ -319,7 +320,7 @@ pnp_callback(
                break;\r
 \r
        case IB_PNP_CA_REMOVE:\r
-               pnp_ca_remove( (struct ibsp_hca* VOID_PTR64)pnp_rec->context );\r
+               pnp_ca_remove( (struct ibsp_hca*)pnp_rec->context );\r
                break;\r
 \r
                /* Port events */\r
@@ -335,7 +336,7 @@ pnp_callback(
                break;\r
 \r
        case IB_PNP_PORT_REMOVE:\r
-               pnp_port_remove( (struct ibsp_port* VOID_PTR64)pnp_rec->context );\r
+               pnp_port_remove( (struct ibsp_port*)pnp_rec->context );\r
                break;\r
 \r
        case IB_PNP_PKEY_CHANGE:\r
index b5ae248..74467cc 100644 (file)
@@ -1,6 +1,7 @@
 /*\r
  * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.\r
  * Copyright (c) 2006 Mellanox Technologies.  All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation.  All rights reserved.\r
  *\r
  * This software is available to you under the OpenIB.org BSD license\r
  * below:\r
@@ -1621,7 +1622,7 @@ IBSPRecv(
 \r
        /* Looks good. Post the receive buffer. */\r
        wr->recv.p_next = NULL;\r
-       wr->recv.wr_id = (uint64_t)(void* VOID_PTR64)wr;\r
+       wr->recv.wr_id = (ULONG_PTR)wr;\r
        wr->recv.num_ds = dwBufferCount;\r
        wr->recv.ds_array = wr->ds_array;\r
 \r
@@ -1643,7 +1644,7 @@ IBSPRecv(
                }\r
 \r
                wr->ds_array[ds_idx].vaddr =\r
-                       (uint64_t)(void* VOID_PTR64)lpBuffers[ds_idx].buf;\r
+                       (ULONG_PTR)lpBuffers[ds_idx].buf;\r
                wr->ds_array[ds_idx].length = lpBuffers[ds_idx].len;\r
                wr->ds_array[ds_idx].lkey = node->p_reg1->lkey;\r
        }\r
@@ -1847,7 +1848,7 @@ IBSPSend(
        lpOverlapped->InternalHigh = 0;\r
        for( ds_idx = 0; ds_idx < dwBufferCount; ds_idx++ )\r
        {\r
-               local_ds[ds_idx].vaddr = (uint64_t)(void* VOID_PTR64)lpBuffers[ds_idx].buf;\r
+               local_ds[ds_idx].vaddr = (ULONG_PTR)lpBuffers[ds_idx].buf;\r
                local_ds[ds_idx].length = lpBuffers[ds_idx].len;\r
 \r
                lpOverlapped->InternalHigh += lpBuffers[ds_idx].len;\r
@@ -2324,3 +2325,4 @@ WSPStartupEx(
 }\r
 \r
 \r
+\r
index 261dce8..d2f67dc 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
  * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation.  All rights reserved.\r
  *\r
  * This software is available to you under the OpenIB.org BSD license\r
  * below:\r
@@ -249,7 +250,7 @@ lookup_partial_mr(
 struct memory_node *\r
 ibsp_reg_mem(\r
        IN                              struct ibsp_socket_info         *s,\r
-       IN                              ib_pd_handle_t FUNC_PTR64                               pd,\r
+       IN                              ib_pd_handle_t                          pd,\r
        IN                              void                                            *start,\r
        IN                              size_t                                          len,\r
        IN                              ib_access_t                                     access_ctrl,\r
index 671076a..3b1fc53 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
  * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation.  All rights reserved.\r
  *\r
  * This software is available to you under the OpenIB.org BSD license\r
  * below:\r
@@ -173,7 +174,7 @@ struct memory_reg
        /* Memory registration parameters, returned by ib_reg_mem. */\r
        uint32_t                lkey;\r
        uint32_t                rkey;\r
-TO_LONG_PTR(   ib_mr_handle_t ,        mr_handle) ; \r
+       ib_mr_handle_t  mr_handle;\r
 };\r
 \r
 \r
@@ -203,7 +204,7 @@ struct cq_thread_info
        cl_list_item_t          list_item;\r
 \r
        cl_waitobj_handle_t cq_waitobj;\r
-TO_LONG_PTR(   ib_cq_handle_t , cq) ; \r
+       ib_cq_handle_t cq;\r
 \r
        /* Number of qp's using this cq */\r
        atomic32_t qp_count;\r
@@ -248,7 +249,7 @@ struct ibsp_socket_info
                /* Listening socket */\r
                unsigned int backlog;   /* Maximum number of pending connections */\r
                cl_qlist_t list;        /* list of pending connections */\r
-TO_LONG_PTR(           ib_listen_handle_t , handle) ; \r
+               ib_listen_handle_t handle;\r
                struct listen_req_param listen_req_param;\r
        } listen;\r
 \r
@@ -264,12 +265,12 @@ TO_LONG_PTR(              ib_listen_handle_t , handle) ;
        struct ibsp_socket_options socket_options;      /* Socket Options */\r
 \r
        /* Infiniband ressources */\r
-TO_LONG_PTR(   ib_pd_handle_t , hca_pd) ;              /* Copy of the HCA PD, for faster access. */\r
+       ib_pd_handle_t hca_pd;          /* Copy of the HCA PD, for faster access. */\r
 \r
        /* Pointer to completion queue and thread assigned to this socket */\r
        struct cq_thread_info *cq_tinfo;\r
 \r
-TO_LONG_PTR(   ib_qp_handle_t ,                qp) ; \r
+       ib_qp_handle_t          qp;\r
        uint32_t                        max_inline;\r
 \r
        /* State on the QP. This is only valid when the socket state is IBSP_CONNECTED.\r
@@ -394,9 +395,9 @@ struct ibsp_hca
 \r
        ib_net64_t guid;\r
        uint16_t        dev_id; /* Device ID to selectively cap MTU to 1K for Tavor. */\r
-TO_LONG_PTR(   ib_ca_handle_t , hca_handle) ; \r
+       ib_ca_handle_t hca_handle;\r
 \r
-TO_LONG_PTR(   ib_pd_handle_t , pd) ; \r
+       ib_pd_handle_t pd;\r
 \r
        /* Memory management */\r
        struct mr_list rdma_mem_list;   /* Regions registered through IBSPRegisterRdmaMemory */\r
@@ -430,9 +431,9 @@ struct ibspdll_globals
        WSAPROTOCOL_INFOW protocol_info;\r
 \r
        /* Infiniband */\r
-TO_LONG_PTR(   ib_al_handle_t  , al_handle) ; \r
-TO_LONG_PTR(   ib_pnp_handle_t , pnp_handle_ca) ; \r
-TO_LONG_PTR(   ib_pnp_handle_t , pnp_handle_port) ; \r
+       ib_al_handle_t al_handle;\r
+       ib_pnp_handle_t pnp_handle_ca;\r
+       ib_pnp_handle_t pnp_handle_port;\r
 \r
        cl_qlist_t hca_list;\r
        cl_spinlock_t hca_mutex;\r