📄 sbrk.lst
字号:
88 #ifdef __cplusplus
89 X }
90 #endif
91
92 #define _IOFBF 1 /* define _IOFBF of full buffering */
93 #define _IOLBF 2 /* define _IOLBF of line buffering */
94 #define _IONBF 3 /* define _IONBF of non buffering */
95
96 #define SEEK_SET 0 /* allocate top position */
97 #define SEEK_CUR 1 /* allocate current position */
98 #define SEEK_END 2 /* allocate bottom position */
99
100 #define BUFSIZ 512 /* default buffer size */
101
102 /* error number define */
103 #ifndef EBADF
104 #define EBADF 1302 /* I/O operation error */
105 #endif
106 #ifndef PTRERR
107 #define PTRERR 1106 /* fp null */
108 #endif
109 #ifndef ECSPEC
110 #define ECSPEC 1304 /* format err */
111 #endif
112 #ifndef NOTOPN
113 #define NOTOPN 1300 /* file not open */
114 #endif
115
116 #ifndef EMALRESM
117 #define EMALRESM 2100 /* malloc semaphore reserve error */
118 #endif
119 #ifdef EIOBRESM
120 X #define EIOBRESM 2120 /* _iob semaphore reserve error */
121 #endif
122 #ifdef EMALFRSM
123 X #define EMALFRSM 2101 /* malloc semaphore free error */
124 #endif
125 #ifdef EIOBFRSM
126 X #define EIOBFRSM 2121 /* _iob semaphore free error */
127 #endif
128
129
130 /* I/O flags for _ioflag1 */
131 #define _IOREAD 1 /* only read or update read */
132 #define _IOWRITE 2 /* only write or update write */
133 #define _IORW 4 /* update file */
134 #define _IOUNBUF 8 /* unbffering I/O */
135 #define _IOBGBUF 16 /* automatic buffer allocate */
136 #define _IOEOF 32 /* end of file */
137 #define _IOERR 64 /* I/O error */
138 #define _IOBIN 128 /* binaly file */
139 #define _UNGTC 1 /* ungetc issued (_ioflag2) */
140 #define _IOLINBUF 2 /* line buffering */
141
142 #define EOF (-1)
143 #define _EOL (0x0A) /* end of line */
144
145 #define stdin (&_iob[0]) /* standard input file */
146 #define stdout (&_iob[1]) /* standard output file */
147 #define stderr (&_iob[2]) /* standard error output file */
148
149 #define getchar() getc(stdin)
150 #define putchar(x) putc(x,stdout)
151 #define feof(fp) ((fp)->_ioflag1&_IOEOF)
152 #define ferror(fp) ((fp)->_ioflag1&_IOERR)
153 #define clearerr(fp) ((void)((fp)->_ioflag1&=~(_IOEOF|_IOERR)))
154 #endif
155
156 #endif /* _STDIO_H */
FILE NAME: E:\Study\ucOS-II\ucOS-II\PLATFORM\Public\sbrk.c
16 #include "sbrk.h"
FILE NAME: E:\Study\ucOS-II\ucOS-II\PLATFORM\Public\sbrk.h
1 /*****************************************************************************************
2 ** FILE : Sbrk.H **
3 ** DESCRIPTION : This file is generated by Hitachi Project Generator (Ver.1.2) **
4 ** **
5 **-------------------------------------------------------------------------------------**
6 ** **
7 ** Copyright (c) 2001-2002 Hitachi Micro Systems Europe Ltd UK. **
8 ** **
9 ** This program is distributed in the hope that it will be useful, **
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of **
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. **
12 ** **
13 *****************************************************************************************/
14 /* size of area managed by sbrk */
15 #define HEAPSIZE 0x4
FILE NAME: E:\Study\ucOS-II\ucOS-II\PLATFORM\Public\sbrk.c
17
18 //const size_t _sbrk_size= /* Specifies the minimum unit of */
19 /* the defined heap area */
20
21 static union {
22 long dummy ; /* Dummy for 4-byte boundary */
23 E char heap[0x4];
24 /* by sbrk */
25 }heap_area ;
26
27 static char *brk=(char *)&heap_area;/* End address of area assigned */
28
29 /**************************************************************************/
30 /* sbrk:Data write */
31 /* Return value:Start address of the assigned area (Pass) */
32 /* -1 (Failure) */
33 /**************************************************************************/
34 char *sbrk(size_t size) /* Assigned area size */
35 {
36 char *p;
37
38 E if(brk+size>heap_area.heap+0x4)
39 return (char *)-1 ;
40
41 p=brk ; /* Area assignment */
42 brk += size ; /* End address update */
43 return p ;
44 }
H8S,H8/300 SERIES C/C++ COMPILER (V.6.01.02.003) 28-Mar-2008 12:31:39 PAGE 1
******* STACK FRAME INFORMATION ********
FILE NAME: E:\Study\ucOS-II\ucOS-II\PLATFORM\Public\sbrk.c
Function (File sbrk.c , Line 34): sbrk
Optimize Option Specified : No Allocation Information Available
Parameter Area Size : 0x0000 Byte(s)
Linkage Area Size : 0x0002 Byte(s)
Local Variable Size : 0x0000 Byte(s)
Temporary Size : 0x0000 Byte(s)
Register Save Area Size : 0x000a Byte(s)
Total Frame Size : 0x000c Byte(s)
Used Runtime Library Name
$sp_regsv$3 $spregld2$3
H8S,H8/300 SERIES C/C++ COMPILER (V.6.01.02.003) 28-Mar-2008 12:31:39 PAGE 1
******* SECTION SIZE INFORMATION *******
PROGRAM SECTION(P): 0x0000002A Byte(s)
CONSTANT SECTION(C): 0x00000000 Byte(s)
DATA SECTION(D): 0x00000002 Byte(s)
BSS SECTION(B): 0x00000004 Byte(s)
TOTAL PROGRAM SECTION: 0x0000002A Byte(s)
TOTAL CONSTANT SECTION: 0x00000000 Byte(s)
TOTAL DATA SECTION: 0x00000002 Byte(s)
TOTAL BSS SECTION: 0x00000004 Byte(s)
TOTAL PROGRAM SIZE: 0x00000030 Byte(s)
** ASSEMBLER/LINKAGE EDITOR LIMITS INFORMATION **
NUMBER OF EXTERNAL REFERENCE SYMBOLS: 2
NUMBER OF EXTERNAL DEFINITION SYMBOLS: 1
NUMBER OF INTERNAL/EXTERNAL SYMBOLS: 7
**** COMPILE CONDITION INFORMATION ****
COMMAND LINE: -ws=E:\Study\ucOS-II\ucOS-II\PLATFORM\OSTest\Debug\sbrk.h8c
CPU : 300
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -