Add support for multiple microarchitectures in single binary
[vpp.git] / vnet / vnet / devices / ssvm / node.c
index b26d73d..57b5fd2 100644 (file)
@@ -97,8 +97,8 @@ ssvm_eth_device_input (ssvm_eth_main_t * em,
   uword n_trace = vlib_get_trace_count (vm, node);
 
   /* Either side down? buh-bye... */
-  if ((u64)(sh->opaque [MASTER_ADMIN_STATE_INDEX]) == 0 ||
-      (u64)(sh->opaque [SLAVE_ADMIN_STATE_INDEX]) == 0)
+  if (pointer_to_uword(sh->opaque [MASTER_ADMIN_STATE_INDEX]) == 0 ||
+      pointer_to_uword(sh->opaque [SLAVE_ADMIN_STATE_INDEX]) == 0)
     return 0;
 
   if (intfc->i_am_master)
@@ -173,7 +173,7 @@ ssvm_eth_device_input (ssvm_eth_main_t * em,
               b0->total_length_not_including_first_buffer =
                 elt->total_length_not_including_first_buffer;
               
-              memcpy (b0->data + b0->current_data, elt->data, 
+              clib_memcpy (b0->data + b0->current_data, elt->data, 
                       b0->current_length);
 
               if (PREDICT_FALSE(prev != 0))
@@ -271,14 +271,14 @@ ssvm_eth_device_input (ssvm_eth_main_t * em,
 
   ASSERT(vec_len(intfc->rx_queue) > 0);
 
-  n_available = (u32)(u64)(sh->opaque[CHUNK_POOL_NFREE]);
+  n_available = (u32)pointer_to_uword(sh->opaque[CHUNK_POOL_NFREE]);
   elt_indices = (u32 *)(sh->opaque[CHUNK_POOL_FREELIST_INDEX]);
 
-  memcpy (&elt_indices[n_available], intfc->rx_queue, 
+  clib_memcpy (&elt_indices[n_available], intfc->rx_queue, 
           vec_len (intfc->rx_queue) * sizeof (u32));
 
   n_available += vec_len (intfc->rx_queue);
-  sh->opaque[CHUNK_POOL_NFREE] = (void *) (u64) n_available;
+  sh->opaque[CHUNK_POOL_NFREE] = uword_to_pointer(n_available, void* );
 
   ssvm_unlock (sh);
 
@@ -334,3 +334,5 @@ VLIB_REGISTER_NODE (ssvm_eth_input_node) = {
   },
 };
 
+VLIB_NODE_FUNCTION_MULTIARCH (ssvm_eth_input_node, ssvm_eth_input_node_fn)
+