📄 os_cpu_c.lst
字号:
##############################################################################
# #
# IAR AT90S C-Compiler V1.40E/386 #
# #
# Internal versions FE4.40H CO1.11K CG1.40E GL1.06L CD1.04A #
# AF1.25U AB1.40C EB1.31B #
# #
# Compile time = 22/Jun/1999 13:23:28 #
# Target option = Max 64 KB data + 8 KB code (8515 4414...) #
# Memory model = small #
# Source file = os_cpu_c.c #
# List file = ..\lst\os_cpu_c.lst #
# Object file = ..\obj\os_cpu_c.r90 #
# Command line = -r -ms -v1 -K -e -y -z9 -q -o ..\obj\os_cpu_c.r90 #
# -l ..\lst\os_cpu_c os_cpu_c.c #
# #
# (c) Copyright IAR Systems 1998 #
##############################################################################
\ NAME os_cpu_c(17)
\ RSEG CODE(0)
\ PUBLIC OSTaskCreateHook
\ PUBLIC OSTaskDelHook
\ PUBLIC OSTaskStatHook
\ PUBLIC OSTaskStkInit
\ PUBLIC OSTaskSwHook
\ PUBLIC OSTimeTickHook
\ EXTERN ?CL1S_1_40_L08
\ RSEG CODE
\ OSTaskStkInit:
1 /*
2 **********************************************************************************************************
3 * uC/OS-II
4 * The Real-Time Kernel
5 *
6 * AVR Specific code
7 *
8 * File : OS_CPU_C.C
9 * By : Ole Saether
10 * Port Version : V1.01
11 **********************************************************************************************************
12 */
13
14 #define OS_CPU_GLOBALS
15 #include "includes.h"
16
17 /*
18 **********************************************************************************************************
19 * INITIALIZE A TASK'S STACK
20 *
21 * Description: This function is called by either OSTaskCreate() or OSTaskCreateExt() to initialize the
22 * stack frame of the task being created. This function is highly processor specific.
23 *
24 * Arguments : task is a pointer to the task code
25 *
26 * pdata is a pointer to a user supplied data area that will be passed to the task
27 * when the task first executes.
28 *
29 * ptos is a pointer to the top of stack. It is assumed that 'ptos' points to the
30 * highest valid address on the stack.
31 *
32 * opt specifies options that can be used to alter the behavior of OSTaskStkInit().
33 * (see uCOS_II.H for OS_TASK_OPT_???).
34 *
35 * Returns : Always returns the location of the new top-of-stack' once the processor registers have
36 * been placed on the stack in the proper order.
37 *
38 * Note(s) : Interrupts are enabled when your task starts executing. You can change this by setting the
39 * SREG to 0x00 instead. In this case, interrupts would be disabled upon task startup. The
40 * application code would be responsible for enabling interrupts at the beginning of the task
41 * code. You will need to modify OSTaskIdle() and OSTaskStat() so that they enable
42 * interrupts. Failure to do this will make your system crash!
43 *
44 * The AVR return stack is placed 64 bytes above the start of the (512 byte) stack. This
45 * provides 32 levels of function call nesting which should be more than enough for most
46 * applications (see the "read.me" file for more info).
47 *
48 **********************************************************************************************************
49 */
50
51 void *OSTaskStkInit (void (*task)(void *pd), void *pdata, void *ptos, INT16U opt)
52 {
\ 00000000 6881 LDD R22,Y+0
\ 00000002 7981 LDD R23,Y+1
\ 00000004 2A80 LDD R2,Y+2
\ 00000006 3B80 LDD R3,Y+3
53 INT8U *stk;
54 INT8U *stks; /* Temp. variable used for setting up AVR hardware stack */
55 INT16U tmp;
56
57
58 opt = opt; /* 'opt' is not used, prevent warning */
59 stk = (INT8U *)ptos;
\ 00000008 262F MOV R18,R22
\ 0000000A 372F MOV R19,R23
60 stks = (INT8U *)(ptos)-(OS_TASK_DEF_STK_SIZE-64);/* AVR return stack ("hardware stack") */
\ 0000000C 605C SUBI R22,LOW(192)
\ 0000000E 7140 SBCI R23,LOW(1)
61 tmp = (INT16U)task;
62 *stks-- = (INT8U)tmp; /* Put task start address on top of hardware stack */
\ 00000010 2DD0 RCALL ?0022
\ 00000012 0083 ST Z,R16
63 *stks-- = (INT8U)(tmp >> 8);
\ 00000014 2BD0 RCALL ?0022
\ 00000016 1083 ST Z,R17
64
65 *stk-- = (INT8U)0x00; /* R0 = 0x00 */
\ 00000018 0027 CLR R16
\ 0000001A 2DD0 RCALL ?0023
66 *stk-- = (INT8U)0x00; /* R1 = 0x00 */
\ 0000001C 2DD0 RCALL ?0024
67 *stk-- = (INT8U)0x00; /* R2 = 0x00 */
\ 0000001E 2CD0 RCALL ?0024
68 *stk-- = (INT8U)0x00; /* R3 = 0x00 */
\ 00000020 2BD0 RCALL ?0024
69 *stk-- = (INT8U)0x00; /* R4 = 0x00 */
\ 00000022 2AD0 RCALL ?0024
70 *stk-- = (INT8U)0x00; /* R5 = 0x00 */
\ 00000024 29D0 RCALL ?0024
71 *stk-- = (INT8U)0x00; /* R6 = 0x00 */
\ 00000026 28D0 RCALL ?0024
72 *stk-- = (INT8U)0x00; /* R7 = 0x00 */
\ 00000028 27D0 RCALL ?0024
73 *stk-- = (INT8U)0x00; /* R8 = 0x00 */
\ 0000002A 26D0 RCALL ?0024
74 *stk-- = (INT8U)0x00; /* R9 = 0x00 */
\ 0000002C 25D0 RCALL ?0024
75 *stk-- = (INT8U)0x00; /* R10 = 0x00 */
\ 0000002E 24D0 RCALL ?0024
76 *stk-- = (INT8U)0x00; /* R11 = 0x00 */
\ 00000030 23D0 RCALL ?0024
77 *stk-- = (INT8U)0x00; /* R12 = 0x00 */
\ 00000032 22D0 RCALL ?0024
78 *stk-- = (INT8U)0x00; /* R13 = 0x00 */
\ 00000034 21D0 RCALL ?0024
79 *stk-- = (INT8U)0x00; /* R14 = 0x00 */
\ 00000036 20D0 RCALL ?0024
80 *stk-- = (INT8U)0x00; /* R15 = 0x00 */
\ 00000038 1FD0 RCALL ?0024
81 tmp = (INT16U)pdata;
82 *stk-- = (INT8U)tmp; /* Simulate call to function with argument */
\ 0000003A 4083 ST Z,R20
83 *stk-- = (INT8U)(tmp >> 8);
\ 0000003C 1ED0 RCALL ?0025
\ 0000003E 5083 ST Z,R21
84 *stk-- = (INT8U)0x00; /* R18 = 0x00 */
\ 00000040 1AD0 RCALL ?0023
85 *stk-- = (INT8U)0x00; /* R19 = 0x00 */
\ 00000042 1AD0 RCALL ?0024
86 *stk-- = (INT8U)0x00; /* R20 = 0x00 */
\ 00000044 19D0 RCALL ?0024
87 *stk-- = (INT8U)0x00; /* R21 = 0x00 */
\ 00000046 18D0 RCALL ?0024
88 *stk-- = (INT8U)0x00; /* R22 = 0x00 */
\ 00000048 17D0 RCALL ?0024
89 *stk-- = (INT8U)0x00; /* R23 = 0x00 */
\ 0000004A 16D0 RCALL ?0024
90 *stk-- = (INT8U)0x00; /* R24 = 0x00 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -