Commit | Line | Data |
---|---|---|
dd3b648e RP |
1 | /* vxWorks.h - VxWorks standard definitions header */ |
2 | ||
17eff8c1 SG |
3 | /* Copyright 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1992 Free Software Foundation, Inc. |
4 | ||
5 | This code was donated by Wind River Systems, Inc. */ | |
dd3b648e RP |
6 | |
7 | /* | |
8 | modification history | |
9 | -------------------- | |
10 | 01z,05oct90,shl added copyright notice. | |
11 | made #endif ANSI style. | |
12 | 01y,28sep90,del added I960 defines. | |
13 | 01x,29may90,del moved types to vxTypes.h | |
14 | 01w,09apr90,jcf added timeout definitions. | |
15 | 01v,24jan90,gae moved network configuration flags here from makefile's. | |
16 | 01u,01sep88,mcl definition of INSTR dependent on processor family; added SPARC. | |
17 | +gae added MC680X0 and defined CPU_FAMILY. | |
18 | 01t,08apr89,dnw added ifdef to prevent inclusion of vxWorks.h more than once. | |
19 | 01s,22jun88,dnw moved READ, WRITE, and UPDATE back here from ioLib.h. | |
20 | 01r,22apr88,gae oops! forgot some #endif's in 01q. | |
21 | 01q,12apr88,gae removed QUICK & WAIT; added STD_{IN,OUT,ERR}. | |
22 | fixed #define's of FALSE, TRUE, etc. | |
23 | moved READ, WRITE, and UPDATE to ioLib.h. | |
24 | 01p,04dec87,dnw added undefine of MC68000 to get around Green Hills bug that | |
25 | pre-defines MC68000. | |
26 | 01o,12nov87,ecs added type ULONG. | |
27 | 01n,08feb86,dnw added types INSTR, UINT, USHORT. | |
28 | 01m,14oct85,rdc added BUS types. | |
29 | 01l,16jul85,jlf added conditional for NULL and EOF. | |
30 | 01k,24jun85,rdc installed condtional compile so we can include in | |
31 | assembly language files. See instructions below. | |
32 | Added System type macro and CPU type macro. | |
33 | 01j,13jun85,dnw cleaned-up, removed more obsolete stuff to wrs.h | |
34 | 01i,11sep84,jlf changed name from wrs.h to vxWorks.h. removed GLOBAL. | |
35 | 01h,03jun84,dnw removed IGNORE declaration. | |
36 | 01g,09apr84,jlf added MEMBER_SIZE macro. | |
37 | 01f,14dec83,dnw added MSB, LSB macros | |
38 | 01e,17nov83,jlf added STATUS type, for routines which return a status. | |
39 | 01d,13jul83,dnw added NELEMENTS macro | |
40 | 01c,14May83,dnw added OFFSET macro | |
41 | 01b,17Feb83,dnw added stuff from Whitesmiths std.h | |
42 | 01a,15Feb83,dnw written | |
43 | */ | |
44 | ||
45 | #ifndef INCvxWorksh | |
46 | #define INCvxWorksh | |
47 | ||
dd3b648e RP |
48 | #if !defined(EOF) || (EOF!=(-1)) |
49 | #define EOF (-1) | |
50 | #endif | |
51 | ||
52 | #if !defined(FALSE) || (FALSE!=0) | |
53 | #define FALSE 0 | |
54 | #endif | |
55 | ||
56 | #if !defined(TRUE) || (TRUE!=1) | |
57 | #define TRUE 1 | |
58 | #endif | |
59 | ||
60 | ||
61 | #define NONE (-1) /* for times when NULL won't do */ | |
62 | #define EOS '\0' /* C string terminator */ | |
63 | ||
64 | ||
65 | /* return status values */ | |
66 | ||
67 | #define OK 0 | |
68 | #define ERROR (-1) | |
69 | ||
70 | /* timeout defines */ | |
71 | ||
72 | #define NO_WAIT 0 | |
73 | #define WAIT_FOREVER (-1) | |
74 | ||
75 | /* low-level I/O input, output, error fd's */ | |
76 | ||
77 | #define STD_IN 0 | |
78 | #define STD_OUT 1 | |
79 | #define STD_ERR 2 | |
80 | ||
81 | /* modes - must match O_RDONLY/O_WRONLY/O_RDWR in ioLib.h! */ | |
82 | ||
83 | #define READ 0 | |
84 | #define WRITE 1 | |
85 | #define UPDATE 2 | |
86 | ||
87 | /* SYSTEM types */ | |
88 | ||
89 | #define V7 1 /* ATT version 7 */ | |
90 | #define SYS_V 2 /* ATT System 5 */ | |
91 | #define BSD_4_2 3 /* Berkeley BSD 4.2 */ | |
92 | ||
93 | /* CPU types */ | |
94 | ||
95 | /* The Green Hills compiler pre-defines "MC68000"!! */ | |
96 | #ifdef MC68000 | |
97 | #undef MC68000 | |
98 | #endif | |
99 | ||
100 | #define MC68000 1 | |
101 | #define MC68010 2 | |
102 | #define MC68020 3 | |
103 | #define MC68030 4 | |
104 | #define MC68040 5 | |
105 | #define MC680X0 9 | |
106 | ||
107 | #define SPARC 10 | |
108 | ||
109 | #ifndef I960 | |
110 | #define I960 20 | |
111 | #endif | |
112 | ||
113 | #define I960KB 21 | |
114 | #define I960CA 22 | |
115 | ||
116 | #if CPU==MC68000 || CPU==MC68010 || CPU==MC68020 || CPU==MC68030 | |
117 | #define CPU_FAMILY MC680X0 | |
118 | #endif /* CPU==MC68000 || CPU==MC68010 || CPU==MC68020 || CPU==MC68030 */ | |
119 | ||
120 | #if CPU==SPARC | |
121 | #define CPU_FAMILY SPARC | |
122 | #endif /* CPU==SPARC */ | |
123 | ||
124 | #if CPU==I960KB | |
125 | #define CPU_FAMILY I960 | |
126 | #endif /* CPU==I960KB */ | |
127 | ||
128 | #if CPU==I960CA | |
129 | #define CPU_FAMILY I960 | |
130 | #endif /* CPU==I960CA */ | |
131 | ||
132 | /* BUS types */ | |
133 | ||
134 | #define VME_BUS 1 | |
135 | #define MULTI_BUS 2 | |
136 | ||
137 | /* network configuration parameters */ | |
138 | ||
139 | #define INET /* include internet protocols */ | |
140 | #define BSD 43 /* BSD 4.3 -like OS */ | |
141 | #define BSDDEBUG /* turn on debug */ | |
142 | #define GATEWAY /* tables to be initialized for gateway routing */ | |
143 | ||
144 | /* common macros */ | |
145 | ||
146 | #define MSB(x) (((x) >> 8) & 0xff) /* most signif byte of 2-byte integer */ | |
147 | #define LSB(x) ((x) & 0xff) /* least signif byte of 2-byte integer*/ | |
148 | ||
149 | #define OFFSET(structure, member) /* byte offset of member in structure*/\ | |
150 | ((int) &(((structure *) 0) -> member)) | |
151 | ||
152 | #define MEMBER_SIZE(structure, member) /* size of a member of a structure */\ | |
153 | (sizeof (((structure *) 0) -> member)) | |
154 | ||
155 | #define NELEMENTS(array) /* number of elements in an array */ \ | |
156 | (sizeof (array) / sizeof ((array) [0])) | |
157 | ||
158 | #define FOREVER for (;;) | |
159 | ||
dd3b648e RP |
160 | /* storage class specifier definitions */ |
161 | ||
162 | #define FAST register | |
163 | #define IMPORT extern | |
164 | #define LOCAL static | |
165 | ||
166 | ||
167 | /* include typedefs - must come after CPU_FAMILY definitions above */ | |
168 | ||
169 | #include "vxTypes.h" | |
170 | ||
171 | #endif /* INCvxWorksh */ |