?? os_core.lst
字號:
C51 COMPILER V7.06 OS_CORE 07/18/2003 11:05:56 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE OS_CORE
OBJECT MODULE PLACED IN .\os_core.obj
COMPILER INVOKED BY: C:\KEIL\C51\BIN\C51.EXE ..\keilc51\os_core.c LARGE BROWSE DEBUG OBJECTEXTEND PRINT(.\os_core.lst) O
-BJECT(.\os_core.obj)
stmt level source
1 /*
2 *********************************************************************************************************
3 * uC/OS-II
4 * The Real-Time Kernel
5 * CORE FUNCTIONS
6 *
7 * (c) Copyright 1992-2002, Jean J. Labrosse, Weston, FL
8 * All Rights Reserved
9 *
10 * File : OS_CORE.C
11 * By : Jean J. Labrosse
12 *********************************************************************************************************
13 */
14
15 #ifndef OS_MASTER_FILE
16 #define OS_GLOBALS
17 #include "includes.h"
18 #endif
19
20 /*
21 *********************************************************************************************************
22 * MAPPING TABLE TO MAP BIT POSITION TO BIT MASK
23 *
24 * Note: Index into table is desired bit position, 0..7
25 * Indexed value corresponds to bit mask
26 *********************************************************************************************************
27 */
28
29 INT8U const OSMapTbl[] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
30
31 /*
32 *********************************************************************************************************
33 * PRIORITY RESOLUTION TABLE
34 *
35 * Note: Index into table is bit pattern to resolve highest priority
36 * Indexed value corresponds to highest priority bit position (i.e. 0..7)
37 *********************************************************************************************************
38 */
39
40 INT8U const OSUnMapTbl[] = {
41 0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x00 to 0x0F */
42 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x10 to 0x1F */
43 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x20 to 0x2F */
44 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x30 to 0x3F */
45 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x40 to 0x4F */
46 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x50 to 0x5F */
47 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x60 to 0x6F */
48 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x70 to 0x7F */
49 7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x80 to 0x8F */
50 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x90 to 0x9F */
51 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0xA0 to 0xAF */
52 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0xB0 to 0xBF */
53 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0xC0 to 0xCF */
54 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0xD0 to 0xDF */
C51 COMPILER V7.06 OS_CORE 07/18/2003 11:05:56 PAGE 2
55 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0xE0 to 0xEF */
56 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 /* 0xF0 to 0xFF */
57 };
58
59 /*$PAGE*/
60 /*
61 *********************************************************************************************************
62 * DEBUG DATA
63 *********************************************************************************************************
64 */
65
66 INT16U const OSDebugEn = OS_DEBUG_EN; /* Debug constants are defined below */
67
68 #if OS_DEBUG_EN > 0
69
70 INT16U const OSEventMax = OS_MAX_EVENTS; /* Number of event control blocks */
71 INT16U const OSEventNameSize = OS_EVENT_NAME_SIZE; /* Size (in bytes) of event names */
72 #if (OS_EVENT_EN > 0) && (OS_MAX_EVENTS > 0)
73 INT16U const OSEventSize = sizeof(OS_EVENT); /* Size in Bytes of OS_EVENT */
74 INT16U const OSEventTblSize = sizeof(OSEventTbl); /* Size of OSEventTbl[] in bytes */
75 #else
INT16U const OSEventSize = 0;
INT16U const OSEventTblSize = 0;
#endif
79
80 INT16U const OSFlagEn = OS_FLAG_EN;
81 #if (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
82 INT16U const OSFlagGrpSize = sizeof(OS_FLAG_GRP); /* Size in Bytes of OS_FLAG_GRP */
83 INT16U const OSFlagNodeSize = sizeof(OS_FLAG_NODE); /* Size in Bytes of OS_FLAG_NODE */
84 INT16U const OSFlagWidth = sizeof(OS_FLAGS); /* Width (in bytes) of OS_FLAGS */
85 #else
INT16U const OSFlagGrpSize = 0;
INT16U const OSFlagNodeSize = 0;
INT16U const OSFlagWidth = 0;
#endif
90 INT16U const OSFlagMax = OS_MAX_FLAGS;
91 INT16U const OSFlagNameSize = OS_FLAG_NAME_SIZE; /* Size (in bytes) of flag names */
92
93 INT16U const OSLowestPrio = OS_LOWEST_PRIO;
94
95 INT16U const OSMboxEn = OS_MBOX_EN;
96
97 INT16U const OSMemEn = OS_MEM_EN;
98 INT16U const OSMemMax = OS_MAX_MEM_PART; /* Number of memory partitions */
99 INT16U const OSMemNameSize = OS_MEM_NAME_SIZE; /* Size (in bytes) of partition names */
100 #if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
101 INT16U const OSMemSize = sizeof(OS_MEM); /* Mem. Partition header sine (bytes) */
102 INT16U const OSMemTblSize = sizeof(OSMemTbl);
103 #else
INT16U const OSMemSize = 0;
INT16U const OSMemTblSize = 0;
#endif
107 INT16U const OSMutexEn = OS_MUTEX_EN;
108
109 INT16U const OSPtrSize = sizeof(void *); /* Size in Bytes of a pointer */
110
111 INT16U const OSQEn = OS_Q_EN;
112 INT16U const OSQMax = OS_MAX_QS; /* Number of queues */
113 #if (OS_Q_EN > 0) && (OS_MAX_QS > 0)
114 INT16U const OSQSize = sizeof(OS_Q); /* Size in bytes of OS_Q structure */
115 #else
INT16U const OSQSize = 0;
C51 COMPILER V7.06 OS_CORE 07/18/2003 11:05:56 PAGE 3
#endif
118
119 INT16U const OSRdyTblSize = OS_RDY_TBL_SIZE; /* Number of bytes in the ready table */
120
121 INT16U const OSSemEn = OS_SEM_EN;
122
123 INT16U const OSStkWidth = sizeof(OS_STK); /* Size in Bytes of a stack entry */
124
125 INT16U const OSTaskCreateEn = OS_TASK_CREATE_EN;
126 INT16U const OSTaskCreateExtEn = OS_TASK_CREATE_EXT_EN;
127 INT16U const OSTaskDelEn = OS_TASK_DEL_EN;
128 INT16U const OSTaskIdleStkSize = OS_TASK_IDLE_STK_SIZE;
129 INT16U const OSTaskProfileEn = OS_TASK_PROFILE_EN;
130 INT16U const OSTaskMax = OS_MAX_TASKS + OS_N_SYS_TASKS; /* Total max. number of tasks */
131 INT16U const OSTaskNameSize = OS_TASK_NAME_SIZE; /* Size (in bytes) of task names */
132 INT16U const OSTaskStatEn = OS_TASK_STAT_EN;
133 INT16U const OSTaskStatStkSize = OS_TASK_STAT_STK_SIZE;
134 INT16U const OSTaskStatStkChkEn = OS_TASK_STAT_STK_CHK_EN;
135 INT16U const OSTaskSwHookEn = OS_TASK_SW_HOOK_EN;
136
137 INT16U const OSTCBPrioTblMax = OS_LOWEST_PRIO + 1; /* Number of entries in OSTCBPrioTbl[] */
138 INT16U const OSTCBSize = sizeof(OS_TCB); /* Size in Bytes of OS_TCB */
139 INT16U const OSTicksPerSec = OS_TICKS_PER_SEC;
140 INT16U const OSTimeTickHookEn = OS_TIME_TICK_HOOK_EN;
141 INT16U const OSVersionNbr = OS_VERSION;
142
143 #endif
144
145 /*$PAGE*/
146 /*
147 *********************************************************************************************************
148 * DEBUG DATA
149 * TOTAL DATA SPACE (i.e. RAM) USED BY uC/OS-II
150 *********************************************************************************************************
151 */
152 #if OS_DEBUG_EN > 0
153
154 INT16U const OSDataSize = sizeof(OSCtxSwCtr)
155 #if (OS_EVENT_EN > 0) && (OS_MAX_EVENTS > 0)
156 + sizeof(OSEventFreeList)
157 + sizeof(OSEventTbl)
158 #endif
159 #if (OS_VERSION >= 251) && (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
160 + sizeof(OSFlagTbl)
161 + sizeof(OSFlagFreeList)
162 #endif
163 #if OS_TASK_STAT_EN > 0
+ sizeof(OSCPUUsage)
+ sizeof(OSIdleCtrMax)
+ sizeof(OSIdleCtrRun)
+ sizeof(OSStatRdy)
+ sizeof(OSTaskStatStk)
#endif
170 #if OS_TICK_STEP_EN > 0
171 + sizeof(OSTickStepState)
172 #endif
173 #if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
174 + sizeof(OSMemFreeList)
175 + sizeof(OSMemTbl)
176 #endif
177 #if (OS_Q_EN > 0) && (OS_MAX_QS > 0)
178 + sizeof(OSQFreeList)
C51 COMPILER V7.06 OS_CORE 07/18/2003 11:05:56 PAGE 4
179 + sizeof(OSQTbl)
180 #endif
181 #if OS_TIME_GET_SET_EN > 0
182 + sizeof(OSTime)
183 #endif
184 + sizeof(OSIntNesting)
185 + sizeof(OSIntExitY)
186 + sizeof(OSLockNesting)
187 + sizeof(OSPrioCur)
188 + sizeof(OSPrioHighRdy)
189 + sizeof(OSRdyGrp)
190 + sizeof(OSRdyTbl)
191 + sizeof(OSRunning)
192 + sizeof(OSTaskCtr)
193 + sizeof(OSIdleCtr)
194 + sizeof(OSTaskIdleStk)
195 + sizeof(OSTCBCur)
196 + sizeof(OSTCBFreeList)
197 + sizeof(OSTCBHighRdy)
198 + sizeof(OSTCBList)
199 + sizeof(OSTCBPrioTbl)
200 + sizeof(OSTCBTbl);
201
202 #endif
203
204 /*$PAGE*/
205 /*
206 *********************************************************************************************************
207 * FUNCTION PROTOTYPES
208 *********************************************************************************************************
209 */
210 static void OS_InitEventList(void) reentrant;
211 static void OS_InitMisc(void) reentrant;
212 static void OS_InitRdyList(void) reentrant;
213 static void OS_InitTaskIdle(void) reentrant;
214 #if OS_TASK_STAT_EN > 0
static void OS_InitTaskStat(void) reentrant;
#endif
217 static void OS_InitTCBList(void) reentrant;
218
219 /*$PAGE*/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -