/*
 * $Header: /smsa/bsd:include/sys/dmap.h:bsd  1.16  $
 * $Source: /smsa/bsd:include/sys/dmap.h: $
 *
 * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
 *
 */
/* @(#)dmap.h	1.2 87/05/15 3.2/4.3NFSSRC */
/*
 * 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.
 *
 *	@(#)dmap.h	7.1 (Berkeley) 6/4/86
 */

#ifndef	__sys_dmap_h
#define	__sys_dmap_h
/*
 * Definitions for the mapping of a process's virtual
 * space to the physical swap area - the disk map.
 */
#define	NDMAP 		38	/* size of the swap area map. */

struct	dmap
{
	swblk_t	dm_size;	/* current size used by process */
	swblk_t	dm_alloc;	/* amount of physical swap space allocated */
	swblk_t	dm_map[NDMAP];	/* first disk block number in each chunk */
};

/*
 * The chunk sizes in dmap.dm_map[] start at dmmin and are doubled - up
 * to a max size of dmmax - for each bit set in dmap_bits, after use of
 * the corresponding sized map entry. dmap_bits is #defined below.
 */
struct dmap_bitmap
{
    u_char bitmap[howmany(NDMAP, NBBY)];
};

#ifdef	_KERNEL
#define zero_dmap(dm) bzero((caddr_t)dm, sizeof(struct dmap))
int dmmin, dmmax, dmtext;
struct dmap_bitmap dmap_bitmap;
#define dmap_bits dmap_bitmap.bitmap
#endif

/*
 * The following structure is that ``returned''
 * from a call to vstodb().
 */
struct	dblock
{
	swblk_t	db_base;	/* base of physical contig drum block */
	swblk_t	db_size;	/* size of block */
};

#endif/*__sys_dmap_h*/

/* EOF dmap.h */
