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