comparison gsm-fw/riviera/rvf/rvf_target.h @ 143:afceeeb2cba1

Our nuc-fw is destined to become gsm-fw, so I went ahead and did the big hg mv
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 12 Nov 2013 05:35:48 +0000
parents nuc-fw/riviera/rvf/rvf_target.h@dd56546ad9e0
children
comparison
equal deleted inserted replaced
142:15d5977390c2 143:afceeeb2cba1
1 /****************************************************************************/
2 /* */
3 /* Name rvf_target.h */
4 /* */
5 /* Function this file contains definitions that will probably */
6 /* change for each target system. This includes */
7 /* such things number of tasks, */
8 /* little endian/big endian conversions, etc... */
9 /* */
10 /* */
11 /* NOTE This file should always be included first. */
12 /* */
13 /* Version 0.1 */
14 /* */
15 /* Date Modification */
16 /* ------------------------------------ */
17 /* 4/19/1999 Create */
18 /* 10/27/1999 remove declaration of ntohs, htons, ntohl, htonl */
19 /* in order to avoid conflict with winsock.h */
20 /* 12/23/1999 add buffer and memory bank related definition */
21 /* 07/12/2000 implement dynamic memory allocation. */
22 /* 01/16/2004 Corrected conversion from seconds/milliseconds to ticks. */
23 /* */
24 /* Author David Lamy-Charrier (dlamy@tif.ti.com) */
25 /* */
26 /* (C) Copyright 1999 by Texas Instruments Incorporated, All Rights Reserved*/
27 /****************************************************************************/
28 #ifndef _RVF_TARGET_H
29 #define _RVF_TARGET_H
30
31 #if 0 //#ifndef _WINDOWS
32 #include "config/rv.cfg"
33 #include "config/swconfig.cfg"
34 #endif
35
36 #include "../../include/config.h"
37
38 /* optimizations */
39 #ifdef _WINDOWS
40 #define INLINE __inline
41 #else
42 #define INLINE inline
43 #endif
44
45
46 /*----------------------------------------------------------------------*/
47 /* RVF Definitions */
48 /*----------------------------------------------------------------------*/
49
50
51 /* the maximum number of memory bank created by users */
52 #if (!GSMLITE)
53 #define RVF_MAX_TOTAL_MB 70
54 #else // GSMLITE
55 #define RVF_MAX_TOTAL_MB 20
56 #endif // GSMLITE
57
58 /* the maximum number of real memory bank managed */
59 #if (!GSMLITE)
60 #define RVF_MAX_REAL_MB 60
61 #else // GSMLITE
62 #define RVF_MAX_REAL_MB 20
63 #endif // GSMLITE
64
65 /* max length of memory bank name */
66 #define RVF_MAX_MB_LEN 10
67
68 /* max length of task name */
69 #define RVF_MAX_TASK_LEN 10
70
71
72 /* RVF_MB_MAPPING defines the correspondance between mb_name and mb_id */
73 /* WARNING!!!! When adding new memory banks in this default list, take care */
74 /* to always finish with the {0,0} !!! */
75 #if (!GSMLITE)
76 #define RVF_MB_MAPPING {{ "RVM_PRIM", 0},{ "TEST1", 1}, { "TEST2", 2},\
77 { "TEST3", 3}, { "TEST4", 3},\
78 {"HCI_RX", 4},{"HCI_TX", 5},\
79 {"ATP_PRIM",27},{"ATP_UART",27},\
80 {"RV_TRACE", TRACE_MB_ID},\
81 {"UWIRE_PRIM",37},{0,0}}
82 #else // GSMLITE
83 #define RVF_MB_MAPPING {{ "RVM_PRIM", 0},{ "TEST1", 1}, { "TEST2", 2},\
84 { "TEST3", 3}, { "TEST4", 3}, {0,0}}
85 #endif // GSMLITE
86
87 /* set the following variable to 1 to check for buffer corruption*/
88 #define RVF_ENABLE_BUF_CORRUPTION_CHECK 1
89
90 /* set the following variable to 1 to check for buffer linkage*/
91 #define RVF_ENABLE_BUF_LINKAGE_CHECK 1
92
93 /* enable or disable memory statistics functions */
94 #define RVF_ENABLE_STATS 1
95
96
97 /* The maximum number of RVF tasks allowed in the system*/
98 #if (!GSMLITE)
99 #define MAX_RVF_TASKS 30
100 #else // GSMLITE
101 #define MAX_RVF_TASKS 11
102 #endif // GSMLITE
103
104 /* max number of callback functions for buffers waiting to be counted on another memory bank */
105 #if (!GSMLITE)
106 #define RVF_MAX_WAITING_BUF 300
107 #else // GSMLITE
108 #define RVF_MAX_WAITING_BUF 20
109 #endif // GSMLITE
110 /* sum of RVF_BUFi_MAX */
111
112
113
114
115
116
117
118 /***********************************************************************
119 ** Timer related definitions. These should be edited per system. The
120 ** macros should convert milliseconds and seconds to system ticks.
121 ** Applications should use these to calculate the number of ticks to
122 ** sleep for.
123 */
124
125 #ifdef _WINDOWS
126 #define RVF_MS_TO_TICKS(_x) ((_x) / 50)
127 #define RVF_SECS_TO_TICKS(_x) (((_x) * 1000) / 50)
128 #define RVF_TICKS_TO_MS(_x) ((_x) * 50)
129 #else
130 /*
131 * To avoid floating point computation, the tick duration 4.615 ms can be
132 * resolved to the fraction : 923/200.
133 *
134 * Due to the multiplication with 200, the maximum usable value for
135 * milliseconds is 2^32 / 200 = 21,474,836. The maximum usable value
136 * for seconds is 2^32 / (200 * 1000) = 21,474.
137 * Both values correspond approximately to 5h 57m 54s.
138 */
139 #define RVF_MS_TO_TICKS(_x) ((((_x) * 200) + 462) / 923)
140 #define RVF_SECS_TO_TICKS(_x) ((((_x) * 1000 * 200) + 462) / 923)
141 #define RVF_TICKS_TO_MS(_x) ((((_x) * 923) + 100) / 200)
142 #endif
143
144 #endif /* _RVF_TARGET_H */