/* $Copyright:	$
 * Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
 * Sequent Computer Systems, Inc.   All rights reserved.
 *  
 * This software is furnished under a license and may be used
 * only in accordance with the terms of that license and with the
 * inclusion of the above copyright notice.   This software may not
 * be provided or otherwise made available to, or used by, any
 * other person.  No title to or ownership of the software is
 * hereby transferred.
 */

#ident		"$Header: pmap.h 1.4 89/08/07 $"

#ifndef	_SYS_PMAP_H_

/*
 * pmap.h
 *	Physical-mapped memory driver ioctl and misc driver parameters.
 */

/* $Log:	pmap.h,v $
 */

/* 
 * IO controls.
 */

struct	pmap_ioc {
	ulong	pi_paddr;			/* start physical address */
	ulong	pi_size;			/* size (bytes) */
	unchar	pi_flags;			/* flags (see below) */
};

#define	PTYPE		('p'<<8)
#define	PMAPIOCGETP	(PTYPE|0)		/* get parameters */
#define	PMAPIOCSETP	(PTYPE|1)		/* set parameters */
#define	PMAPIOCEXCL	(PTYPE|2)		/* exclusive access */
#define	PMAPIOCNXCL	(PTYPE|3)		/* shared access */

/*
 * Flags.
 * PMAP_IOCFLAGS are those copied in by PMAPIOCSETP.
 */

#define	PMAP_EXCL	0x01			/* exclusive access */
#define	PMAP_MAPPED	0x02			/* is currently mapped */
#define	PMAP_NPMEM	0x04			/* map MM_NPMEM, else MM_PHYS */

#define	PMAP_IOCFLAGS	(PMAP_NPMEM)

#ifdef	INKERNEL
/*
 * Internal driver structures.
 */

struct	pmap_unit {
	ulong		pm_paddr;		/* start physical address */
	ulong		pm_size;		/* size (bytes) */
	unchar		pm_flags;		/* flags (see above) */
	short		pm_nopen;		/* current # opens */
	short		pm_nmaps;		/* current # maps */
};
#endif	/* INKERNEL */

#define	_SYS_PMAP_H_
#endif	/* _SYS_PMAP_H_ */
