annotate nuc-fw/riviera/rvf/rvf_trace_adapt.c @ 118:21de8d8e6ea7

checking in Riviera code from the Sotomodem version
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 29 Oct 2013 07:03:45 +0000
parents
children e7d4ec9c4c32
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
118
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /****************************************************************************/
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 /* */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 /* Name rvf_trace_adapt.c */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 /* */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 /* Function this file is used to trace messages if TRACE module is */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 /* activated or not */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 /* */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 /* Version 0.1 */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 /* */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 /* Date Modification */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 /* ------------------------------------ */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 /* 03/19/2001 Create */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 /* */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14 /* Author Pascal Puel (p-puel@tif.ti.com) */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 /* */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16 /* (C) Copyright 1999 by Texas Instruments Incorporated, All Rights Reserved*/
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 /****************************************************************************/
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20 #ifndef _WINDOWS
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21 #include "config/rv.cfg"
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
22 #include "config/trace.cfg"
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
23 #endif
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
24
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
25 #include "rv/general.h"
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
26 #include "rv/rv.h"
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
27 #include "rv/rv_general.h"
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
28 #include "rvf/rvf_api.h"
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
29
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
30 #include "rvt/rvt_gen.h"
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
31
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
32 #include "rvm/rvm_use_id_list.h"
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
33
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
34 #include <string.h>
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
35
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
36 /* DAR files used to redirect trace to DAR entity */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
37 //#ifdef RVM_DAR_SWE
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
38 // #include "dar_api.h"
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
39 // #include "dar_gen.h"
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
40 // #include "dar_structs_i.h"
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
41 // #include "dar_diagnose_i.h"
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
42
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
43 /* Define a pointer to the DAR Global Environment Control block */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
44 // extern T_DAR_ENV_CTRL_BLK *dar_gbl_var_p;
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
45 //#endif
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
46
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
47 UINT8 rvf_trace_level = TRACE_LEVEL_FILTER;
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
48 UINT32 rvf_layer_mask = LAYER_DBG;
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
49
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
50 /* Decimal to hexadecimal conversion table */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
51 static const char Num2Char[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
52
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
53 extern T_RVT_USER_ID rv_trace_user_id;
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
54
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
55 #ifndef FRAMING_PROTOCOL
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
56 void rvf_send_trace1 (char * msg, UINT8 msg_length, UINT32 val, UINT8 TRACE_LEVEL, UINT32 swe_use_id)
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
57 {
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
58 UINT32 trace_type = swe_use_id;
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
59
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
60 /* Apply the appropriate compilation flags to filter trace messages based on
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
61 their type and level */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
62 if ((TRACE_LEVEL < RV_TRACE_LEVEL_WARNING) ||
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
63 ((TRACE_LEVEL <= rvf_trace_level) &&
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
64 (((trace_type & rvf_layer_mask & 0x0000FFFF) == (trace_type & 0x0000FFFF)) ||
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
65 ((trace_type & rvf_layer_mask & 0xFFFF0000) != (trace_type & 0xFFFF0000)))))
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
66 {
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
67 char * buff;
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
68
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
69 if (val == NULL_PARAM)
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
70 {
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
71 rvt_mem_alloc (rv_trace_user_id, msg_length, (T_RVT_BUFFER *)&buff);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
72 if (buff != NULL) /* Check if there is enough memory for the buffer */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
73 {
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
74 /* Copy the body of the message */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
75 memcpy( buff, msg, msg_length);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
76 rvt_send_trace_no_cpy( buff, rv_trace_user_id, msg_length, RVT_ASCII_FORMAT);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
77 }
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
78 }
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
79 else
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
80 {
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
81 rvt_mem_alloc (rv_trace_user_id, msg_length +11, (T_RVT_BUFFER *)&buff);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
82 if (buff != NULL) /* Check if there is enough memory for the buffer */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
83 {
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
84 UINT8 i;
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
85
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
86 /* Copy the body of the message */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
87 memcpy( buff, msg, msg_length);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
88
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
89 ((char *)buff)[msg_length] = ' ';
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
90 ((char *)buff)[msg_length + 1] = '0';
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
91 ((char *)buff)[msg_length + 2] = 'x';
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
92
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
93 for (i=0; i<8; i++)
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
94 {
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
95 ((char *)buff)[msg_length+3+i] = Num2Char[(UINT8)((val<<(i<<2))>>28)];
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
96 }
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
97 rvt_send_trace_no_cpy(buff, rv_trace_user_id, msg_length + 11, RVT_BINARY_FORMAT);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
98 }
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
99 }
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
100 }
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
101 }
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
102 #else
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
103 /********************************* VERSION WITH TRACE MUX **************************/
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
104
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
105 void rvf_send_trace1 (char * msg, UINT8 msg_length, UINT32 val, UINT8 TRACE_LEVEL, UINT32 swe_use_id)
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
106 {
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
107 UINT32 trace_type = swe_use_id;
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
108
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
109 /* Apply the appropriate compilation flags to filter trace messages based
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
110 on their type and level */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
111 if ((TRACE_LEVEL < RV_TRACE_LEVEL_WARNING) ||
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
112 ((TRACE_LEVEL <= rvf_trace_level) &&
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
113 (((trace_type & rvf_layer_mask & 0x0000FFFF) == (trace_type & 0x0000FFFF)) ||
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
114 ((trace_type & rvf_layer_mask & 0xFFFF0000) != (trace_type & 0xFFFF0000)))))
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
115 {
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
116 char * buff;
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
117
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
118 if (val == NULL_PARAM)
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
119 {
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
120 rvt_mem_alloc (rv_trace_user_id, msg_length+5, (T_RVT_BUFFER *)&buff);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
121
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
122 if (buff != NULL) /* Check if there is enough memory for the buffer */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
123 {
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
124 /* Add the trace type (MSB and LSB) and Trace level */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
125 buff [0] = (char) (trace_type >> 24);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
126 buff [1] = (char) (trace_type >> 16);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
127 buff [2] = (char) (trace_type >> 8);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
128 buff [3] = (char) (trace_type & 0xff);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
129 buff [4] = (char) TRACE_LEVEL;
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
130
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
131 /* Copy the message in the new buffer */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
132 memcpy(buff+5, msg, msg_length);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
133
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
134 /* Send the trace message */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
135 rvt_send_trace_no_cpy ((T_RVT_BUFFER) buff, rv_trace_user_id, msg_length+5, RVT_BINARY_FORMAT);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
136 }
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
137 }
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
138 else
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
139 {
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
140 rvt_mem_alloc (rv_trace_user_id, msg_length+16, (T_RVT_BUFFER *)&buff);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
141
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
142 if (buff != NULL) /* Check if there is enough memory for the buffer */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
143 {
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
144 UINT8 i;
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
145
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
146 /* Add the trace type (MSB and LSB) and Trace level */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
147 buff [0] = (char) (trace_type >> 24);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
148 buff [1] = (char) (trace_type >> 16);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
149 buff [2] = (char) (trace_type >> 8);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
150 buff [3] = (char) (trace_type & 0xff);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
151 buff [4] = (char) TRACE_LEVEL;
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
152
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
153 /* Copy the message in the new buffer */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
154 memcpy( buff + 5, msg, msg_length);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
155
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
156 buff[5+msg_length] = ' ';
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
157 buff[5+msg_length + 1] = '0';
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
158 buff[5+msg_length + 2] = 'x';
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
159
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
160 for (i=0; i<8; i++)
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
161 {
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
162 ((char *)buff)[8+msg_length+i] = Num2Char[(UINT8)((val<<(i<<2))>>28)];
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
163 }
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
164
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
165 /* Send the trace message */
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
166 rvt_send_trace_no_cpy ((T_RVT_BUFFER) buff, rv_trace_user_id, msg_length+16, RVT_BINARY_FORMAT);
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
167 }
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
168 }
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
169 }
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
170 }
21de8d8e6ea7 checking in Riviera code from the Sotomodem version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
171 #endif