📄 os_cpu_c.lst
字号:
C51 COMPILER V7.50 OS_CPU_C 01/12/2005 21:47:41 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE OS_CPU_C
OBJECT MODULE PLACED IN .\Debug\Os_cpu_c.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE ucos261\Mcs51\Os_cpu_c.c LARGE OPTIMIZE(0,SPEED) BROWSE DEBUG OBJECTEXTEND
-CODE LISTINCLUDE SYMBOLS PRINT(.\Lst\Os_cpu_c.lst) OBJECT(.\Debug\Os_cpu_c.obj)
line level source
1 /*
2 *********************************************************************************************************
3 * uC/OS-II
4 * 实时内核
5 *
6 * (c) Copyright 1992-1998, Jean J. Labrosse, Plantation, FL
7 * 版权所有
8 *
9 * MCU-51 专用代码
10 * KEIL C51大模式编译
11 *
12 * 文件名 : OS_CPU_C.C
13 * 作者 : Jean J. Labrosse
14 * 改编 : 杨屹 gdtyy@ri.gdt.com.cn 巨龙公司系统集成开发部 2002.09.27
15 *********************************************************************************************************
16 */
17
18 #define OS_CPU_GLOBALS
19 #include "..\..\source\includes.h"
1 =1 /*
2 =1 *********************************************************************************************************
3 =1 * uC/OS-II
4 =1 * The Real-Time Kernel
5 =1 *
6 =1 * (c) Copyright 1992-1999, Jean J. Labrosse, Weston, FL
7 =1 * All Rights Reserved
8 =1 *
9 =1 * MASTER INCLUDE FILE
10 =1 *********************************************************************************************************
11 =1 */
12 =1 #ifndef INCLUDES_H
13 =1 #define INCLUDES_H
14 =1
15 =1 #include "..\ucos261\mcs51\reg52.h"
16 =1 #include <stdarg.h>
1 =2 /*--------------------------------------------------------------------------
2 =2 STDARG.H
3 =2
4 =2 Prototypes for variable argument lists.
5 =2 Copyright (c) 1988-2002 Keil Elektronik GmbH and Keil Software, Inc.
6 =2 All rights reserved.
7 =2 --------------------------------------------------------------------------*/
8 =2
9 =2 #ifndef __STDARG_H__
10 =2 #define __STDARG_H__
11 =2
12 =2 #ifndef NULL
13 =2 #define NULL ((void *) 0)
14 =2 #endif
15 =2
16 =2 #ifndef _VA_LIST_DEFINED
17 =2 typedef char *va_list;
18 =2 #define _VA_LIST_DEFINED
19 =2 #endif
C51 COMPILER V7.50 OS_CPU_C 01/12/2005 21:47:41 PAGE 2
20 =2
21 =2 #define va_start(ap,v) ap = (va_list)&v + sizeof(v)
22 =2 #define va_arg(ap,t) (((t *)ap)++[0])
23 =2 #define va_end(ap)
24 =2
25 =2 #endif
17 =1 #include <stdio.h>
1 =2 /*--------------------------------------------------------------------------
2 =2 STDIO.H
3 =2
4 =2 Prototypes for standard I/O functions.
5 =2 Copyright (c) 1988-2002 Keil Elektronik GmbH and Keil Software, Inc.
6 =2 All rights reserved.
7 =2 --------------------------------------------------------------------------*/
8 =2
9 =2 #ifndef __STDIO_H__
10 =2 #define __STDIO_H__
11 =2
12 =2 #ifndef EOF
13 =2 #define EOF -1
14 =2 #endif
15 =2
16 =2 #ifndef NULL
=2 #define NULL ((void *) 0)
=2 #endif
19 =2
20 =2 #ifndef _SIZE_T
21 =2 #define _SIZE_T
22 =2 typedef unsigned int size_t;
23 =2 #endif
24 =2
25 =2 #pragma SAVE
26 =2 #pragma REGPARMS
27 =2 extern char _getkey (void);
28 =2 extern char getchar (void);
29 =2 extern char ungetchar (char);
30 =2 extern char putchar (char);
31 =2 extern int printf (const char *, ...);
32 =2 extern int sprintf (char *, const char *, ...);
33 =2 extern int vprintf (const char *, char *);
34 =2 extern int vsprintf (char *, const char *, char *);
35 =2 extern char *gets (char *, int n);
36 =2 extern int scanf (const char *, ...);
37 =2 extern int sscanf (char *, const char *, ...);
38 =2 extern int puts (const char *);
39 =2
40 =2 #pragma RESTORE
41 =2
42 =2 #endif
43 =2
18 =1 #include <string.h>
1 =2 /*--------------------------------------------------------------------------
2 =2 STRING.H
3 =2
4 =2 String functions.
5 =2 Copyright (c) 1988-2002 Keil Elektronik GmbH and Keil Software, Inc.
6 =2 All rights reserved.
7 =2 --------------------------------------------------------------------------*/
8 =2
9 =2 #ifndef __STRING_H__
10 =2 #define __STRING_H__
11 =2
C51 COMPILER V7.50 OS_CPU_C 01/12/2005 21:47:41 PAGE 3
12 =2 #ifndef _SIZE_T
=2 #define _SIZE_T
=2 typedef unsigned int size_t;
=2 #endif
16 =2
17 =2 #ifndef NULL
=2 #define NULL ((void *) 0L)
=2 #endif
20 =2
21 =2 #pragma SAVE
22 =2 #pragma REGPARMS
23 =2 extern char *strcat (char *s1, char *s2);
24 =2 extern char *strncat (char *s1, char *s2, int n);
25 =2
26 =2 extern char strcmp (char *s1, char *s2);
27 =2 extern char strncmp (char *s1, char *s2, int n);
28 =2
29 =2 extern char *strcpy (char *s1, char *s2);
30 =2 extern char *strncpy (char *s1, char *s2, int n);
31 =2
32 =2 extern int strlen (char *);
33 =2
34 =2 extern char *strchr (const char *s, char c);
35 =2 extern int strpos (const char *s, char c);
36 =2 extern char *strrchr (const char *s, char c);
37 =2 extern int strrpos (const char *s, char c);
38 =2
39 =2 extern int strspn (char *s, char *set);
40 =2 extern int strcspn (char *s, char *set);
41 =2 extern char *strpbrk (char *s, char *set);
42 =2 extern char *strrpbrk (char *s, char *set);
43 =2 extern char *strstr (char *s, char *sub);
44 =2 extern char *strtok (char *str, const char *set);
45 =2
46 =2 extern char memcmp (void *s1, void *s2, int n);
47 =2 extern void *memcpy (void *s1, void *s2, int n);
48 =2 extern void *memchr (void *s, char val, int n);
49 =2 extern void *memccpy (void *s1, void *s2, char val, int n);
50 =2 extern void *memmove (void *s1, void *s2, int n);
51 =2 extern void *memset (void *s, char val, int n);
52 =2 #pragma RESTORE
53 =2
54 =2 #endif
19 =1 #include <ctype.h>
1 =2 /*--------------------------------------------------------------------------
2 =2 CTYPE.H
3 =2
4 =2 Prototypes for character functions.
5 =2 Copyright (c) 1988-2002 Keil Elektronik GmbH and Keil Software, Inc.
6 =2 All rights reserved.
7 =2 --------------------------------------------------------------------------*/
8 =2
9 =2 #ifndef __CTYPE_H__
10 =2 #define __CTYPE_H__
11 =2
12 =2 #pragma SAVE
13 =2 #pragma REGPARMS
14 =2 extern bit isalpha (unsigned char);
15 =2 extern bit isalnum (unsigned char);
16 =2 extern bit iscntrl (unsigned char);
17 =2 extern bit isdigit (unsigned char);
18 =2 extern bit isgraph (unsigned char);
C51 COMPILER V7.50 OS_CPU_C 01/12/2005 21:47:41 PAGE 4
19 =2 extern bit isprint (unsigned char);
20 =2 extern bit ispunct (unsigned char);
21 =2 extern bit islower (unsigned char);
22 =2 extern bit isupper (unsigned char);
23 =2 extern bit isspace (unsigned char);
24 =2 extern bit isxdigit (unsigned char);
25 =2 extern unsigned char tolower (unsigned char);
26 =2 extern unsigned char toupper (unsigned char);
27 =2 extern unsigned char toint (unsigned char);
28 =2
29 =2 #define _tolower(c) ( (c)-'A'+'a' )
30 =2 #define _toupper(c) ( (c)-'a'+'A' )
31 =2 #define toascii(c) ( (c) & 0x7F )
32 =2 #pragma RESTORE
33 =2
34 =2 #endif
20 =1 #include <stdlib.h>
1 =2 /*--------------------------------------------------------------------------
2 =2 STDLIB.H
3 =2
4 =2 Standard functions.
5 =2 Copyright (c) 1988-2002 Keil Elektronik GmbH and Keil Software, Inc.
6 =2 All rights reserved.
7 =2 --------------------------------------------------------------------------*/
8 =2
9 =2 #ifndef __STDLIB_H__
10 =2 #define __STDLIB_H__
11 =2
12 =2 #ifndef _SIZE_T
=2 #define _SIZE_T
=2 typedef unsigned int size_t;
=2 #endif
16 =2
17 =2 #ifndef NULL
=2 #define NULL ((void *) 0L)
=2 #endif
20 =2
21 =2 #ifndef _WCHAR_T_DEFINED_
22 =2 #define _WCHAR_T_DEFINED_
23 =2 typedef char wchar_t;
24 =2 #endif
25 =2
26 =2
27 =2 #pragma SAVE
28 =2 #pragma REGPARMS
29 =2
30 =2 extern int abs (int val);
31 =2 extern long labs (long val);
32 =2
33 =2 extern float atof (char *s1);
34 =2 extern long atol (char *s1);
35 =2 extern int atoi (char *s1);
36 =2 extern int rand ();
37 =2 extern void srand (int);
38 =2
39 =2 extern float strtod (char *, char **);
40 =2 extern long strtol (char *, char **, unsigned char);
41 =2 extern unsigned long strtoul (char *, char **, unsigned char);
42 =2
43 =2 #define _MALLOC_MEM_ xdata
44 =2
45 =2 extern int init_mempool (void _MALLOC_MEM_ *p, unsigned int size);
C51 COMPILER V7.50 OS_CPU_C 01/12/2005 21:47:41 PAGE 5
46 =2 extern void _MALLOC_MEM_ *malloc (unsigned int size);
47 =2 extern void free (void _MALLOC_MEM_ *p);
48 =2 extern void _MALLOC_MEM_ *realloc (void _MALLOC_MEM_ *p, unsigned int size);
49 =2 extern void _MALLOC_MEM_ *calloc (unsigned int size, unsigned int len);
50 =2
51 =2 #pragma RESTORE
52 =2
53 =2 #endif
21 =1 #include <setjmp.h>
1 =2 /*--------------------------------------------------------------------------
2 =2 SETJMP.H
3 =2
4 =2 Prototypes for longjmp facility.
5 =2 Copyright (c) 1988-2003 Keil Elektronik GmbH and Keil Software, Inc.
6 =2 All rights reserved.
7 =2 --------------------------------------------------------------------------*/
8 =2
9 =2 /* define the buffer type for holding the state information */
10 =2 #ifndef __SETJMP_H__
11 =2 #define __SETJMP_H__
12 =2
13 =2 #ifdef __CX51__
=2 #define _JBLEN 9 /* SP, SPE, ?C_XBP, ?C_IBP, ?C_PBP, RET-ADDR */
=2 #else
16 =2 #define _JBLEN 7 /* RET-ADDR, ?C_XBP, ?C_IBP, ?C_PBP, SP */
17 =2 /* for Dallas 390: RET-ADDR, ?C_XBP, ?C_IBP, PCX, SP */
18 =2 #endif
19 =2
20 =2 typedef char jmp_buf[_JBLEN];
21 =2
22 =2 /* function prototypes */
23 =2 extern int setjmp (jmp_buf);
24 =2 extern void longjmp (jmp_buf, int);
25 =2 #endif
26 =2
22 =1
23 =1 #include "os_cfg.h"
24 =1 #include "..\ucos261\mcs51\os_cpu.h"
25 =1 #include "..\ucos261\ucos_ii.h"
26 =1
27 =1 /*********************************** USER'S HEADER FILES *********************************************/
28 =1
29 =1 #endif //#ifndef INCLUDES_H
20
21 /*
22 *********************************************************************************************************
23 * 初始化任务堆栈
24 *
25 * 描述 : 这个函数被OSTaskCreate()或OSTaskCreateExt()调用,以便初始化新创建任务的堆栈结构。本函数
26 * 与处理器高度相关。
27 *
28 * 参数 : task 指向任务代码的指针
29 *
30 * pdata 当任务第一次执行时将要传入任务的用户数据结构指针
31 *
32 * ptos 栈顶指针。ptos指针被默认为用户堆栈入口指针。如果OS_STK_GROWTH被置1,那么,
33 * ptos指向用户堆栈的最高有效地址。同样地,如果OS_STK_GROWTH清0,ptos将指向
34 * 用户堆栈的最低有效地址。
35 *
36 * opt 指定可以改变OSTaskStkInit()行为的选项。(见uCOS_II.H for OS_TASK_OPT_???)。
37 *
38 * 返回值 : 我修改了原来的程序,使函数总是返回用户堆栈空间的最低有效地址。这样修改提高了TCB换入换出
C51 COMPILER V7.50 OS_CPU_C 01/12/2005 21:47:41 PAGE 6
39 * 的效率。
40 *
41 * 注意 : 任务堆栈结构:
42 *
43 * ---------- -
44 * 用户栈最高地址---->| | |
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -