Fix compilation issues
authorTinku Mannan <tmannan@ti.com>
Tue, 3 Jun 2014 16:55:27 +0000 (12:55 -0400)
committerTinku Mannan <tmannan@ti.com>
Tue, 3 Jun 2014 16:55:27 +0000 (12:55 -0400)
ti/runtime/netapi/src/netapi.c
ti/runtime/netapi/src/netapi_init.c
ti/runtime/netapi/src/netapi_loc.h
ti/runtime/netapi/src/netapi_sched.c
ti/runtime/netapi/src/netapi_sec.c
ti/runtime/netapi/src/netcp_cfg.c
ti/runtime/netapi/test/net_test_loopback.c
ti/runtime/netapi/test/net_test_router.c

index 9ebe8cc7ee4babb2ab05a1ee3b30fdc1fd683399..317b7f0d41cc8ac9d41bd7a80ace45b028e6c828 100755 (executable)
@@ -247,7 +247,7 @@ NETAPI_T netapi_init(int                master,
     /* system init */
     if(master == NETAPI_SYS_MASTER)
     {
-        err = netapip_systemInit(p, TRUE);
+        err = netapip_systemInit(p, NETAPI_TRUE);
         if (err < 0)
         {
             goto ERR_netapi_init;
@@ -259,7 +259,7 @@ NETAPI_T netapi_init(int                master,
     {
         /* More limited initialization */
         err = netapip_systemInit(p,
-                                 FALSE);
+                                 NETAPI_FALSE);
         if (err<0)
         {
             goto ERR_netapi_init;
index d8d29202317f67612ffc471a66a77f2edfc6e5d1..12d7cf70c4713233e8db78a72dcab19eae5df650 100755 (executable)
@@ -717,7 +717,7 @@ int netapip_systemInit(NETAPI_HANDLE_T * handle,
 
 
 
-    if (global_master_process == TRUE)
+    if (global_master_process == NETAPI_TRUE)
     {
         hplib_initMallocArea(0);
         hplib_initMallocArea(1);
@@ -731,7 +731,7 @@ int netapip_systemInit(NETAPI_HANDLE_T * handle,
     }
 
 
-    if(global_master_process == FALSE)
+    if(global_master_process == NETAPI_FALSE)
     {
         /****************************************************
          * partial initialization.  For process, not for SOC
index cd77ef03bc01d4e9d42e45bd17d50fed80cc383c..1be8cd4aa898545009de7708634961a18294e02e 100755 (executable)
@@ -21,6 +21,10 @@ extern "C" {
 
 extern hplib_virtualAddrInfo_T netapi_VM_VirtAddr[HPLIB_MAX_MEM_POOLS];
 extern unsigned char *netapi_VM_SaContextVaddr;
+
+#define NETAPI_TRUE 1
+#define NETAPI_FALSE 0
+
 /***********************************************
  *  GLOBAL AREA
  *   short term:  this is global to process
index 41988cb77571a224f3839cd1831949f88f558d76..6c079d5a6303751f9728f5828662e801f3fe8cbd 100755 (executable)
@@ -157,7 +157,7 @@ int netapi_schedRun(NETAPI_SCHED_HANDLE_T *s,
          t1=hplib_mUtilGetPmuCCNT();
          /* poll all  pktio channels we have open in RX mode */
          pkts=netapi_pktioPollAll((NETAPI_T) s->back, NULL, &err);
-         if (!pkts  && (s->config.yield == TRUE))
+         if (!pkts  && (s->config.yield == NETAPI_TRUE))
          {
             sched_yield();
          }
@@ -171,14 +171,14 @@ int netapi_schedRun(NETAPI_SCHED_HANDLE_T *s,
          }
 
         /* poll pktlib garbage collections for registered heaps */
-        if (TRUE == s->config.pollGarbageQ)
+        if (NETAPI_TRUE == s->config.pollGarbageQ)
         {
             netapi_pollHeapGarbage((NETAPI_T) s->back);
         }
 
 
         /*poll NETCP/PA control channels */
-        if (TRUE == s->config.pollCtrlQ)
+        if (NETAPI_TRUE == s->config.pollCtrlQ)
         {
             netapi_netcpPoll((NETAPI_T) s->back);
         }
index a077236f7a6f33cbcf302cb8241c93d430359587..5967591205d22e798f69551183a93d351cd48079 100755 (executable)
@@ -305,7 +305,7 @@ NETCP_CFG_SA_T netapi_secAddSA(NETAPI_T h,
 
     netapip_netcpCfgInsertSa(&netapi_get_global()->nwal_context,
                           tunnelId,
-                          (sa_info->dir ==   NWAL_SA_DIR_INBOUND) ? TRUE: FALSE,
+                          (sa_info->dir ==   NWAL_SA_DIR_INBOUND) ? NETAPI_TRUE: NETAPI_FALSE,
                           inflow_mode,
                           &saInfo,
                          &createParam,
index 2b3a6ae2072ddb0a38875480061e79c2f02a556f..fa98dbdeed384cfc0b103936596d319ae27fcfaf 100755 (executable)
@@ -676,7 +676,7 @@ static int cfgOkToDeleteL3ClassiHandle(NETAPI_NWAL_GLOBAL_CONTEXT_T *p,
     int count=0;
 
     if(l3_handle == NULL)
-        return FALSE;
+        return NETAPI_FALSE;
     for(i=0; i< TUNE_NETAPI_MAX_CLASSIFIERS;i++)
     {
         if (!p->classi[i].in_use)
@@ -689,9 +689,9 @@ static int cfgOkToDeleteL3ClassiHandle(NETAPI_NWAL_GLOBAL_CONTEXT_T *p,
         }
     }
     if (count > 0)
-        return FALSE;
+        return NETAPI_FALSE;
 
-    return TRUE;
+    return NETAPI_TRUE;
 }
 
 /*******************************************************************************
@@ -1433,7 +1433,7 @@ NETCP_CFG_CLASS_T netapi_netcpCfgAddClass(NETAPI_T                  h,
                                       p_class->u.c_l3_l4.p_fail_route,
                                       user_data,
                                       &ret,
-                                      FALSE);
+                                      NETAPI_FALSE);
                     if(!ret)
                     {
                         l3_handle=NULL;
index 3e47c94ba442701eba7d7627ec763ee74e042ec2..64767c9543d953db8ffe0210e5a0b2075dd65fec 100755 (executable)
@@ -1018,9 +1018,9 @@ void slow_path_thread(uint32_t index)
         printf("sched create failed for core%d\n",thread_num);
         goto ERR_slow_path_thread;
     }
-    scheduler[thread_num]->config.yield = TRUE;
-    scheduler[thread_num]->config.pollGarbageQ = TRUE;
-    scheduler[thread_num]->config.pollCtrlQ = TRUE;
+    scheduler[thread_num]->config.yield = NETAPI_TRUE;
+    scheduler[thread_num]->config.pollGarbageQ = NETAPI_TRUE;
+    scheduler[thread_num]->config.pollCtrlQ = NETAPI_TRUE;
     printf("Slow Path thread: %d setup complete, running on ARM CORE: %d\n", i,i);
     /* Entry point to scheduler */
     netapi_schedRun(scheduler[thread_num], &err);
@@ -1084,9 +1084,9 @@ void fast_path_thread(uint32_t index)
     }
 
  
-    scheduler[thread_num]->config.yield = FALSE;
-    scheduler[thread_num]->config.pollGarbageQ = FALSE;
-    scheduler[thread_num]->config.pollCtrlQ = FALSE;
+    scheduler[thread_num]->config.yield = NETAPI_FALSE;
+    scheduler[thread_num]->config.pollGarbageQ = NETAPI_FALSE;
+    scheduler[thread_num]->config.pollCtrlQ = NETAPI_FALSE;
      //sleep(100000);
    /* Entry point to scheduler */
     printf("Fast Path thread: %d setup complete, running on ARM CORE: %d\n", i,i);
index 4e03d484cb44aaed41df896532252ec286af1b23..5ce5f002fed2e371ffa6588057854738beda48c6 100755 (executable)
@@ -362,9 +362,9 @@ void slow_path_thread(uint32_t index)
         netapi_Log("sched create failed for core%d\n",thread_num); 
         exit(1);
     }
-      scheduler[thread_num]->config.yield = FALSE;
-      scheduler[thread_num]->config.pollGarbageQ = TRUE;
-      scheduler[thread_num]->config.pollCtrlQ = TRUE;
+      scheduler[thread_num]->config.yield = NETAPI_FALSE;
+      scheduler[thread_num]->config.pollGarbageQ = NETAPI_TRUE;
+      scheduler[thread_num]->config.pollCtrlQ = NETAPI_TRUE;
             /*********************************************/
     /**************Entry point into scheduler ****/
     /*********************************************/
@@ -426,9 +426,9 @@ void fast_path_thread(uint32_t index)
     /*********************************************/
     /**************Entry point into scheduler ****/
     /*********************************************/
-    scheduler[thread_num]->config.yield = FALSE;
-     scheduler[thread_num]->config.pollGarbageQ = FALSE;
-     scheduler[thread_num]->config.pollCtrlQ = FALSE;
+    scheduler[thread_num]->config.yield = NETAPI_FALSE;
+     scheduler[thread_num]->config.pollGarbageQ = NETAPI_FALSE;
+     scheduler[thread_num]->config.pollCtrlQ = NETAPI_FALSE;
      //sleep(100000);
     netapi_schedRun(scheduler[thread_num], &err);
     netapi_Log("fast_path_thread: core %d worker thread done\n",thread_num);