xref: /xnu-10002.81.5/osfmk/man/default_pager_add_segment.html (revision 5e3eaea39dcf651e66cb99ba7d70e32cc4a99587)
1*5e3eaea3SApple OSS Distributions<h2>default_pager_add_segment</h2>
2*5e3eaea3SApple OSS Distributions<hr>
3*5e3eaea3SApple OSS Distributions<p>
4*5e3eaea3SApple OSS Distributions<strong>Server Interface</strong> - Add additional backing storage for a default pager.
5*5e3eaea3SApple OSS Distributions<h3>SYNOPSIS</h3>
6*5e3eaea3SApple OSS Distributions<pre>
7*5e3eaea3SApple OSS Distributions<strong>#include&lt mach/default_pager_object.h&gt</strong>
8*5e3eaea3SApple OSS Distributions
9*5e3eaea3SApple OSS Distributions<strong>kern_return_t   default_pager_add_segment</strong>
10*5e3eaea3SApple OSS Distributions                <strong>(mach_port_t</strong>                      <var>backing_store</var>,
11*5e3eaea3SApple OSS Distributions                 <strong>mach_port_t</strong>                             <var>device</var>,
12*5e3eaea3SApple OSS Distributions                 <strong>recnum_t</strong>                                <var>offset</var>,
13*5e3eaea3SApple OSS Distributions                 <strong>recnum_t</strong>                                 <var>count</var>,
14*5e3eaea3SApple OSS Distributions                 <strong>int</strong>                                <var>record_size</var><strong>);</strong>
15*5e3eaea3SApple OSS Distributions</pre>
16*5e3eaea3SApple OSS Distributions<h3>PARAMETERS</h3>
17*5e3eaea3SApple OSS Distributions<dl>
18*5e3eaea3SApple OSS Distributions<p>
19*5e3eaea3SApple OSS Distributions<dt> <var>backing_store</var>
20*5e3eaea3SApple OSS Distributions<dd>
21*5e3eaea3SApple OSS Distributions[in backing store (receive) right] The backing store port.
22*5e3eaea3SApple OSS Distributions<p>
23*5e3eaea3SApple OSS Distributions<dt> <var>device</var>
24*5e3eaea3SApple OSS Distributions<dd>
25*5e3eaea3SApple OSS Distributions[in device port] The port for the device containing the backing storage
26*5e3eaea3SApple OSS Distributionspartition.
27*5e3eaea3SApple OSS Distributions<p>
28*5e3eaea3SApple OSS Distributions<dt> <var>offset</var>
29*5e3eaea3SApple OSS Distributions<dd>
30*5e3eaea3SApple OSS Distributions[in scalar] The offset, in <var>record_size units</var>, to the beginning of the
31*5e3eaea3SApple OSS Distributionsbacking storage on the device.
32*5e3eaea3SApple OSS Distributions<p>
33*5e3eaea3SApple OSS Distributions<dt> <var>count</var>
34*5e3eaea3SApple OSS Distributions<dd>
35*5e3eaea3SApple OSS Distributions[in scalar] The number of <var>record_size</var> units
36*5e3eaea3SApple OSS Distributionsin the partition/segment.
37*5e3eaea3SApple OSS Distributions<p>
38*5e3eaea3SApple OSS Distributions<dt> <var>record_size</var>
39*5e3eaea3SApple OSS Distributions<dd>
40*5e3eaea3SApple OSS Distributions[in scalar] The size, in bytes, of the storage device record.
41*5e3eaea3SApple OSS Distributions</dl>
42*5e3eaea3SApple OSS Distributions<h3>DESCRIPTION</h3>
43*5e3eaea3SApple OSS Distributions<p>
44*5e3eaea3SApple OSS DistributionsThe <strong>default_pager_add_segment</strong> function is called to add a partition to
45*5e3eaea3SApple OSS Distributionsa default pager's backing storage (i.e. expand the amount of backing
46*5e3eaea3SApple OSS Distributionsstorage available to a memory manager). The kernel does not make
47*5e3eaea3SApple OSS Distributionsthis call itself (which is why it can be a synchronous call); this
48*5e3eaea3SApple OSS Distributionsrequest is only issued by tasks holding the backing store port,
49*5e3eaea3SApple OSS Distributionscreated with <strong>default_pager_backing_store_create</strong>, for a default memory
50*5e3eaea3SApple OSS Distributionsmanager.
51*5e3eaea3SApple OSS DistributionsThe result is that the pager may use count records on device starting
52*5e3eaea3SApple OSS Distributionsat offset for paging, and each record is record_size bytes in length
53*5e3eaea3SApple OSS Distributions(note that the device_* calls are, or can be, record oriented).
54*5e3eaea3SApple OSS Distributions<h3>RETURN VALUES</h3>
55*5e3eaea3SApple OSS Distributions<dl>
56*5e3eaea3SApple OSS Distributions<p>
57*5e3eaea3SApple OSS Distributions<dt> <strong>KERN_FAILURE</strong>
58*5e3eaea3SApple OSS Distributions<dd>
59*5e3eaea3SApple OSS DistributionsThe default pager does not support this operation.
60*5e3eaea3SApple OSS Distributions<p>
61*5e3eaea3SApple OSS Distributions<dt> <strong>KERN_INVALID_ARGUMENT</strong>
62*5e3eaea3SApple OSS Distributions<dd>
63*5e3eaea3SApple OSS DistributionsThe <var>backing_store</var> port does not represent a valid backing store or the
64*5e3eaea3SApple OSS Distributionsspecified segment overlaps an existing partition.
65*5e3eaea3SApple OSS Distributions<p>
66*5e3eaea3SApple OSS Distributions<dt> <strong>KERN_RESOURCE_SHORTAGE</strong>
67*5e3eaea3SApple OSS Distributions<dd>
68*5e3eaea3SApple OSS DistributionsThe default pager is unable to allocate internal resources
69*5e3eaea3SApple OSS Distributions     to manage the new backing storage.
70*5e3eaea3SApple OSS Distributions<p>
71*5e3eaea3SApple OSS Distributions<dt> <strong>KERN_SUCCESS</strong>
72*5e3eaea3SApple OSS Distributions<dd>
73*5e3eaea3SApple OSS DistributionsThe operation was successful.
74*5e3eaea3SApple OSS Distributions</dl>
75*5e3eaea3SApple OSS Distributions<h3>RELATED INFORMATION</h3>
76*5e3eaea3SApple OSS Distributions<p>
77*5e3eaea3SApple OSS DistributionsFunctions:
78*5e3eaea3SApple OSS Distributions<a href="DP_backing_store_create.html"><strong>default_pager_backing_store_create</strong></a>,
79*5e3eaea3SApple OSS Distributions<a href="DP_backing_store_delete.html"><strong>default_pager_backing_store_delete</strong></a>,
80*5e3eaea3SApple OSS Distributions<a href="DP_backing_store_info.html"><strong>default_pager_backing_store_info</strong></a>.
81