/*
 * $Header: /smsa/bsd:include/arm/machparam.h:bsd  1.10  $
 * $Source: /smsa/bsd:include/arm/machparam.h: $
 *
 * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
 *
 */
/*
 * Copyright (c) 1982, 1986 Regents of the University of California.
 * All rights reserved.  The Berkeley software License Agreement
 * specifies the terms and conditions for redistribution.
 *
 *	@(#)machparam.h	7.1 (Berkeley) 6/5/86
 */


#ifndef	__arm_machparam_h
#define	__arm_machparam_h
#define	__machine_machparam_h	"arm"

/*
 * Architectural constants for ARM/MEMC1 hardware systems.
 */
#define	PMLBASE		1024		/* physical memory logical page base */
#define	NBPG		32768		/* bytes/page */
#define	PGSHIFT		15		/* LOG2(NBPG) */
#define	DMA_PAGES	16		/* 512 */

/* Values derived from those above */

#define	PGOFSET		(NBPG-1)	/* byte offset into page */

/*
 * PHYS_MEM_BASE is the logical base address of physical memory.
 */
#define	PHYS_MEM_BASE	(PMLBASE * NBPG)

/*
 * More very solid definitions: these cannot sensibly be changed, and
 * are implicit and assumed (rather than invoked) in a number of
 * places in the code.
 */
/* Page clustering: very fixed definitions - we aren't on a VAX!! */
#define	CLSIZE		1
#define	CLSIZELOG2	0

#define	UPAGES		1		/* pages of u-area */

/*
 * Some macros for units conversion
 */
/* Core clicks (32768 bytes) to segments and vice versa */
#define	ctos(x)	(x)
#define	stoc(x)	(x)

/* Core clicks (32768 bytes) to disk blocks */

#define	ctod(x)	((x)*(NBPG/512))
#define	dtoc(x)	((unsigned)(x)/(NBPG/512))

#define	dtob(x)	((x)*512)

/* clicks to bytes */
#define	ctob(x)	((x)*NBPG)

/* bytes to clicks */
#define	btoc(x)	(((unsigned)(x)+(NBPG-1))/NBPG)

/* the number of whole clicks in a number of bytes */
#define btowholec(x) ((unsigned)(x)/NBPG)

/*
 * Macros to decode processor status word.
 */

#define	USER_MODE		0
#define	SUPER_MODE		3
#define	IS_USER_MODE(mode)	((mode) == USER_MODE)

#endif/*__arm_machparam_h*/

/* EOF machparam.h */
