
/*
 * @(#)machparam.h	1.1 (National Semiconductor) 8/4/87 13:38:44
 * @(#) copyrights and other release restrictions may apply
 */
#ifndef __MACHPARAM_H__
#define __MACHPARAM_H__

/*
 * Machine dependent constants for 32000.
 */
#define PGSIZE	512		/* bytes per addressable disk sector */
#define	NBPG	(PGSIZE)	/* bytes/page */
#define	PGOFSET	(NBPG-1)	/* byte offset into page */
#define	PGSHIFT	9		/* LOG2(NBPG) */

#define	MCPAGES	2		/* pages in a memory cluster (min allocation) */
#define	CLSIZE		(MCPAGES)
#define	CLSIZELOG2	1

#define	SSIZE	(PGSIZE)	/* initial stack size */
#define	UPAGES	8		/* pages of u-area */
#define USIZE	(UPAGES*PGSIZE)	/* Size of _u. (in bytes) */
#define	P1PAGES	2		/* pages for pte1 page tables (hardware set) */
#define	P1SIZE	(P1PAGES*PGSIZE)/* size of level 1 page tables */

#define TOPUSER	((128*256-2)*PGSIZE)	/* end of user virtual address space */
#define KERNELSTACK	2048	/* amount of space to leave for kernel stack */
#define SWAPLO	0		/* beginning of swap area in blocks */
#define USERCORE TOPUSER	/* Abs. max user proc size */

#define TOPPHYMEM	0x380000	/* Maximum bytes of physical memory */
#define	MEMCHUNK	0x8000		/* "Quantum" amt of physical memory */
#define	MEMOFFSET	0x7fff
#define	MEMSHIFT	15		/* LOG2(MEMCHUNK) */
#define MEMCHKS	(TOPPHYMEM/MEMCHUNK)	/* Maximum physical memory quanta */

/*
 * Some macros for units conversion
 */
#define btoc(s)	s
#define ctob(s)	s
#define	ptoc(n) (((n) + MCPAGES - 1) / MCPAGES)		/* pages to clusters */

/*
 * Macros to decode processor status word.
 */
#define	UMODE	0x100		/* usermode bits */
#define	USERMODE(ps)	((ps.psr & UMODE)==UMODE)

#define	INTPRI	0x800		/* Interrupt  bit */
#define	BASEPRI(ps)	((ps.psr & INTPRI) != 0)

#define	DELAY(n)	{ register int N = (n); while (--N > 0); }

#endif	/* __MACHPARAM_H__ */
