annotate gsm-fw/nucleus/tmd.c @ 511:92583843f7f8

gsm-fw/configs/{gtamodem,pirelli}.ramdemo: GPF enabled
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 01 Jul 2014 23:03:32 +0000
parents afceeeb2cba1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
79
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /*************************************************************************/
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 /* */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 /* Copyright Mentor Graphics Corporation 2002 */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 /* All Rights Reserved. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 /* */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 /* THIS WORK CONTAINS TRADE SECRET AND PROPRIETARY INFORMATION WHICH IS */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 /* THE PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS AND IS */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 /* SUBJECT TO LICENSE TERMS. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 /* */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 /*************************************************************************/
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 /*************************************************************************/
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 /* */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14 /* FILE NAME VERSION */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 /* */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16 /* tmd.c Nucleus PLUS 1.14 */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 /* */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18 /* COMPONENT */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19 /* */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20 /* TM - Timer Management */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21 /* */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
22 /* DESCRIPTION */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
23 /* */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
24 /* This file contains global data structures for use within the */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
25 /* timer management component. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
26 /* */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
27 /* DATA STRUCTURES */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
28 /* */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
29 /* TMD_Created_Timers_List Pointer to the linked-list */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
30 /* of created application */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
31 /* timers */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
32 /* TMD_Total_Timers Total number of created */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
33 /* application timers */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
34 /* TMD_Active_Timers_List Pointer to the linked-list */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
35 /* of active timers. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
36 /* TMD_Active_List_Busy Flag indicating that the */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
37 /* active timer list is in use*/
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
38 /* TMD_Created_List_Protect Created timer list protect */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
39 /* structure */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
40 /* TMD_System_Clock System clock */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
41 /* TMD_Timer_Start Starting value of timer */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
42 /* TMD_Timer Timer count-down value */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
43 /* TMD_Timer_State State of timer */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
44 /* TMD_Time_Slice Time slice count-down value */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
45 /* TMD_Time_Slice_Task Pointer to task to time-slice*/
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
46 /* TMD_Time_Slice_State State of time slice */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
47 /* TMD_HISR Timer HISR control block */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
48 /* TMD_HISR_Stack_Ptr Pointer to HISR stack area */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
49 /* TMD_HISR_Stack_Size Size of HISR stack area */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
50 /* TMD_HISR_Priority Priority of timer HISR */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
51 /* */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
52 /* FUNCTIONS */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
53 /* */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
54 /* None */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
55 /* */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
56 /* DEPENDENCIES */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
57 /* */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
58 /* tm_defs.h Timer Management constants */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
59 /* tc_defs.h Thread Control constants */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
60 /* */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
61 /* HISTORY */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
62 /* */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
63 /* DATE REMARKS */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
64 /* */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
65 /* 03-01-1993 Created initial version 1.0 */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
66 /* 04-19-1993 Verified version 1.0 */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
67 /* 08-09-1993 Removed timer task structures, */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
68 /* making version 1.0a */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
69 /* 08-09-1993 Verified version 1.0a */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
70 /* 03-01-1994 Removed active list protect data */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
71 /* structure since system protect */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
72 /* is now used, resulting in */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
73 /* version 1.1 */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
74 /* */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
75 /* 03-18-1994 Verified version 1.1 */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
76 /* 04-17-1996 updated to version 1.2 */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
77 /* 03-24-1998 Released version 1.3. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
78 /* 03-26-1999 Released 1.11m (new release */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
79 /* numbering scheme) */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
80 /* 04-17-2002 Released version 1.13m */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
81 /* 11-07-2002 Released version 1.14 */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
82 /*************************************************************************/
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
83 #define NU_SOURCE_FILE
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
84
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
85 #include "tm_defs.h" /* Timer constants */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
86
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
87
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
88 /* TMD_Created_Timers_List is the head pointer of the linked list of
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
89 created application timers. If the list is NU_NULL, there are no timers
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
90 currently created. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
91
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
92 CS_NODE *TMD_Created_Timers_List;
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
93
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
94
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
95 /* TMD_Total_Timers contains the total number of created application timers
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
96 in the system. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
97
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
98 UNSIGNED TMD_Total_Timers;
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
99
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
100
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
101 /* TMD_Active_Timers_List is the head pointer of the linked list of active
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
102 timers. This includes both the application timers and the system timers
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
103 used for task sleeping and timeouts. If the list is NU_NULL, there are
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
104 no timers currently active. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
105
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
106 TM_TCB *TMD_Active_Timers_List;
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
107
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
108
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
109 /* TMD_Active_List_Busy is a flag that indicates that the active timer list
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
110 is being processed. This is used to prevent multiple updates to the
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
111 active timer list. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
112
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
113 INT TMD_Active_List_Busy;
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
114
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
115
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
116 /* TMD_Created_List_Protect is used to protect the created application timers
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
117 list from multiple accesses. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
118
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
119 TC_PROTECT TMD_Created_List_Protect;
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
120
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
121
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
122 /* TMD_System_Clock is a continually incrementing clock. One is added to
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
123 the clock each timer interrupt. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
124
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
125 UNSIGNED TMD_System_Clock;
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
126
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
127
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
128 /* TMD_Timer_Start represents the starting value of the last set timer
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
129 request. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
130
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
131 UNSIGNED TMD_Timer_Start;
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
132
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
133
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
134 /* TMD_Timer is a count-down timer that is used to represent the smallest
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
135 active timer value in the system. Once this counter goes to zero, a
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
136 timer has expired. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
137
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
138 UNSIGNED TMD_Timer;
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
139
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
140
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
141 /* TMD_Timer_State indicates the state of the timer variable. If the state
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
142 is active, the timer counter is decremented. If the state is expired,
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
143 the timer HISR and timer task are initiated to process the expiration. If
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
144 the state indicates that the timer is not-active, the timer counter is
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
145 ignored. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
146
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
147 INT TMD_Timer_State;
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
148
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
149
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
150 /* TMD_Time_Slice contains the count-down value for the currently executing
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
151 task's time slice. When this value goes to zero, time slice processing
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
152 is started. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
153
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
154 UNSIGNED TMD_Time_Slice;
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
155
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
156
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
157 /* TMD_Time_Slice_Task is a pointer to the task to time-slice. This pointer
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
158 is built in the portion of the timer interrupt that determines if a time-
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
159 slice timer has expired. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
160
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
161 TC_TCB *TMD_Time_Slice_Task;
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
162
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
163
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
164 /* TMD_Time_Slice_State indicates the state of the time slice variable. If
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
165 the state is active, the time slice counter is decremented. If the
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
166 state is expired, the timer HISR is initiated to process the expiration.
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
167 If the state indicates that the time slice is not-active, the time slice
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
168 counter is ignored. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
169
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
170 INT TMD_Time_Slice_State;
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
171
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
172
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
173 /* TMD_HISR is the timer HISR's control block. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
174
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
175 TC_HCB TMD_HISR;
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
176
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
177
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
178 /* TMD_HISR_Stack_Ptr points to the memory area reserved for the timer HISR.
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
179 Note that this is setup in INT_Initialize. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
180
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
181 VOID *TMD_HISR_Stack_Ptr;
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
182
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
183
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
184 /* TMD_HISR_Stack_Size represents the size of the allocated timer HISR stack.
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
185 Note that this is setup in INT_Initialize. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
186
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
187 UNSIGNED TMD_HISR_Stack_Size;
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
188
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
189
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
190 /* TMD_HISR_Priority indicates the priority of the timer HISR. Priorities
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
191 range from 0 to 2, where priority 0 is the highest. Note that this is
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
192 also initialized in INT_Initialize. */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
193
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
194 INT TMD_HISR_Priority;
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
195
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
196
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
197
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
198
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
199
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
200