xref: /csrg-svn/sys/vax/include/param.h (revision 24887)
123264Smckusick /*
223264Smckusick  * Copyright (c) 1982 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*24887Skarels  *	@(#)param.h	6.4 (Berkeley) 09/17/85
723264Smckusick  */
89118Ssam 
99118Ssam /*
109118Ssam  * Machine dependent constants for vax.
119118Ssam  */
129118Ssam #define	NBPG	512		/* bytes/page */
139118Ssam #define	PGOFSET	(NBPG-1)	/* byte offset into page */
149118Ssam #define	PGSHIFT	9		/* LOG2(NBPG) */
159118Ssam 
169118Ssam #define	CLSIZE		2
179118Ssam #define	CLSIZELOG2	1
189118Ssam 
199118Ssam #define	SSIZE	4		/* initial stack size/NBPG */
209118Ssam #define	SINCR	4		/* increment of stack/NBPG */
219118Ssam 
2217546Skarels #define	UPAGES	10		/* pages of u-area */
239118Ssam 
249118Ssam /*
259118Ssam  * Some macros for units conversion
269118Ssam  */
279118Ssam /* Core clicks (512 bytes) to segments and vice versa */
289118Ssam #define	ctos(x)	(x)
299118Ssam #define	stoc(x)	(x)
309118Ssam 
319118Ssam /* Core clicks (512 bytes) to disk blocks */
329118Ssam #define	ctod(x)	(x)
339118Ssam #define	dtoc(x)	(x)
349118Ssam #define	dtob(x)	((x)<<9)
359118Ssam 
369118Ssam /* clicks to bytes */
379118Ssam #define	ctob(x)	((x)<<9)
389118Ssam 
399118Ssam /* bytes to clicks */
409118Ssam #define	btoc(x)	((((unsigned)(x)+511)>>9))
419118Ssam 
429118Ssam /*
439118Ssam  * Macros to decode processor status word.
449118Ssam  */
459118Ssam #define	USERMODE(ps)	(((ps) & PSL_CURMOD) == PSL_CURMOD)
469600Ssam #define	BASEPRI(ps)	(((ps) & PSL_IPL) == 0)
479118Ssam 
48*24887Skarels #ifdef KERNEL
49*24887Skarels #ifndef LOCORE
50*24887Skarels int	cpuspeed;
51*24887Skarels #endif
52*24887Skarels #define	DELAY(n)	{ register int N = cpuspeed * (n); while (--N > 0); }
53*24887Skarels 
54*24887Skarels #else KERNEL
559118Ssam #define	DELAY(n)	{ register int N = (n); while (--N > 0); }
56*24887Skarels #endif KERNEL
57