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