annotate gsm-fw/gpf/tst_pei/tst_pei.c @ 909:16ed75e266f2

rvinterf LCD output inversion option implemented
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 07 Sep 2015 17:25:30 +0000
parents 06ab60fec942
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
322
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 +------------------------------------------------------------------------------
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 | File: tst_pei.c
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 +------------------------------------------------------------------------------
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 | Copyright 2004 Texas Instruments Deutschland, AG
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 | All rights reserved.
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 |
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 | This file is confidential and a trade secret of Texas
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 | Instruments Berlin, AG
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 | The receipt of or possession of this file does not convey
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 | any rights to reproduce or disclose its contents or to
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 | manufacture, use, or sell anything it may describe, in
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 | whole, or in part, without the specific written consent of
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14 | Texas Instruments Deutschland, AG.
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 +-----------------------------------------------------------------------------
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16 | Purpose : This Modul contains the PEI interface of TST
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 +-----------------------------------------------------------------------------
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18 */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20 #ifndef __TST_PEI_C__
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21 #define __TST_PEI_C__
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
22 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
23
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
24 #define ENTITY_TST
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
25
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
26 /*==== INCLUDES ===================================================*/
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
27
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
28 #include <string.h>
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
29 #include <stdio.h>
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
30 #include <stdlib.h>
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
31
324
7228920a0834 gsm-fw/gpf/tst_pei: objects compile
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 322
diff changeset
32 #include "gpfconf.h"
7228920a0834 gsm-fw/gpf/tst_pei: objects compile
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 322
diff changeset
33 #define _FF_RV_EXIST_ 1
7228920a0834 gsm-fw/gpf/tst_pei: objects compile
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 322
diff changeset
34
322
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
35 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
36 #include "frame_const.h"
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
37 #include <stdlib.h>
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
38 #endif /* _TOOLS_ */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
39
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
40 #ifndef _TARGET_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
41 #include "printtofile.h"
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
42 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
43
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
44 #include "typedefs.h"
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
45 #include "vsi.h"
324
7228920a0834 gsm-fw/gpf/tst_pei: objects compile
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 322
diff changeset
46 #include "../frame/frame.h"
322
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
47 #include "pei.h"
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
48 #include "os.h"
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
49 #include "tools.h"
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
50 #include "gdi.h"
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
51 #include "os.h"
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
52 #include "frm_defs.h"
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
53 #include "frm_types.h"
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
54 #include "frm_glob.h"
324
7228920a0834 gsm-fw/gpf/tst_pei: objects compile
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 322
diff changeset
55 #include "../frame/route.h"
322
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
56 #include "drvconf.h"
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
57 #include "tstdriver.h"
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
58 #include "tstheader.h"
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
59 #include "tst_mux.h"
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
60 #include "pcon.h"
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
61
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
62 #ifdef CTB
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
63 #include "tst_primitives.h"
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
64 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
65
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
66 #ifdef _PSOS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
67 #include "pna.h"
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
68 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
69
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
70 #ifdef _FF_RV_EXIST_
324
7228920a0834 gsm-fw/gpf/tst_pei: objects compile
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 322
diff changeset
71 #include "../../services/ffs/ffs_api.h"
322
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
72 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
73
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
74 /*==== TYPES ======================================================*/
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
75
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
76 #undef VSI_CALLER
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
77 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
78 #define VSI_CALLER TST_Handle,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
79 #else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
80 #define VSI_CALLER e_running[os_MyHandle()],
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
81 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
82
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
83 /*==== CONSTANTS ==================================================*/
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
84
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
85 #ifdef _VXWORKS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
86 #define TST_STACKSIZE 8192
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
87 #define TST_PRIORITY 190 /* priority (1->high, 255->low) */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
88 #else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
89 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
90 #define TST_STACKSIZE 4096
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
91 #define TST_PRIORITY 15
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
92 #define TST_SND_PRIORITY 15 /* priority (1->low, 255->high) */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
93 #define TST_RCV_PRIORITY 15 /* priority (1->low, 255->high) */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
94 #else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
95 #define TST_STACKSIZE 1024
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
96 #define TST_PRIORITY 2
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
97 #define TST_SND_PRIORITY 6 /* priority (1->low, 255->high) */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
98 #define TST_RCV_PRIORITY 7 /* priority (1->low, 255->high) */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
99 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
100 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
101
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
102 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
103 #define TST_TIMERS 2
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
104 #define GET_STACK_TIME_TIMER_INDEX 0
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
105 #define GET_STACK_TIME_TIMER_DURATION 60000
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
106 #define TST_SYNC_TIMER_INDEX 1
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
107 #define TST_SYNC_TIMER_DURATION 2000
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
108 #else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
109 #define TST_TIMERS 0
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
110 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
111
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
112 #ifdef _FF_RV_EXIST_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
113 #define TRACEMASKFILE "/var/dbg/tracemask"
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
114 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
115
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
116 #define DRV_CALLBACK_OPC 0
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
117
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
118 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
119 #define TR_RCV_BUF_SIZE (MAX_PRIM_PARTITION_SIZE)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
120 #define TR_MAX_IND (TR_RCV_BUF_SIZE-1)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
121 USHORT MaxEntities = MAX_ENTITIES;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
122 #endif /* _TOOLS_ */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
123
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
124 /*==== EXTERNALS ==================================================*/
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
125
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
126 #ifndef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
127 extern const T_PCON_PROPERTIES *pcon;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
128 extern const USHORT TST_SndQueueEntries;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
129 extern const USHORT TST_RcvQueueEntries;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
130 extern const USHORT TST_SndStacksize;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
131 extern const USHORT TST_RcvStacksize;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
132 extern UBYTE FrameEnv;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
133 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
134
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
135 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
136 __declspec (dllimport) UBYTE SuppressOK;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
137 #else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
138 extern char *str2ind_version;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
139 extern UBYTE SuppressOK;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
140 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
141
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
142 #ifdef CTB
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
143 static T_HANDLE hCommIDLE = VSI_ERROR;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
144 extern short idle_pei_create (T_PEI_INFO const ** info);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
145 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
146
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
147 #ifdef _FF_RV_EXIST_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
148 extern char TaskName[];
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
149 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
150
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
151 /*==== VARIABLES ==================================================*/
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
152
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
153 #ifndef RUN_INT_RAM
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
154
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
155 T_HANDLE TST_Handle;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
156 T_HANDLE RCV_Handle;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
157 T_HANDLE TIF_Handle;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
158
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
159 UBYTE TST_DrvState = TST_DRV_DISCONNECTED;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
160 static char const *ok_string = "OK";
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
161 static UBYTE frmenv;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
162
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
163 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
164 ULONG TR_RcvBufferSize = TR_RCV_BUF_SIZE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
165 ULONG TR_MaxInd = TR_MAX_IND;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
166 int tst_syncronized = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
167 int tst_message_received = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
168 int tst_sync_timeout_cnt = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
169 int tst_max_sync_timeout = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
170 int tst_sync_mode = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
171 int tst_sync_sucess = 1;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
172 int tst_sync_started = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
173 int tst_status_received = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
174 T_HANDLE tst_sync_req_handle = VSI_ERROR;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
175 char sync_req_name[RESOURCE_NAMELEN];
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
176 char sync_req_time[16];
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
177
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
178 #endif /* _TOOLS_ */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
179
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
180 GLOBAL USHORT tst_task_priority = TST_PRIORITY;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
181 GLOBAL ULONG tst_task_stack_size = TST_STACKSIZE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
182
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
183 extern SHORT tst_pei_primitive (void *primitive);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
184
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
185 #endif /* RUN_INT_RAM */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
186
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
187 #ifdef RUN_INT_RAM
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
188
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
189 extern T_HANDLE TST_Handle;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
190 extern T_HANDLE RCV_Handle;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
191 extern T_HANDLE TIF_Handle;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
192 extern UBYTE TST_DrvState;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
193
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
194 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
195
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
196 #ifdef CTB
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
197 static char ctb_rcv[4];
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
198 static U32 ctb_remaining_tick_time=0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
199 BOOL ctb_tick_enabled = FALSE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
200 BOOL ctb_sent_to_tap = FALSE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
201 T_HANDLE idle_handle;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
202 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
203
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
204 /*==== FUNCTIONS ==================================================*/
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
205
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
206 #ifndef RUN_FLASH
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
207 /*
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
208 +--------------------------------------------------------------------+
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
209 | PROJECT : GSM-GPF (8415) MODULE : TST_PEI |
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
210 | STATE : code ROUTINE : pei_primitive |
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
211 +--------------------------------------------------------------------+
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
212 */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
213
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
214 SHORT tst_pei_primitive (void *primitive)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
215 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
216 T_PRIM_HEADER *prim = (T_PRIM_HEADER*)primitive;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
217 #ifndef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
218 T_VOID_STRUCT *prim_ptr = NULL;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
219 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
220 SHORT ret = PEI_OK;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
221
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
222 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
223 if ( ((SAP_NR(prim->opc)==TRACE_SAP) || (prim->opc==TRACE_OPC)) && (P_SHO(prim)!=0) )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
224 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
225 prim->opc = SYS_MASK;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
226 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
227 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
228
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
229 if ( (SAP_NR(prim->opc)!=TRACE_SAP) && (prim->opc!=TRACE_OPC) && !(prim->opc & SYS_MASK) )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
230 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
231 #ifndef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
232 prim_ptr = (T_VOID_STRUCT*)(((T_PRIM_X*)prim)->prim_ptr);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
233 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
234 VSI_PPM_RCV(prim_ptr);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
235 PTRACE_OUT(prim->opc );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
236 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
237
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
238 if ( TST_DrvState == TST_DRV_CONNECTED )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
239 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
240 if ( vsi_d_write ( TST_Handle, TIF_Handle, primitive, prim->len ) != VSI_OK )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
241 ret = PEI_ERROR;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
242 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
243 vsi_t_sleep(TST_Handle,10);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
244 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
245 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
246
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
247 #ifndef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
248 if ( prim_ptr != NULL )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
249 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
250 FREE(P2D(prim_ptr));
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
251 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
252 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
253 vsi_trc_free (0, (T_VOID_STRUCT**)&prim);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
254
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
255 return ( ret );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
256 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
257 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
258
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
259 #ifndef RUN_INT_RAM
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
260 /*
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
261 +--------------------------------------------------------------------+
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
262 | PROJECT : GSM-GPF (8415) MODULE : TST_PEI |
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
263 | STATE : code ROUTINE : pei_init |
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
264 +--------------------------------------------------------------------+
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
265 */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
266
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
267 LOCAL SHORT pei_init ( T_HANDLE handle )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
268 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
269 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
270 T_HANDLE h_pco;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
271 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
272
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
273 #ifdef _FF_RV_EXIST_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
274 T_HANDLE entityTraceMask;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
275 ULONG actual;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
276 T_FFS_FD fd;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
277 T_RV_RETURN retPath;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
278 BOOL gotAll = TRUE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
279 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
280
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
281 TST_Handle = handle;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
282 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
283 while (vsi_c_open (0, FRM_RCV_NAME) < VSI_OK)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
284 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
285 vsi_t_sleep(0,100);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
286 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
287 frmenv = (UBYTE) pf_get_frameenv ();
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
288 if ( os_OpenQueue (0, FRM_PCO_NAME, &h_pco) == OS_OK ||
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
289 os_create_extq (FRM_PCO_NAME, &h_pco) == OS_OK)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
290 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
291 vsi_o_set_htrace (h_pco);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
292 #ifdef _DEBUG
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
293 fprintf (stdout,"TST: %s commH set to %d\n", FRM_PCO_NAME,h_pco);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
294 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
295 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
296 vsi_t_start ( handle, GET_STACK_TIME_TIMER_INDEX, GET_STACK_TIME_TIMER_DURATION );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
297 #else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
298 if ( vsi_c_open (TST_Handle, FRM_RCV_NAME) < VSI_OK )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
299 return PEI_ERROR;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
300 RCV_Handle = vsi_e_handle ( TST_Handle, FRM_RCV_NAME );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
301 frmenv = FrameEnv;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
302 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
303 #ifndef _TARGET_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
304 initPrintToFile();
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
305 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
306 if ( vsi_d_init ( TST_Handle ) != VSI_OK )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
307 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
308 #ifndef _TARGET_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
309 printf("SYSTEM ERROR: Driver initialization failed\n");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
310 vsi_o_assert ( TST_Handle, OS_SYST_ERR, __FILE__, __LINE__, "SYSTEM ERROR: Testinterface driver initialization failed" );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
311 #else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
312 ;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
313 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
314 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
315 TIF_Handle = vsi_d_open ( TST_Handle, (char*)TIF_NAME );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
316 vsi_d_setsignal ( TST_Handle, 0, DRV_SIGTYPE_READ|DRV_SIGTYPE_CONNECT|DRV_SIGTYPE_DISCONNECT);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
317 vsi_d_setconfig ( TST_Handle, 0, NULL );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
318 vsi_trcsuspend ( TST_Handle, TST_Handle, OS_NO_SUSPEND );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
319 SuppressOK = FALSE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
320 tst_mux_init();
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
321
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
322 #ifdef _FF_RV_EXIST_
490
06ab60fec942 gsm-fw/gpf/tst_pei/tst_pei.c: use FFS_O_RDONLY when reading tracemask file
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 324
diff changeset
323 fd = ffs_open(TRACEMASKFILE, FFS_O_RDONLY);
322
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
324 if (fd < 0)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
325 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
326 // could not open nor create /var/dbg/tracemask warning
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
327 vsi_o_ttrace(NO_TASK, TC_SYSTEM, "pei_init: no trace mask in FFS");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
328 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
329 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
330 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
331 InitializeTrace();
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
332 TraceMask[0] = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
333 TraceMask[0] |= TC_SYSTEM|TC_ERROR;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
334 for (entityTraceMask = 0; entityTraceMask < (MaxEntities + 1); entityTraceMask++)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
335 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
336 actual = TraceMask[entityTraceMask];
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
337 if (ffs_read(fd, (void*)&TraceMask[entityTraceMask], sizeof(ULONG) ) != sizeof(ULONG) )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
338 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
339 gotAll = FALSE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
340 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
341 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
342 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
343 if (entityTraceMask == 0) // first element
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
344 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
345 TraceMask[0] = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
346 TraceMask[0] |= TC_SYSTEM|TC_ERROR;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
347 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
348 if (actual != TraceMask[entityTraceMask])
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
349 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
350 // not the default trace mask, generate warning
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
351 if ( vsi_e_name ( 0, entityTraceMask, TaskName ) == VSI_OK )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
352 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
353 vsi_o_ttrace(NO_TASK, TC_SYSTEM, "pei_init: FFS trace mask gave 0x%08x for %s (default 0x%08x)", TraceMask[entityTraceMask], TaskName, actual);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
354 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
355 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
356 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
357 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
358 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
359 ffs_close(fd);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
360 if (!gotAll)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
361 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
362 vsi_o_ttrace(NO_TASK, TC_SYSTEM, "pei_init: some trace masks can't be read from FFS");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
363 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
364 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
365
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
366 return PEI_OK;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
367 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
368 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
369
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
370
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
371
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
372 #ifndef RUN_INT_RAM
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
373 /*
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
374 +--------------------------------------------------------------------+
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
375 | PROJECT : GSM-GPF (8415) MODULE : TST_PEI |
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
376 | STATE : code ROUTINE : pei_exit |
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
377 +--------------------------------------------------------------------+
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
378 */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
379
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
380 static SHORT pei_exit (void)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
381 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
382 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
383 T_HANDLE rcvh=vsi_p_handle (0, FRM_RCV_NAME);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
384 if (rcvh > VSI_OK)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
385 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
386 /* exit RCV process */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
387 vsi_p_exit ( TST_Handle, vsi_p_handle (0, FRM_RCV_NAME));
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
388 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
389 /* exit all drivers */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
390 vsi_d_exit ( TST_Handle, 0);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
391 #endif /* _TOOLS_ */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
392
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
393 return PEI_OK;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
394 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
395 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
396
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
397 #ifndef RUN_INT_RAM
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
398 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
399 /*
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
400 +--------------------------------------------------------------------+
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
401 | PROJECT : GSM-GPF (8415) MODULE : TST_PEI |
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
402 | STATE : code ROUTINE : pei_timeout |
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
403 +--------------------------------------------------------------------+
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
404 */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
405
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
406 LOCAL SHORT pei_timeout (USHORT index)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
407 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
408
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
409 switch ( index )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
410 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
411 case GET_STACK_TIME_TIMER_INDEX:
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
412 #if 0
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
413 if ( tst_message_received == 1 )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
414 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
415 tst_drv_write ( NO_TASK, SYS_MASK, FRM_TST_NAME, (char*)SYSPRIM_GET_STACK_TIME );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
416 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
417 vsi_t_start ( VSI_CALLER GET_STACK_TIME_TIMER_INDEX, GET_STACK_TIME_TIMER_DURATION );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
418 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
419 break;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
420 case TST_SYNC_TIMER_INDEX:
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
421 if ( tst_sync_timeout_cnt++ >= tst_max_sync_timeout-1 )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
422 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
423 T_HANDLE tif_handle;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
424 T_VOID_STRUCT *ptr;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
425
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
426 tst_status_received = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
427 tst_sync_timeout_cnt = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
428 tst_sync_mode = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
429 tst_sync_sucess = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
430 tif_handle = vsi_d_open ( TST_Handle, (char*)TIF_NAME );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
431 vsi_d_setconfig ( TST_Handle, tif_handle, DISABLE_SYNC_MODE );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
432 vsi_t_stop ( TST_Handle, TST_SYNC_TIMER_INDEX );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
433 ptr = vsi_c_pnew ( sizeof(T_PRIM_HEADER)+strlen(SYSPRIM_TST_SYNC_REJ), 0x8000 FILE_LINE );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
434 strcpy ( (char*)ptr, SYSPRIM_TST_SYNC_REJ );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
435 vsi_c_psend ( tst_sync_req_handle, ptr );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
436 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
437 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
438 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
439 if ( tst_syncronized == 0 )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
440 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
441 T_HANDLE tif_handle;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
442 tst_sync_sucess = 1;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
443 tst_status_received = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
444 tif_handle = vsi_d_open ( TST_Handle, (char*)TIF_NAME );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
445 vsi_d_setconfig ( TST_Handle, tif_handle, ENABLE_SYNC_MODE );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
446 tst_drv_write ( NO_TASK, SYS_MASK, FRM_RCV_NAME, (char*)"TRACECLASS 0x10" );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
447 vsi_t_sleep ( TST_Handle, 100 );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
448 tst_drv_write ( NO_TASK, SYS_MASK, FRM_RCV_NAME, (char*)"STATUS TASK" );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
449 vsi_t_start ( TST_Handle, TST_SYNC_TIMER_INDEX, TST_SYNC_TIMER_DURATION );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
450 vsi_t_sleep ( TST_Handle, 200 );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
451 tst_drv_write ( NO_TASK, SYS_MASK, FRM_RCV_NAME, (char*)"ROUTING" );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
452 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
453 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
454 break;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
455 default:
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
456 break;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
457 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
458 return PEI_OK;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
459 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
460 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
461 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
462
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
463 #ifndef RUN_INT_RAM
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
464 /*
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
465 +--------------------------------------------------------------------+
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
466 | PROJECT : GSM-GPF (8415) MODULE : TST_PEI |
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
467 | STATE : code ROUTINE : pei_signal |
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
468 +--------------------------------------------------------------------+
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
469 */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
470 LOCAL SHORT pei_signal (ULONG SignalType, void *ptr)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
471 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
472 /*
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
473 * the following line of code causes a warning on tms470 compiler, that cannot be avoided
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
474 * without changing the PEI interface. Warning will not cause a problem
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
475 */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
476 T_VOID_STRUCT *sig_ptr = (T_VOID_STRUCT*)ptr;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
477 T_PRIM_HEADER *prim;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
478 T_S_HEADER *s_hdr;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
479 T_HANDLE DestTaskHandle, DestComHandle;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
480 T_HANDLE min, max, i;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
481 unsigned int Length;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
482 ULONG Suspend, TraceMask, OldTraceMask;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
483 unsigned int Offset = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
484 char token[81];
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
485 UBYTE FreePrim = 1;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
486 SHORT ret = PEI_OK;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
487 USHORT processed = FALSE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
488
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
489 switch ( SignalType )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
490 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
491 case DRV_SIGTYPE_READ:
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
492 VSI_PPM_RCV(sig_ptr);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
493 if ( (prim = ((T_PRIM_X*)sig_ptr)->prim_ptr) != NULL )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
494 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
495 VSI_PPM_RCV (prim);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
496 s_hdr = (T_S_HEADER*)((ULONG*)prim + prim->sh_offset);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
497 DestTaskHandle = vsi_e_handle ( TST_Handle, s_hdr->rcv );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
498 if ( DestTaskHandle == VSI_ERROR )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
499 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
500 if ( !strcmp ( "IRQ", s_hdr->rcv ) )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
501 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
502 DestTaskHandle = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
503 OldTraceMask = TC_SYSTEM;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
504 TraceMask = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
505 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
506 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
507 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
508 if ( !strcmp ( "SYST", s_hdr->rcv ) )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
509 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
510 DestTaskHandle = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
511 vsi_gettracemask ( DestTaskHandle, 0, &OldTraceMask);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
512 TraceMask = TC_SYSTEM;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
513 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
514 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
515 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
516 OldTraceMask = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
517 TraceMask = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
518 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
519 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
520 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
521 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
522 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
523 /* to satisfy LINT */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
524 OldTraceMask = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
525 TraceMask = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
526 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
527 if ( DestTaskHandle != VSI_ERROR )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
528 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
529 if ( prim->opc & SYS_MASK )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
530 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
531 Length = GetNextToken ((char*)(P2D(prim)), token, " #");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
532 Offset = Length+1;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
533 if ( frmenv == ENV_STACK )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
534 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
535 /* Set Traceclass for non-frame tasks/HISRs */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
536 if ( DestTaskHandle == 0 && !strcmp (token, SYSPRIM_TRACECLASS_TOKEN) )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
537 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
538 Length = GetNextToken ((char *)(P2D(prim))+Offset, token, " #");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
539 TraceMask = ASCIIToHex(token, CHARS_FOR_32BIT);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
540 vsi_settracemask ( DestTaskHandle, 0, TraceMask|OldTraceMask); /* it is not allowed to switch of system traces */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
541 sprintf ( token, "%s (%s %s)", ok_string, (char*)(P2D(prim)), s_hdr->rcv );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
542 tst_drv_write ( NO_TASK, 0, NULL, token );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
543 processed = TRUE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
544 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
545 if (!strcmp (token, SYSPRIM_TRC_SUSPEND))
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
546 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
547 processed = TRUE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
548 /*
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
549 * set suspend for traces to SUSPEND or NO_SUSPEND
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
550 */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
551 Length = GetNextToken ((char *)(P2D(prim))+Offset, token, " #");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
552 Offset += (Length+1);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
553
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
554 if ( !strcmp ( token, "ALL" ) )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
555 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
556 min = 1;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
557 max = MaxEntities;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
558 GetNextToken ((char *)(P2D(prim))+Offset, token, " #");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
559 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
560 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
561 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
562 min = DestTaskHandle;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
563 max = min;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
564 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
565 if ( !strcmp ( token, "YES" ) )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
566 Suspend = 0xffffffff;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
567 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
568 Suspend = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
569
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
570 for ( i = min; i <= max; i++ )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
571 vsi_trcsuspend ( TST_Handle, i, Suspend );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
572 sprintf ( token, "%s (%s %s)", ok_string, (char*)(P2D(prim)), s_hdr->rcv );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
573 tst_drv_write ( NO_TASK, 0, NULL, token );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
574 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
575 else if (!strcmp (token, SYSPRIM_MEMCHECK_TOKEN))
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
576 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
577 processed = TRUE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
578 /*
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
579 * Memory Check
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
580 */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
581 for ( i = 1; i <= MaxEntities; i++ )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
582 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
583 if ( vsi_object_info (TST_Handle, OS_OBJTASK, (USHORT)i, token, sizeof(token)) != VSI_ERROR )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
584 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
585 tst_drv_write ( NO_TASK, 0, NULL, token );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
586 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
587 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
588 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
589 #ifdef CTB
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
590 #ifndef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
591 else if (!strcmp (token, SYSPRIM_TIMER_TICK_REQ))
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
592 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
593 processed = TRUE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
594 ctb_sent_to_tap = FALSE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
595 if(strlen(ctb_rcv)<3)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
596 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
597 strcpy(ctb_rcv, P_SND(prim));
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
598 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
599 ctb_remaining_tick_time = P_TIME(prim); //The time parameter is sent in the time stap.
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
600 /*sprintf ( token, "Requesting ticking for %d from %s", ctb_remaining_tick_time, ctb_rcv);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
601 tst_drv_write ( NO_TASK, 0, NULL, token );*/
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
602 PSIGNAL(hCommIDLE, IDLE_REQ, NULL);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
603 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
604 else if (!strcmp (token, SYSPRIM_INT_TICK_MODE_REQ))
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
605 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
606 processed = TRUE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
607 if(ctb_tick_enabled)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
608 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
609 vsi_p_delete (TST_Handle,idle_handle);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
610 ctb_tick_enabled = FALSE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
611 ctb_sent_to_tap = FALSE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
612 sprintf ( token, "Disabling Common Timer Base");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
613 ctb_rcv[0]='\0';
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
614 os_StartTicking();
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
615 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
616 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
617 sprintf ( token, "Common Timer Base already disabled");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
618 tst_drv_write ( NO_TASK, 0, NULL, token );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
619 if(!strcmp(P_SND(prim), "TAP"))
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
620 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
621 tst_drv_write ( NO_TASK, SYS_MASK, "TAP", "INT_TICK_MODE_CNF");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
622 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
623 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
624 else if (!strcmp (token, SYSPRIM_EXT_TICK_MODE_REQ))
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
625 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
626 processed = TRUE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
627 if(!ctb_tick_enabled)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
628 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
629 if ( (idle_handle = vsi_p_create (TST_Handle, idle_pei_create, NULL, 1)) == VSI_ERROR )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
630 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
631 vsi_o_assert ( TST_Handle, OS_SYST_ERR, __FILE__, __LINE__, "CTB: Cannot create IDLE task" );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
632 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
633 vsi_p_start (TST_Handle, idle_handle);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
634 while ( (hCommIDLE = vsi_e_handle ( TST_Handle, "IDLE" ))<VSI_OK)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
635 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
636 vsi_t_sleep(0,1000);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
637 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
638 os_StopTicking();
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
639 sprintf ( token, "Enabling Common Timer Base");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
640 ctb_tick_enabled = TRUE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
641 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
642 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
643 sprintf ( token, "Common Timer Base already enabled");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
644 tst_drv_write ( NO_TASK, 0, NULL, token );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
645 if(!strcmp(P_SND(prim), "TAP"))
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
646 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
647 char send_str[50];
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
648 char tmp_str[8];
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
649 //Get process id and put in this syst primitive.
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
650 strcpy(send_str,"EXT_TICK_MODE_CNF#");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
651 _itoa(os_GetProcessId(), tmp_str, 10);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
652 strcat(send_str, tmp_str);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
653 tst_drv_write ( NO_TASK, SYS_MASK, "TAP", send_str);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
654 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
655 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
656 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
657 #endif //CTB
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
658
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
659 #ifndef _TARGET_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
660 else if (!strcmp (token, SYSPRIM_SUPPRESS_OK))
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
661 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
662 processed = TRUE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
663 SuppressOK = TRUE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
664 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
665 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
666 else if (!strcmp (token, SYSPRIM_GET_STACK_TIME))
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
667 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
668 processed = TRUE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
669 tst_drv_write ( NO_TASK, SYS_MASK, FRM_TST_NAME, (char*)SYSPRIM_IS_STACK_TIME );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
670 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
671 else if (!strcmp (token, SYSPRIM_READ_ROUTING))
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
672 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
673 processed = TRUE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
674 i = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
675 while ( rt_RouteRead ( DestTaskHandle, token ) != RT_ERROR )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
676 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
677 tst_drv_write ( NO_TASK, 0, NULL, token );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
678 i++;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
679 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
680 if ( !i )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
681 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
682 sprintf ( token, "NO %s ROUTINGS STORED", s_hdr->rcv );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
683 tst_drv_write ( NO_TASK, 0, NULL, token );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
684 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
685 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
686 #ifndef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
687 else if (!strcmp (token, SYSPRIM_STR2IND_VERSION))
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
688 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
689 processed = TRUE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
690 tst_drv_write ( NO_TASK, 0, NULL, str2ind_version );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
691 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
692 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
693 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
694 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
695 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
696 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
697 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
698 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
699 /* synchronization with protocol stack */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
700 if ( tst_sync_mode == 1 )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
701 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
702 char *pos;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
703 char task_status;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
704 T_VOID_STRUCT *cmd_ptr;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
705
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
706 pos = strstr ( (char*)(P2D(prim)), "Name:" );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
707 if ( pos != NULL )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
708 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
709 tst_sync_started = 1;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
710 GetNextToken ((char *)(P2D(prim))+strlen("Name:"), token, " #");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
711 if ( strcmp(token,FRM_RCV_NAME) && strcmp(token,FRM_TST_NAME) && strcmp(token,"EXTR") )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
712 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
713 pos = strstr ( (char*)(P2D(prim)), "Stat:" );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
714 if ( pos != NULL )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
715 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
716 tst_status_received = 1;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
717 task_status = atoi(pos+strlen("Stat:"));
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
718 if ( task_status != 6 )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
719 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
720 tst_sync_sucess = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
721 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
722 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
723 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
724 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
725 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
726 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
727 if ( tst_sync_started == 1 )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
728 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
729 pos = strstr ( (char*)(P2D(prim)), "ROUTING" );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
730 if ( pos != NULL )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
731 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
732 if ( tst_sync_sucess == 1 && tst_status_received == 1 )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
733 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
734 T_HANDLE tif_handle = vsi_d_open ( TST_Handle, (char*)TIF_NAME );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
735 vsi_d_setconfig ( TST_Handle, tif_handle, DISABLE_SYNC_MODE );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
736 vsi_t_stop ( TST_Handle, TST_SYNC_TIMER_INDEX );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
737 cmd_ptr = vsi_c_pnew ( sizeof(T_PRIM_HEADER)+strlen(SYSPRIM_TST_SYNC_CNF), 0x8000 FILE_LINE );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
738 strcpy ( (char*)cmd_ptr, SYSPRIM_TST_SYNC_CNF );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
739 vsi_o_ttrace ( TST_Handle, TC_TIMER, "SYNC DONE") ;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
740 vsi_c_psend ( tst_sync_req_handle, cmd_ptr );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
741 tst_sync_mode = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
742 tst_sync_timeout_cnt = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
743 tst_syncronized = 1;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
744 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
745 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
746 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
747 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
748 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
749 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
750 #endif /* _TOOLS_ */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
751 if ( processed == FALSE )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
752 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
753 if ( ( DestComHandle = vsi_c_open ( TST_Handle, s_hdr->rcv ) ) != VSI_ERROR )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
754 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
755 /* free carrier */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
756 PFREE(P2D(sig_ptr));
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
757 FreePrim = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
758 vsi_c_psend (DestComHandle, (T_VOID_STRUCT*)P2D(prim) FILE_LINE_MACRO);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
759 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
760 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
761 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
762 #ifndef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
763 if ( frmenv == ENV_STACK )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
764 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
765 sprintf ( token, "SYSTEM WARNING: Receiver Process '%s' unknown", s_hdr->rcv );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
766 tst_drv_write ( NO_TASK, 0, NULL, token );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
767 ret = PEI_ERROR;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
768 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
769 #endif /* _TOOLS_ */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
770 /* free dyn_ptr if unknown receiver */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
771 FREE(P2D(prim));
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
772 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
773 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
774 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
775 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
776 /* free dyn_ptr if processed in TST */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
777 FREE(P2D(prim));
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
778 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
779 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
780
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
781 if ( FreePrim )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
782 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
783 /* free carrier */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
784 PFREE(P2D(sig_ptr));
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
785 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
786 break;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
787 case DRV_SIGTYPE_CONNECT:
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
788 TST_DrvState = TST_DRV_CONNECTED;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
789 #ifndef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
790 tst_drv_write ( NO_TASK, SYS_MASK, FRM_TST_NAME, (char*)SYSPRIM_IS_STACK_TIME );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
791 tst_drv_write ( NO_TASK, 0, NULL, str2ind_version );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
792 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
793 break;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
794 case DRV_SIGTYPE_DISCONNECT:
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
795 TST_DrvState = TST_DRV_DISCONNECTED;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
796 #ifdef _PSOS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
797 /* for pSOS: send empty message to TST */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
798 if ( vsi_d_open ( TST_Handle, "SOCKET" ) != VSI_ERROR )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
799 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
800 T_QMSG Message;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
801 static T_HANDLE tst_handle = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
802
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
803 if( TST_Handle > 0 )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
804 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
805 Message.MsgType = MSG_PRIMITIVE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
806 Message.Msg.Primitive.Prim = NULL;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
807 Message.Msg.Primitive.PrimLen = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
808 #ifdef MEMORY_SUPERVISION
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
809 vsi_c_send (TST_Handle, TST_Handle, &Message, __FILE__, __LINE__);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
810 #else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
811 vsi_c_send (TST_Handle, TST_Handle, &Message);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
812 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
813 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
814 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
815 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
816 break;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
817 #ifdef CTB
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
818 case IDLE_CNF:
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
819 if(ctb_remaining_tick_time > 0 && ctb_tick_enabled && !ctb_sent_to_tap)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
820 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
821 os_Tick();
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
822 PSIGNAL(hCommIDLE, IDLE_REQ, NULL);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
823 ctb_remaining_tick_time = ctb_remaining_tick_time-50;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
824 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
825 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
826 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
827 /*sprintf ( token, "Ticking finished - remaining time %d", ctb_remaining_tick_time);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
828 tst_drv_write ( NO_TASK, 0, NULL, token );*/
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
829 if(!strcmp(ctb_rcv, "TAP"))
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
830 tst_drv_write ( NO_TASK, SYS_MASK, FRM_TST_NAME, SYSPRIM_IS_STACK_TIME ); //Synchronize time with tools
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
831 tst_drv_write ( NO_TASK, SYS_MASK, ctb_rcv, "TIMER_TICK_CNF");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
832 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
833 break;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
834 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
835 default:
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
836 sprintf ( token, "Unhandled PSIGNAL");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
837 tst_drv_write ( NO_TASK, 0, NULL, token );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
838 break;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
839 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
840 return ( ret );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
841 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
842 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
843
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
844 #ifndef RUN_INT_RAM
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
845 /*
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
846 +--------------------------------------------------------------------+
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
847 | PROJECT : GSM-GPF (8415) MODULE : TST_PEI |
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
848 | STATE : code ROUTINE : pei_config |
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
849 +--------------------------------------------------------------------+
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
850 */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
851
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
852 LOCAL SHORT pei_config (char * inString)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
853 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
854 T_HANDLE drv_handle;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
855 char token[80];
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
856 unsigned int length, offset;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
857 BOOL select = 0,config = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
858 T_TST_DRV_ENTRY *tst_drv_info;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
859
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
860 length = GetNextToken (inString, token, " #");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
861 offset = length+1;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
862 if ( !strcmp ( token, "DRIVER") )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
863 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
864 length = GetNextToken (inString+offset, token, " #");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
865 offset += (length+1);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
866 if ( !strcmp ( token, "FLUSH") )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
867 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
868 vsi_d_flush ( TST_Handle, 0 );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
869 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
870 if ( !strcmp ( token, "SELECT") )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
871 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
872 select = 1;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
873 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
874 if ( !strcmp ( token, "CONFIG") )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
875 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
876 config = 1;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
877 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
878 tst_syncronized = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
879 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
880 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
881 length = GetNextToken (inString+offset, token, " #");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
882 offset += (length+1);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
883 if ( select )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
884 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
885 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
886 if ( !strcmp(NODRV_NAME,token) )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
887 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
888 if ( tst_drv_open ( token, &tst_drv_info ) == VSI_ERROR ||
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
889 vsi_d_create ( TST_Handle, tst_drv_info ) == VSI_ERROR)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
890 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
891 return PEI_ERROR;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
892 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
893 PrintToFile("TST: all drivers unloaded\n");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
894 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
895 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
896 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
897 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
898 /* check if driver is already loaded */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
899 if ( (drv_handle = vsi_d_open ( TST_Handle, token )) == VSI_ERROR )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
900 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
901 if ( tst_drv_open ( token, &tst_drv_info ) == VSI_ERROR ||
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
902 vsi_d_create ( TST_Handle, tst_drv_info ) == VSI_ERROR )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
903 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
904 return PEI_ERROR;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
905 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
906 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
907 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
908 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
909 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
910 #ifdef _DEBUG
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
911 PrintToFile("TST: keeping %s loaded\n",token);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
912 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
913 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
914 vsi_d_close( TST_Handle, drv_handle );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
915 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
916 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
917 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
918 if ( config )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
919 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
920 if ( ( drv_handle = vsi_d_open ( TST_Handle, token ) ) == VSI_ERROR )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
921 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
922 return PEI_ERROR;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
923 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
924 if (vsi_d_setconfig ( TST_Handle, drv_handle, inString+offset) != VSI_OK)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
925 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
926 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
927 char text[99];
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
928 _snprintf(text,98,"TST: Error configuring driver %s with \"%s\" :-(",token, inString+offset);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
929 vsi_o_ttrace(NO_TASK, TC_SYSTEM, text);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
930 #endif /* _TOOLS_ */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
931 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
932 vsi_d_close( TST_Handle, drv_handle );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
933 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
934 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
935 else if ( !strcmp ( token, "THIF") )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
936 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
937 T_HANDLE tif_handle;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
938 tif_handle = vsi_d_open ( TST_Handle, (char*)TIF_NAME );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
939 length = GetNextToken (inString+offset, token, " #");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
940 offset += (length+1);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
941
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
942 if ( !strcmp ( token, "OPEN") )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
943 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
944 vsi_d_setconfig ( TST_Handle, tif_handle, token );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
945 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
946 else if ( !strcmp ( token, "CLOSE") )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
947 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
948 vsi_d_setconfig ( TST_Handle, tif_handle, token );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
949 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
950 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
951 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
952 else if ( !strcmp ( token, SYSPRIM_TST_SYNC_REQ) )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
953 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
954 T_HANDLE tif_handle;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
955 unsigned int len;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
956
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
957 len = GetNextToken (inString+offset, sync_req_name, " #");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
958 offset += len;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
959 len = GetNextToken (inString+offset, sync_req_time, " #");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
960 tst_max_sync_timeout = (atoi(sync_req_time) - 1000)/TST_SYNC_TIMER_DURATION;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
961
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
962 tst_sync_req_handle = vsi_c_open ( TST_Handle, sync_req_name );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
963 if ( tst_sync_req_handle != VSI_ERROR )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
964 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
965 if ( tst_syncronized == 0 )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
966 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
967 tst_sync_started = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
968 tst_status_received = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
969 tst_sync_mode = 1;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
970 tst_sync_sucess = 1;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
971 tif_handle = vsi_d_open ( TST_Handle, (char*)TIF_NAME );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
972 vsi_d_setconfig ( TST_Handle, tif_handle, ENABLE_SYNC_MODE );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
973 tst_drv_write ( NO_TASK, SYS_MASK, FRM_RCV_NAME, (char*)"TRACECLASS 0x10" );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
974 vsi_t_sleep ( TST_Handle, 100 );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
975 tst_drv_write ( NO_TASK, SYS_MASK, FRM_RCV_NAME, (char*)"STATUS TASK" );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
976 vsi_t_start ( TST_Handle, TST_SYNC_TIMER_INDEX, TST_SYNC_TIMER_DURATION );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
977 vsi_t_sleep ( TST_Handle, 200 );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
978 tst_drv_write ( NO_TASK, SYS_MASK, FRM_RCV_NAME, (char*)"ROUTING" );
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
979 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
980 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
981 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
982 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
983 #ifdef _FF_RV_EXIST_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
984 else if ( !strcmp ( token, "TRACEMASK_IN_FFS") )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
985 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
986 int amount;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
987 T_FFS_FD fd;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
988 T_FFS_RET ret;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
989 T_FFS_SIZE written;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
990 T_FFS_DIR dir;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
991 BOOL writeFailed = FALSE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
992 if (vsi_e_handle ( TST_Handle, FRM_RCV_NAME ) == e_running[os_MyHandle()]) // config prim processing only allowed in RCV, not TST!
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
993 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
994 fd = ffs_open(TRACEMASKFILE, FFS_O_RDWR | FFS_O_CREATE | FFS_O_TRUNC);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
995 if (fd < 0)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
996 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
997 // could not open nor create /var/dbg/tracemask warning
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
998 vsi_o_ttrace(NO_TASK, TC_SYSTEM, "pei_config: could not open/create FFS trace mask, reason is 0x%x", fd);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
999 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1000 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1001 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1002 TraceMask[0] = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1003 TraceMask[0] |= TC_SYSTEM|TC_ERROR;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1004 amount = sizeof(ULONG) * (MaxEntities + 1);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1005 written = ffs_write(fd, (void*)&TraceMask[0], amount);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1006 if (written != amount)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1007 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1008 if (written >= 0)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1009 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1010 amount -= written;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1011 vsi_o_ttrace(NO_TASK, TC_SYSTEM, "pei_config: writing to FFS, second try");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1012 written = ffs_write(fd, (void*)&TraceMask[0], amount);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1013 if (written != amount)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1014 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1015 writeFailed = TRUE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1016 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1017 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1018 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1019 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1020 writeFailed = TRUE;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1021 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1022 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1023 if (writeFailed)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1024 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1025 vsi_o_ttrace(NO_TASK, TC_SYSTEM, "pei_config: ffs_write to FFS failed with 0x%x, did open with", written, fd);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1026 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1027 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1028 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1029 if (ffs_fdatasync(fd) == EFFS_OK)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1030 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1031 vsi_o_ttrace(NO_TASK, TC_SYSTEM, "pei_config: successfully written trace mask to FFS");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1032 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1033 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1034 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1035 vsi_o_ttrace(NO_TASK, TC_SYSTEM, "pei_config: flushing FFS trace mask failed!");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1036 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1037 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1038 ffs_close(fd);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1039 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1040 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1041 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1042 else if ( !strcmp ( token, "NO_TRACEMASK_IN_FFS") )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1043 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1044 T_FFS_RET ret;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1045
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1046 InitializeTrace();
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1047 TraceMask[0] = 0;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1048 TraceMask[0] |= TC_SYSTEM|TC_ERROR;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1049 if (vsi_e_handle ( TST_Handle, FRM_RCV_NAME ) == e_running[os_MyHandle()]) // config prim processing only allowed in RCV, not TST!
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1050 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1051 ret = ffs_remove(TRACEMASKFILE);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1052 if (ret != EFFS_OK)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1053 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1054 vsi_o_ttrace(NO_TASK, TC_SYSTEM, "pei_config: failed to remove FFS trace mask, reason is 0x%x", ret);
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1055 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1056 else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1057 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1058 vsi_o_ttrace(NO_TASK, TC_SYSTEM, "pei_config: successfully removed FFS trace mask");
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1059 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1060 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1061 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1062 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1063 return PEI_OK;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1064 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1065 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1066
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1067 #ifndef RUN_INT_RAM
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1068 GLOBAL SHORT tstsnd_pei_create ( T_PEI_INFO ** info)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1069 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1070 static T_PEI_INFO data =
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1071 { "TST",
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1072 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1073 pei_init,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1074 pei_exit,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1075 tst_pei_primitive,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1076 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1077 pei_timeout,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1078 #else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1079 NULL,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1080 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1081 NULL,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1082 NULL,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1083 pei_config,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1084 NULL
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1085 },
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1086 TST_STACKSIZE,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1087 0,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1088 TST_SND_PRIORITY,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1089 TST_TIMERS,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1090 (PASSIVE_BODY|COPY_BY_REF|SYSTEM_PROCESS|TRC_NO_SUSPEND)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1091 };
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1092
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1093 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1094 data.QueueEntries = TST_QUEUE_ENTRIES;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1095 #else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1096 data.QueueEntries = TST_SndQueueEntries;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1097 /*
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1098 * This way of setting the TST and RCV stacksize is chosen to keep it backwardscompatible,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1099 * i.e. not change the behavior if the stacksizes are not define in the configuration
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1100 * file xxxconst.h.
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1101 */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1102 if ( TST_SndStacksize > 0 )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1103 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1104 data.StackSize = TST_SndStacksize;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1105 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1106 if ( pcon != NULL )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1107 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1108 data.StackSize += pcon->stack_offset;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1109 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1110 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1111 *info = &data;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1112 return PEI_OK;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1113 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1114 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1115
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1116 #ifndef RUN_INT_RAM
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1117 GLOBAL SHORT tstrcv_pei_create ( T_PEI_INFO ** info)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1118 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1119 static T_PEI_INFO data =
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1120 { "RCV",
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1121 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1122 NULL,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1123 NULL,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1124 NULL,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1125 NULL,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1126 pei_signal,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1127 NULL,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1128 pei_config,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1129 NULL
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1130 },
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1131 TST_STACKSIZE,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1132 0,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1133 TST_RCV_PRIORITY,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1134 TST_TIMERS,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1135 (PASSIVE_BODY|COPY_BY_REF|SYSTEM_PROCESS|TRC_NO_SUSPEND)
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1136 };
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1137
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1138 #ifdef _TOOLS_
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1139 data.QueueEntries = TST_QUEUE_ENTRIES;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1140 #else
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1141 data.QueueEntries = TST_RcvQueueEntries;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1142 /*
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1143 * This way of setting the TST and RCV stacksize is chosen to keep it backwardscompatible,
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1144 * i.e. not change the behavior if the stacksizes are not define in the configuration
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1145 * file xxxconst.h.
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1146 */
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1147 if ( TST_RcvStacksize > 0 )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1148 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1149 data.StackSize = TST_RcvStacksize;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1150 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1151 if ( pcon != NULL )
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1152 {
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1153 data.StackSize += pcon->stack_offset;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1154 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1155 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1156 *info = &data;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1157 return PEI_OK;
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1158 }
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1159 #endif
5d1e22505446 GPF: tif library sources imported from Leonardo version
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1160