1 | /* |
---|
2 | (C) Copyright IBM Corp. 2006 |
---|
3 | |
---|
4 | All rights reserved. |
---|
5 | |
---|
6 | Redistribution and use in source and binary forms, with or without |
---|
7 | modification, are permitted provided that the following conditions are met: |
---|
8 | |
---|
9 | * Redistributions of source code must retain the above copyright notice, |
---|
10 | this list of conditions and the following disclaimer. |
---|
11 | * Redistributions in binary form must reproduce the above copyright |
---|
12 | notice, this list of conditions and the following disclaimer in the |
---|
13 | documentation and/or other materials provided with the distribution. |
---|
14 | * Neither the name of IBM nor the names of its contributors may be |
---|
15 | used to endorse or promote products derived from this software without |
---|
16 | specific prior written permission. |
---|
17 | |
---|
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
21 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
---|
22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
26 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
---|
28 | POSSIBILITY OF SUCH DAMAGE. |
---|
29 | |
---|
30 | Author: Joel Schopp <jschopp@austin.ibm.com> |
---|
31 | */ |
---|
32 | |
---|
33 | #ifndef __ASSEMBLER__ |
---|
34 | #include <errno.h> |
---|
35 | #include <sys/syscall.h> |
---|
36 | #endif /* !__ASSEMBLER__ */ |
---|
37 | |
---|
38 | #define SPE_C99_SIGNALCODE 0x2100 |
---|
39 | |
---|
40 | #define SPE_C99_OP_SHIFT 24 |
---|
41 | #define SPE_C99_OP_MASK 0xff |
---|
42 | #define SPE_C99_DATA_MASK 0xffffff |
---|
43 | |
---|
44 | #define SPE_C99_CLEARERR 1 |
---|
45 | #define SPE_C99_FCLOSE 2 |
---|
46 | #define SPE_C99_FEOF 3 |
---|
47 | #define SPE_C99_FERROR 4 |
---|
48 | #define SPE_C99_FFLUSH 5 |
---|
49 | #define SPE_C99_FGETC 6 |
---|
50 | #define SPE_C99_FGETPOS 7 |
---|
51 | #define SPE_C99_FGETS 8 |
---|
52 | #define SPE_C99_FILENO 9 |
---|
53 | #define SPE_C99_FOPEN 10 //implemented |
---|
54 | #define SPE_C99_FPUTC 11 |
---|
55 | #define SPE_C99_FPUTS 12 |
---|
56 | #define SPE_C99_FREAD 13 |
---|
57 | #define SPE_C99_FREOPEN 14 |
---|
58 | #define SPE_C99_FSEEK 15 |
---|
59 | #define SPE_C99_FSETPOS 16 |
---|
60 | #define SPE_C99_FTELL 17 |
---|
61 | #define SPE_C99_FWRITE 18 |
---|
62 | #define SPE_C99_GETC 19 |
---|
63 | #define SPE_C99_GETCHAR 20 |
---|
64 | #define SPE_C99_GETS 21 |
---|
65 | #define SPE_C99_PERROR 22 |
---|
66 | #define SPE_C99_PUTC 23 |
---|
67 | #define SPE_C99_PUTCHAR 24 |
---|
68 | #define SPE_C99_PUTS 25 |
---|
69 | #define SPE_C99_REMOVE 26 |
---|
70 | #define SPE_C99_RENAME 27 |
---|
71 | #define SPE_C99_REWIND 28 |
---|
72 | #define SPE_C99_SETBUF 29 |
---|
73 | #define SPE_C99_SETVBUF 30 |
---|
74 | #define SPE_C99_SYSTEM 31 //not yet implemented in newlib |
---|
75 | #define SPE_C99_TMPFILE 32 |
---|
76 | #define SPE_C99_TMPNAM 33 |
---|
77 | #define SPE_C99_UNGETC 34 |
---|
78 | #define SPE_C99_VFPRINTF 35 |
---|
79 | #define SPE_C99_VFSCANF 36 |
---|
80 | #define SPE_C99_VPRINTF 37 |
---|
81 | #define SPE_C99_VSCANF 38 |
---|
82 | #define SPE_C99_VSNPRINTF 39 |
---|
83 | #define SPE_C99_VSPRINTF 40 |
---|
84 | #define SPE_C99_VSSCANF 41 |
---|
85 | #define SPE_C99_LAST_OPCODE 42 |
---|
86 | |
---|
87 | #define SPE_C99_NR_OPCODES ((SPE_C99_LAST_OPCODE - SPE_C99_CLEARERR) + 1) |
---|
88 | |
---|
89 | #define SPE_STDIN 1 |
---|
90 | #define SPE_STDOUT 2 |
---|
91 | #define SPE_STDERR 3 |
---|
92 | #define SPE_FOPEN_MAX FOPEN_MAX |
---|
93 | |
---|
94 | #ifdef __ASSEMBLER__ |
---|
95 | #define SPE_STACK_REGS 72 /* Number of registers preserved in stack |
---|
96 | in case of variable argument API. */ |
---|
97 | #else /* !__ASSEMBLER__ */ |
---|
98 | struct spe_reg128{ |
---|
99 | unsigned int slot[4]; |
---|
100 | }; |
---|
101 | |
---|
102 | void __sinit (struct _reent *); |
---|
103 | FILE *__sfp (struct _reent *); |
---|
104 | #define __sfp_free(fp) ( (fp)->_fp = 0 ) |
---|
105 | |
---|
106 | #define CHECK_INIT(ptr) \ |
---|
107 | do { if ((ptr) && !(ptr)->__sdidinit) __sinit (ptr); } while (0) |
---|
108 | #define CHECK_STD_INIT(ptr) /* currently, do nothing */ |
---|
109 | #define CHECK_STR_INIT(ptr) /* currently, do nothing */ |
---|
110 | #endif /* __ASSEMBLER__ */ |
---|