diff gsm-fw/services/etm/etm_api.c @ 165:9dbf3248a197

starting to compile ETM
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 19 Nov 2013 04:23:29 +0000
parents d78219c43fbf
children f9ac53d8e999
line wrap: on
line diff
--- a/gsm-fw/services/etm/etm_api.c	Mon Nov 18 06:39:44 2013 +0000
+++ b/gsm-fw/services/etm/etm_api.c	Tue Nov 19 04:23:29 2013 +0000
@@ -19,14 +19,14 @@
  *********************************************************************************/
 
 
-#include "etm/etm.h"
-#include "etm/etm_env.h"
-#include "etm/etm_messages_i.h"
-#include "etm/etm_trace.h"
+#include "etm.h"
+#include "etm_env.h"
+#include "etm_messages_i.h"
+#include "etm_trace.h"
 
-#include "etm/etm_misc.h"
+#include "etm_misc.h"
 
-#include "rvf/rvf_api.h"
+#include "../../riviera/rvf/rvf_api.h"
 
 #include <string.h> 
 
@@ -44,15 +44,17 @@
  *			the return value of rvf_send_msg otherwise.
  *********************************************************************************/
 
-int etm_register(char name[], int mid, int task_id, T_RVF_ADDR_ID addr_id, ETM_CALLBACK_FUNC callback)
+int etm_register(char name[], int mid, int task_id, T_RVF_ADDR_ID addr_id,
+		 ETM_CALLBACK_FUNC callback)
 {
-	/* Type for a registration event. */
-	T_ETM_REGISTER_REQ *etm_registration_p;
+    /* Type for a registration event. */
+    T_ETM_REGISTER_REQ *etm_registration_p;
 
-	tr_etm(TgTrEtmLow, "ETM API: _register bridge function(%s)", name);
+    tr_etm(TgTrEtmLow, "ETM API: _register bridge function(%s)", name);
 
     /* Allocate the memory for the message to send */
-    if ((etm_registration_p = (T_ETM_REGISTER_REQ*) etm_malloc(sizeof(T_ETM_REGISTER_REQ))) == NULL)
+    if ((etm_registration_p = (T_ETM_REGISTER_REQ*)
+				etm_malloc(sizeof(T_ETM_REGISTER_REQ))) == NULL)
             return ETM_NOMEM; 
 
     /* Fill the message id */
@@ -65,22 +67,21 @@
 
     /* Fill the message parameters */
     memcpy(etm_registration_p->name, name, strlen(name));
-	etm_registration_p->mid              = mid;
-	etm_registration_p->task_id          = task_id;
-	etm_registration_p->addr_id          = addr_id;
-	etm_registration_p->rx_callback_func = callback; 
+    etm_registration_p->mid              = mid;
+    etm_registration_p->task_id          = task_id;
+    etm_registration_p->addr_id          = addr_id;
+    etm_registration_p->rx_callback_func = callback; 
 
-	/* Send the message using mailbox. */
-	return rvf_send_msg(etm_env_ctrl_blk->addr_id,
-						(void*) etm_registration_p);
+    /* Send the message using mailbox. */
+    return rvf_send_msg(etm_env_ctrl_blk->addr_id, (void*) etm_registration_p);
 }
 
 
 /********************************************************************************
- * Cleans ETM register tables, i.e. set/clean the variable at their initialization
- * state for a specific entity.
- * This function can be used to reinitialize ETM register database without having to
- * start/stop it.
+ * Cleans ETM register tables, i.e. set/clean the variable at their
+ * initialization state for a specific entity.
+ * This function can be used to reinitialize ETM register database without
+ * having to start/stop it.
  *
  * This is a bridge function. It sends ETM_UNREGISTER message to ETM.
  *
@@ -90,13 +91,14 @@
 
 int etm_unregister(char name[], int mid, int task_id, T_RVF_ADDR_ID addr_id, ETM_CALLBACK_FUNC callback)
 {
-	/* Type for a start input event. */
-	T_ETM_UNREGISTER *etm_unregister_p;
-    
-	tr_etm(TgTrEtmLow, "ETM API: _unregister bridge function");
-    
+    /* Type for a start input event. */
+    T_ETM_UNREGISTER *etm_unregister_p;
+
+    tr_etm(TgTrEtmLow, "ETM API: _unregister bridge function");
+
     /* Allocate the memory for the message to send */
-    if ((etm_unregister_p = (T_ETM_UNREGISTER*) etm_malloc(sizeof(T_ETM_UNREGISTER))) == NULL)
+    if ((etm_unregister_p = (T_ETM_UNREGISTER*)
+				etm_malloc(sizeof(T_ETM_UNREGISTER))) == NULL)
             return ETM_NOMEM; 
 
     /* Fill the message id */
@@ -109,14 +111,13 @@
 
     /* Fill the message parameters */
     memcpy(etm_unregister_p->name, name, strlen(name));
-	etm_unregister_p->mid              = mid;
-	etm_unregister_p->task_id          = task_id;
-	etm_unregister_p->addr_id          = addr_id;
-	etm_unregister_p->rx_callback_func = callback;
+    etm_unregister_p->mid              = mid;
+    etm_unregister_p->task_id          = task_id;
+    etm_unregister_p->addr_id          = addr_id;
+    etm_unregister_p->rx_callback_func = callback;
 
-	/* Send the message using mailbox. */
-	return rvf_send_msg(etm_env_ctrl_blk->addr_id,
-						(void*) etm_unregister_p);
+    /* Send the message using mailbox. */
+    return rvf_send_msg(etm_env_ctrl_blk->addr_id, (void*) etm_unregister_p);
 }
 
 
@@ -142,7 +143,7 @@
 
 int etm_get16(void *buf)
 {
-   unsigned char *p = buf;
+    unsigned char *p = buf;
 
     int value =
         (*p++ | (*p << 8));
@@ -277,4 +278,3 @@
 
     return error;
 }
-