📄 os_core.lst
字号:
C51 COMPILER V8.08 OS_CORE 08/04/2008 21:49:51 PAGE 1
C51 COMPILER V8.08, COMPILATION OF MODULE OS_CORE
OBJECT MODULE PLACED IN OS_CORE.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE uCosii\OS_CORE.C DEBUG OBJECTEXTEND PRINT(.\OS_CORE.lst) OBJECT(OS_CORE.obj
-)
line level source
1 /*
2 *********************************************************************************************************
3 * uC/OS-II
4 * The Real-Time Kernel
5 * CORE FUNCTIONS
6 *
7 * (c) Copyright 1992-2005, Jean J. Labrosse, Weston, FL
8 * All Rights Reserved
9 *
10 * File : OS_CORE.C
11 * By : Jean J. Labrosse
12 * Version : V2.80
13 *********************************************************************************************************
14 */
15
16 #ifndef OS_MASTER_FILE
17 #define OS_GLOBALS
18 #include "..\arm\includes.h"
*** ERROR C141 IN LINE 83 OF UCOSII\..\ARM\OS_CPU.H: syntax error near '0x00'
*** ERROR C132 IN LINE 83 OF UCOSII\..\ARM\OS_CPU.H: 'OS_TASK_SW': not in formal parameter list
*** ERROR C141 IN LINE 84 OF UCOSII\..\ARM\OS_CPU.H: syntax error near '0x01'
*** ERROR C132 IN LINE 84 OF UCOSII\..\ARM\OS_CPU.H: '__swi': not in formal parameter list
*** ERROR C141 IN LINE 84 OF UCOSII\..\ARM\OS_CPU.H: syntax error near 'void'
*** ERROR C132 IN LINE 84 OF UCOSII\..\ARM\OS_CPU.H: '_OSStartHighRdy': not in formal parameter list
*** ERROR C141 IN LINE 85 OF UCOSII\..\ARM\OS_CPU.H: syntax error near '0x02'
*** ERROR C132 IN LINE 85 OF UCOSII\..\ARM\OS_CPU.H: '__swi': not in formal parameter list
*** ERROR C141 IN LINE 85 OF UCOSII\..\ARM\OS_CPU.H: syntax error near 'void'
*** ERROR C132 IN LINE 85 OF UCOSII\..\ARM\OS_CPU.H: 'OS_ENTER_CRITICAL': not in formal parameter list
*** ERROR C141 IN LINE 86 OF UCOSII\..\ARM\OS_CPU.H: syntax error near '0x03'
*** ERROR C132 IN LINE 86 OF UCOSII\..\ARM\OS_CPU.H: '__swi': not in formal parameter list
*** ERROR C141 IN LINE 86 OF UCOSII\..\ARM\OS_CPU.H: syntax error near 'void'
*** ERROR C132 IN LINE 86 OF UCOSII\..\ARM\OS_CPU.H: 'OS_EXIT_CRITICAL': not in formal parameter list
*** ERROR C141 IN LINE 88 OF UCOSII\..\ARM\OS_CPU.H: syntax error near '0x40'
*** ERROR C132 IN LINE 88 OF UCOSII\..\ARM\OS_CPU.H: '__swi': not in formal parameter list
*** ERROR C141 IN LINE 88 OF UCOSII\..\ARM\OS_CPU.H: syntax error near 'void'
*** ERROR C132 IN LINE 88 OF UCOSII\..\ARM\OS_CPU.H: '_GetOSFunctionAddr': not in formal parameter list
*** ERROR C141 IN LINE 89 OF UCOSII\..\ARM\OS_CPU.H: syntax error near '0x41'
*** ERROR C132 IN LINE 89 OF UCOSII\..\ARM\OS_CPU.H: '__swi': not in formal parameter list
*** ERROR C141 IN LINE 89 OF UCOSII\..\ARM\OS_CPU.H: syntax error near 'void'
*** ERROR C132 IN LINE 89 OF UCOSII\..\ARM\OS_CPU.H: '_GetUsrFunctionAddr': not in formal parameter list
*** ERROR C141 IN LINE 90 OF UCOSII\..\ARM\OS_CPU.H: syntax error near '0x42'
*** ERROR C132 IN LINE 90 OF UCOSII\..\ARM\OS_CPU.H: '__swi': not in formal parameter list
*** ERROR C141 IN LINE 90 OF UCOSII\..\ARM\OS_CPU.H: syntax error near 'void'
*** ERROR C132 IN LINE 90 OF UCOSII\..\ARM\OS_CPU.H: 'OSISRBegin': not in formal parameter list
*** ERROR C141 IN LINE 91 OF UCOSII\..\ARM\OS_CPU.H: syntax error near '0x43'
*** ERROR C132 IN LINE 91 OF UCOSII\..\ARM\OS_CPU.H: '__swi': not in formal parameter list
*** ERROR C141 IN LINE 91 OF UCOSII\..\ARM\OS_CPU.H: syntax error near 'int'
*** ERROR C132 IN LINE 91 OF UCOSII\..\ARM\OS_CPU.H: 'OSISRNeedSwap': not in formal parameter list
*** ERROR C141 IN LINE 93 OF UCOSII\..\ARM\OS_CPU.H: syntax error near '0x80'
*** ERROR C132 IN LINE 93 OF UCOSII\..\ARM\OS_CPU.H: '__swi': not in formal parameter list
*** ERROR C141 IN LINE 93 OF UCOSII\..\ARM\OS_CPU.H: syntax error near 'void'
*** ERROR C132 IN LINE 93 OF UCOSII\..\ARM\OS_CPU.H: 'ChangeToSYSMode': not in formal parameter list
*** ERROR C141 IN LINE 94 OF UCOSII\..\ARM\OS_CPU.H: syntax error near '0x81'
*** ERROR C132 IN LINE 94 OF UCOSII\..\ARM\OS_CPU.H: '__swi': not in formal parameter list
C51 COMPILER V8.08 OS_CORE 08/04/2008 21:49:51 PAGE 2
*** ERROR C141 IN LINE 94 OF UCOSII\..\ARM\OS_CPU.H: syntax error near 'void'
*** ERROR C132 IN LINE 94 OF UCOSII\..\ARM\OS_CPU.H: 'ChangeToUSRMode': not in formal parameter list
*** ERROR C141 IN LINE 95 OF UCOSII\..\ARM\OS_CPU.H: syntax error near '0x82'
*** ERROR C132 IN LINE 95 OF UCOSII\..\ARM\OS_CPU.H: '__swi': not in formal parameter list
*** ERROR C141 IN LINE 95 OF UCOSII\..\ARM\OS_CPU.H: syntax error near 'void'
*** ERROR C132 IN LINE 95 OF UCOSII\..\ARM\OS_CPU.H: '_TaskIsARM': not in formal parameter list
*** ERROR C141 IN LINE 96 OF UCOSII\..\ARM\OS_CPU.H: syntax error near '0x83'
*** ERROR C132 IN LINE 96 OF UCOSII\..\ARM\OS_CPU.H: '__swi': not in formal parameter list
*** ERROR C141 IN LINE 96 OF UCOSII\..\ARM\OS_CPU.H: syntax error near 'void'
*** ERROR C132 IN LINE 96 OF UCOSII\..\ARM\OS_CPU.H: '_TaskIsTHUMB': not in formal parameter list
*** ERROR C127 IN LINE 113 OF UCOSII\..\ARM\OS_CPU.H: 'OsEnterSum': invalid storage class
*** ERROR C127 IN LINE 284 OF UCOSII\..\UCOSII\UCOS_II.H: 'OS_EVENT': invalid storage class
*** ERROR C127 IN LINE 301 OF UCOSII\..\UCOSII\UCOS_II.H: 'OS_FLAGS': invalid storage class
*** ERROR C141 IN LINE 312 OF UCOSII\..\UCOSII\UCOS_II.H: syntax error near 'OS_FLAGS'
*** ERROR C127 IN LINE 312 OF UCOSII\..\UCOSII\UCOS_II.H: 'OS_FLAGS': invalid storage class
*** ERROR C141 IN LINE 312 OF UCOSII\..\UCOSII\UCOS_II.H: syntax error near 'OSFlagFlags'
*** ERROR C127 IN LINE 312 OF UCOSII\..\UCOSII\UCOS_II.H: 'OSFlagFlags': invalid storage class
*** ERROR C132 IN LINE 314 OF UCOSII\..\UCOSII\UCOS_II.H: 'OSFlagName': not in formal parameter list
*** ERROR C141 IN LINE 316 OF UCOSII\..\UCOSII\UCOS_II.H: syntax error near '}'
*** ERROR C141 IN LINE 325 OF UCOSII\..\UCOSII\UCOS_II.H: syntax error near 'OS_FLAGS'
*** ERROR C129 IN LINE 325 OF UCOSII\..\UCOSII\UCOS_II.H: missing ';' before 'OSFlagNodeFlags'
19 #endif
20
21 /*
22 *********************************************************************************************************
23 * PRIORITY RESOLUTION TABLE
24 *
25 * Note: Index into table is bit pattern to resolve highest priority
26 * Indexed value corresponds to highest priority bit position (i.e. 0..7)
27 *********************************************************************************************************
28 */
29
30 INT8U const OSUnMapTbl[256] = {
31 0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x00 to 0x0F */
32 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x10 to 0x1F */
33 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x20 to 0x2F */
34 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x30 to 0x3F */
35 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x40 to 0x4F */
36 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x50 to 0x5F */
37 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x60 to 0x6F */
38 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x70 to 0x7F */
39 7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x80 to 0x8F */
40 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x90 to 0x9F */
41 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0xA0 to 0xAF */
42 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0xB0 to 0xBF */
43 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0xC0 to 0xCF */
44 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0xD0 to 0xDF */
45 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0xE0 to 0xEF */
46 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 /* 0xF0 to 0xFF */
47 };
48
49 /*$PAGE*/
50 /*
51 *********************************************************************************************************
52 * FUNCTION PROTOTYPES
53 *********************************************************************************************************
54 */
55 static void OS_InitEventList(void);
56 static void OS_InitMisc(void);
57 static void OS_InitRdyList(void);
58 static void OS_InitTaskIdle(void);
59 #if OS_TASK_STAT_EN > 0
C51 COMPILER V8.08 OS_CORE 08/04/2008 21:49:51 PAGE 3
60 static void OS_InitTaskStat(void);
61 #endif
62 static void OS_InitTCBList(void);
63
64 static void OS_SchedNew(void);
65
66 /*$PAGE*/
67 /*
68 *********************************************************************************************************
69 * GET THE NAME OF A SEMAPHORE, MUTEX, MAILBOX or QUEUE
70 *
71 * Description: This function is used to obtain the name assigned to a semaphore, mutex, mailbox or queue.
72 *
73 * Arguments : pevent is a pointer to the event group. 'pevent' can point either to a semaphore,
74 * a mutex, a mailbox or a queue. Where this function is concerned, the actual
75 * type is irrelevant.
76 *
77 * pname is a pointer to an ASCII string that will receive the name of the semaphore,
78 * mutex, mailbox or queue. The string must be able to hold at least
79 * OS_EVENT_NAME_SIZE characters.
80 *
81 * err is a pointer to an error code that can contain one of the following values:
82 *
83 * OS_NO_ERR if the name was copied to 'pname'
84 * OS_ERR_EVENT_TYPE if 'pevent' is not pointing to the proper event
85 * control block type.
86 * OS_ERR_PNAME_NULL You passed a NULL pointer for 'pname'
87 * OS_ERR_PEVENT_NULL if you passed a NULL pointer for 'pevent'
88 *
89 * Returns : The length of the string or 0 if the 'pevent' is a NULL pointer.
90 *********************************************************************************************************
91 */
92
93 #if OS_EVENT_EN && (OS_EVENT_NAME_SIZE > 1)
94 INT8U OSEventNameGet (OS_EVENT *pevent, INT8U *pname, INT8U *err)
95 {
96 INT8U len;
97 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
OS_CPU_SR cpu_sr = 0;
#endif
100
101
102
103 #if OS_ARG_CHK_EN > 0
104 if (err == (INT8U *)0) { /* Validate 'err' */
105 return (0);
106 }
107 if (pevent == (OS_EVENT *)0) { /* Is 'pevent' a NULL pointer? */
108 *err = OS_ERR_PEVENT_NULL;
109 return (0);
110 }
111 if (pname == (INT8U *)0) { /* Is 'pname' a NULL pointer? */
112 *err = OS_ERR_PNAME_NULL;
113 return (0);
114 }
115 #endif
116 switch (pevent->OSEventType) {
117 case OS_EVENT_TYPE_SEM:
118 case OS_EVENT_TYPE_MUTEX:
119 case OS_EVENT_TYPE_MBOX:
120 case OS_EVENT_TYPE_Q:
121 break;
C51 COMPILER V8.08 OS_CORE 08/04/2008 21:49:51 PAGE 4
122
123 default:
124 *err = OS_ERR_EVENT_TYPE;
125 return (0);
126 }
127 OS_ENTER_CRITICAL();
128 len = OS_StrCopy(pname, pevent->OSEventName); /* Copy name from OS_EVENT */
129 OS_EXIT_CRITICAL();
130 *err = OS_NO_ERR;
131 return (len);
132 }
133 #endif
134
135 /*$PAGE*/
136 /*
137 *********************************************************************************************************
138 * ASSIGN A NAME TO A SEMAPHORE, MUTEX, MAILBOX or QUEUE
139 *
140 * Description: This function assigns a name to a semaphore, mutex, mailbox or queue.
141 *
142 * Arguments : pevent is a pointer to the event group. 'pevent' can point either to a semaphore,
143 * a mutex, a mailbox or a queue. Where this function is concerned, it doesn't
144 * matter the actual type.
145 *
146 * pname is a pointer to an ASCII string that will be used as the name of the semaphore,
147 * mutex, mailbox or queue. The string must be able to hold at least
148 * OS_EVENT_NAME_SIZE characters.
149 *
150 * err is a pointer to an error code that can contain one of the following values:
151 *
152 * OS_NO_ERR if the requested task is resumed
153 * OS_ERR_EVENT_TYPE if 'pevent' is not pointing to the proper event
154 * control block type.
155 * OS_ERR_PNAME_NULL You passed a NULL pointer for 'pname'
156 * OS_ERR_PEVENT_NULL if you passed a NULL pointer for 'pevent'
157 *
158 * Returns : None
159 *********************************************************************************************************
160 */
161
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -