?? 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 + -