xref: /csrg-svn/sys/vax/include/param.h (revision 30403)
123264Smckusick /*
229186Smckusick  * Copyright (c) 1982, 1986 Regents of the University of California.
323264Smckusick  * All rights reserved.  The Berkeley software License Agreement
423264Smckusick  * specifies the terms and conditions for redistribution.
523264Smckusick  *
6*30403Skarels  *	@(#)param.h	7.3 (Berkeley) 01/16/87
723264Smckusick  */
89118Ssam 
99118Ssam /*
109118Ssam  * Machine dependent constants for vax.
119118Ssam  */
1229953Skarels 
1329953Skarels #ifndef ENDIAN
1429953Skarels /*
1529953Skarels  * Definitions for byte order,
1629953Skarels  * according to byte significance from low address to high.
1729953Skarels  */
1829953Skarels #define	LITTLE	1234		/* least-significant byte first (vax) */
1929953Skarels #define	BIG	4321		/* most-significant byte first */
2029953Skarels #define	PDP	3412		/* LSB first in word, MSW first in long (pdp) */
2129953Skarels #define	ENDIAN	LITTLE		/* byte order on vax */
2229953Skarels 
23*30403Skarels /*
24*30403Skarels  * Macros for network/external number representation conversion.
25*30403Skarels  */
26*30403Skarels #if ENDIAN == BIG && !defined(lint)
27*30403Skarels #define	ntohl(x)	(x)
28*30403Skarels #define	ntohs(x)	(x)
29*30403Skarels #define	htonl(x)	(x)
30*30403Skarels #define	htons(x)	(x)
31*30403Skarels #else
32*30403Skarels u_short	ntohs(), htons();
33*30403Skarels u_long	ntohl(), htonl();
34*30403Skarels #endif
35*30403Skarels 
369118Ssam #define	NBPG	512		/* bytes/page */
379118Ssam #define	PGOFSET	(NBPG-1)	/* byte offset into page */
389118Ssam #define	PGSHIFT	9		/* LOG2(NBPG) */
399118Ssam 
409118Ssam #define	CLSIZE		2
419118Ssam #define	CLSIZELOG2	1
429118Ssam 
439118Ssam #define	SSIZE	4		/* initial stack size/NBPG */
449118Ssam #define	SINCR	4		/* increment of stack/NBPG */
459118Ssam 
4617546Skarels #define	UPAGES	10		/* pages of u-area */
479118Ssam 
489118Ssam /*
499118Ssam  * Some macros for units conversion
509118Ssam  */
519118Ssam /* Core clicks (512 bytes) to segments and vice versa */
529118Ssam #define	ctos(x)	(x)
539118Ssam #define	stoc(x)	(x)
549118Ssam 
559118Ssam /* Core clicks (512 bytes) to disk blocks */
569118Ssam #define	ctod(x)	(x)
579118Ssam #define	dtoc(x)	(x)
589118Ssam #define	dtob(x)	((x)<<9)
599118Ssam 
609118Ssam /* clicks to bytes */
619118Ssam #define	ctob(x)	((x)<<9)
629118Ssam 
639118Ssam /* bytes to clicks */
649118Ssam #define	btoc(x)	((((unsigned)(x)+511)>>9))
659118Ssam 
669118Ssam /*
679118Ssam  * Macros to decode processor status word.
689118Ssam  */
699118Ssam #define	USERMODE(ps)	(((ps) & PSL_CURMOD) == PSL_CURMOD)
709600Ssam #define	BASEPRI(ps)	(((ps) & PSL_IPL) == 0)
719118Ssam 
7224887Skarels #ifdef KERNEL
7324887Skarels #ifndef LOCORE
7424887Skarels int	cpuspeed;
7529953Skarels #define	DELAY(n)	{ register int N = cpuspeed * (n); while (--N > 0); }
7624887Skarels #endif
7724887Skarels 
7824887Skarels #else KERNEL
799118Ssam #define	DELAY(n)	{ register int N = (n); while (--N > 0); }
8024887Skarels #endif KERNEL
81*30403Skarels #endif ENDIAN
82