'\"macro stdmacro
.if n .pH ddi_dki.rminit @(#)rminit	40.6 of 10/10/89
.\" Copyright 1989 AT&T
.de IX
.ie '\\n(.z'' .tm .Index: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9	\\n%
.el \\!.IX \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
..
.nr X
.if \nX=0 .ds x} rminit D3DK "" "DDI/DKI" "\&"
.if \nX=1 .ds x} rminit D3DK "" "DDI/DKI"
.if \nX=2 .ds x} rminit D3DK "" "\&"
.if \nX=3 .ds x} rminit "" "" "\&"
.TH \*(x}
.SH NAME
\f4rminit\f1 \- initialize a private space management map
.IX "\f4rminit\fP(D3DK)"
.SH SYNOPSIS
.nf
.na
\f4#include <sys/map.h>
#include <sys/ddi.h>
.sp 0.5
void rminit(struct map *\f2mp\f4, unsigned long \f2mapsize\f4);\f1
.ad
.fi
.SH ARGUMENTS
.RS 0n 10
.IP "\f2*mp\f1" 10n
Pointer to the memory map from where the resource is drawn.
.IP "\f2mapsize\f1" 10n
Number of entries for the memory map table.
.RE
.SH DESCRIPTION
The \f4rminit\f1 function initializes a private map structure that can
be used for the allocation of memory space.  The map
itself is declared as a structure using the driver prefix in the form
\f2prefix\f1\f4map\f1.  Memory is initially allocated for the map
either by a data array, or by the \f4kmem_alloc\f1(D3DK) function.
.P
The driver must initialize the \f4map\f1 structure by calling
\f4rminit\f1.  However, \f4rminit\f1 does not cause the memory map
entries to be labeled available.  This must be done through
\f4rmfree\f1(D3DK) before objects can actually be allocated from the
memory map.
.P
The system maintains the memory map list structure by size and index,
computed in units appropriate for the memory map.  Units may be byte
addresses, pages of memory, or blocks.  The elements of the memory map
are sorted by index.
.P
Two memory map table entries are reserved for internal system
use and they are not available for memory map use.
.P
\f3NOTE:\f1
The map array must be initialized to zero before calling
\f4rminit\f1.
.SH RETURN VALUE
None
.SH LEVEL
Base or Interrupt
.SH SEE ALSO
\f2BCI Driver Development Guide\f1, Chapter 6, ``Input/Output Operations''
.P
.na
\f4rmalloc\f1(D3DK),
\f4rmwant\f1(D3DK),
\f4rmfree\f1(D3DK),
\f4rmsetwant\f1(D4DK)
.ad
.SH EXAMPLE
See \f4rmalloc\f1(D3DK).
