📄 os_cpu_c.lst
字号:
C51 COMPILER V7.20 OS_CPU_C 04/25/2005 23:03:52 PAGE 1
C51 COMPILER V7.20, COMPILATION OF MODULE OS_CPU_C
OBJECT MODULE PLACED IN OS_CPU_C.obj
COMPILER INVOKED BY: D:\tools\Keil\C51\BIN\C51.EXE Port\OS_CPU_C.C LARGE BROWSE INCDIR(D:\MY\empolder\uCOS-II\MCS-51\AT8
-9C55WD\Keil 7_5\) DEBUG OBJECTEXTEND PRINT(.\OS_CPU_C.lst) OBJECT(OS_CPU_C.obj)
line level source
1 /*
2 *********************************************************************************************************
3 * uC/OS-II
4 * The Real-Time Kernel
5 *
6 * (c) Copyright 1992-2002, Jean J. Labrosse, Weston, FL
7 * All Rights Reserved
8 *
9 *
10 * at89c55wd Specific code
11 * LARGE MEMORY MODEL
12 *
13 * keil C/C++ V4.51
14 *
15 * File : OS_CPU_C.C
16 * By : Jean J. Labrosse
17 * Port by : NiuYi(牛毅)
18 *********************************************************************************************************
19 */
20
21 #define OS_CPU_GLOBALS
22 #include "includes.h"
23
24 /*
25 *********************************************************************************************************
26 * OS INITIALIZATION HOOK
27 * (BEGINNING)
28 *
29 * Description: This function is called by OSInit() at the beginning of OSInit().
30 *
31 * Arguments : none
32 *
33 * Note(s) : 1) Interrupts should be disabled during this call.
34 *********************************************************************************************************
35 */
36 #if OS_CPU_HOOKS_EN > 0 && OS_VERSION > 203
37 void OSInitHookBegin (void) LG_REENTRANT
38 {
39 1 }
40 #endif
41
42 /*
43 *********************************************************************************************************
44 * OS INITIALIZATION HOOK
45 * (END)
46 *
47 * Description: This function is called by OSInit() at the end of OSInit().
48 *
49 * Arguments : none
50 *
51 * Note(s) : 1) Interrupts should be disabled during this call.
52 *********************************************************************************************************
53 */
54 #if OS_CPU_HOOKS_EN > 0 && OS_VERSION > 203
C51 COMPILER V7.20 OS_CPU_C 04/25/2005 23:03:52 PAGE 2
55 void OSInitHookEnd (void) LG_REENTRANT
56 {
57 1 }
58 #endif
59
60 /*$PAGE*/
61 /*
62 *********************************************************************************************************
63 * TASK CREATION HOOK
64 *
65 * Description: This function is called when a task is created.
66 *
67 * Arguments : ptcb is a pointer to the task control block of the task being created.
68 *
69 * Note(s) : 1) Interrupts are disabled during this call.
70 *********************************************************************************************************
71 */
72 #if OS_CPU_HOOKS_EN > 0
73 void OSTaskCreateHook (OS_TCB *ptcb) LG_REENTRANT
74 {
75 1 ptcb = ptcb; /* Prevent compiler warning */
76 1 }
77 #endif
78
79
80 /*
81 *********************************************************************************************************
82 * TASK DELETION HOOK
83 *
84 * Description: This function is called when a task is deleted.
85 *
86 * Arguments : ptcb is a pointer to the task control block of the task being deleted.
87 *
88 * Note(s) : 1) Interrupts are disabled during this call.
89 *********************************************************************************************************
90 */
91 #if OS_CPU_HOOKS_EN > 0
92 void OSTaskDelHook (OS_TCB *ptcb) LG_REENTRANT
93 {
94 1 ptcb = ptcb; /* Prevent compiler warning */
95 1 }
96 #endif
97
98 /*
99 *********************************************************************************************************
100 * IDLE TASK HOOK
101 *
102 * Description: This function is called by the idle task. This hook has been added to allow you to do
103 * such things as STOP the CPU to conserve power.
104 *
105 * Arguments : none
106 *
107 * Note(s) : 1) Interrupts are enabled during this call.
108 *********************************************************************************************************
109 */
110 #if OS_CPU_HOOKS_EN > 0 && OS_VERSION >= 251
111 void OSTaskIdleHook (void) LG_REENTRANT
112 {
113 1 }
114 #endif
115
116 /*
C51 COMPILER V7.20 OS_CPU_C 04/25/2005 23:03:52 PAGE 3
117 *********************************************************************************************************
118 * STATISTIC TASK HOOK
119 *
120 * Description: This function is called every second by uC/OS-II's statistics task. This allows your
121 * application to add functionality to the statistics task.
122 *
123 * Arguments : none
124 *********************************************************************************************************
125 */
126
127 #if OS_CPU_HOOKS_EN > 0
128 void OSTaskStatHook (void) LG_REENTRANT
129 {
130 1 }
131 #endif
132
133 /*$PAGE*/
134 /*
135 *********************************************************************************************************
136 * INITIALIZE A TASK'S STACK
137 *
138 * Description: This function is called by either OSTaskCreate() or OSTaskCreateExt() to initialize the
139 * stack frame of the task being created. This function is highly processor specific.
140 *
141 * Arguments : task is a pointer to the task code
142 *
143 * os_pdata is a pointer to a user supplied data area that will be passed to the task
144 * when the task first executes.
145 *
146 * ptos is a pointer to the top of stack. It is assumed that 'ptos' points to
147 * a 'free' entry on the task stack. If OS_STK_GROWTH is set to 1 then
148 * 'ptos' will contain the HIGHEST valid address of the stack. Similarly, if
149 * OS_STK_GROWTH is set to 0, the 'ptos' will contains the LOWEST valid address
150 * of the stack.
151 *
152 * opt specifies options that can be used to alter the behavior of OSTaskStkInit().
153 * (see uCOS_II.H for OS_TASK_OPT_???).
154 *
155 * Returns : Always returns the location of the new top-of-stack' once the processor registers have
156 * been placed on the stack in the proper order.
157 *
158 * Note(s) : Interrupts are enabled when your task starts executing. You can change this by setting the
159 * PSW to 0x0002 instead. In this case, interrupts would be disabled upon task startup. The
160 * application code would be responsible for enabling interrupts at the beginning of the task
161 * code. You will need to modify OSTaskIdle() and OSTaskStat() so that they enable
162 * interrupts. Failure to do this will make your system crash!
163 *********************************************************************************************************
164 */
165 /*
166 at89c55wd PDL(sp form LOW to HIGH): (堆栈指针所指的栈顶数据为有效数据)
167 装入堆栈指针ptos到stk
168
169 stk--> 入栈:task底\高 (高内存)
170 入 || 入栈:ACC
171 栈 || 入栈:B
172 顺 || 入栈:DPH //暂时忽略第二指针
173 序 || 入栈:DPL
174 | \/ | 入栈:PSW
175 | | 入栈:R0
176 |______| 入栈:os_pdata(R1,R2,R3)用寄存器传递os_pdata
177 入栈:R4-R7 (底内存)
178
C51 COMPILER V7.20 OS_CPU_C 04/25/2005 23:03:52 PAGE 4
179 // 入栈:DPS?? //双数据指针选择寄存器??
180 // 入栈:PC
181 自己应该参照编译器定义入栈/出栈顺序,写出来备以后查阅
182 */
183 OS_STK *OSTaskStkInit (void (*task)(void *pd)LG_REENTRANT, void *os_pdata, OS_STK *ptos, INT16U opt) LG_R
-EENTRANT
184 {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -