xref: /xnu-11215.41.3/osfmk/man/memory_object_create.html (revision 33de042d024d46de5ff4e89f2471de6608e37fa4)
1*33de042dSApple OSS Distributions<h2>memory_object_create</h2>
2*33de042dSApple OSS Distributions<hr>
3*33de042dSApple OSS Distributions<p>
4*33de042dSApple OSS Distributions<strong>Function</strong> - Request that the default pager handle management requests on the specified memory object.
5*33de042dSApple OSS Distributions<h3>SYNOPSIS</h3>
6*33de042dSApple OSS Distributions<pre>
7*33de042dSApple OSS Distributions<strong>kern_return_t   memory_object_create</strong>
8*33de042dSApple OSS Distributions                <strong>(memory_object_t</strong>                          <var>pager</var>,
9*33de042dSApple OSS Distributions                 <strong>memory_object_t</strong>              <var>new_memory_object</var>,
10*33de042dSApple OSS Distributions                 <strong>vm_size_t</strong>                      <var>new_object_size</var>,
11*33de042dSApple OSS Distributions                 <strong>memory_object_control_t</strong>            <var>new_control</var>,
12*33de042dSApple OSS Distributions                 <strong>vm_size_t</strong>                        <var>new_page_size</var><strong>);</strong>
13*33de042dSApple OSS Distributions
14*33de042dSApple OSS Distributions
15*33de042dSApple OSS Distributions<strong>kern_return_t   seqnos_memory_object_create</strong>
16*33de042dSApple OSS Distributions                <strong>(memory_object_t</strong>                          <var>pager</var>,
17*33de042dSApple OSS Distributions                 <strong>mach_port_seqno_t</strong>                        <var>seqno</var>,
18*33de042dSApple OSS Distributions                 <strong>memory_object_t</strong>              <var>new_memory_object</var>,
19*33de042dSApple OSS Distributions                 <strong>vm_size_t</strong>                      <var>new_object_size</var>,
20*33de042dSApple OSS Distributions                 <strong>memory_object_control_t</strong>            <var>new_control</var>,
21*33de042dSApple OSS Distributions                 <strong>vm_size_t</strong>                        <var>new_page_size</var><strong>);</strong>
22*33de042dSApple OSS Distributions</pre>
23*33de042dSApple OSS Distributions<h3>PARAMETERS</h3>
24*33de042dSApple OSS Distributions<dl>
25*33de042dSApple OSS Distributions<p>
26*33de042dSApple OSS Distributions<dt> <var>pager</var>
27*33de042dSApple OSS Distributions<dd>
28*33de042dSApple OSS Distributions[in default-pager (receive) right]
29*33de042dSApple OSS DistributionsThe default memory manager service
30*33de042dSApple OSS Distributionsport.
31*33de042dSApple OSS Distributions<p>
32*33de042dSApple OSS Distributions<dt> <var>seqno</var>
33*33de042dSApple OSS Distributions<dd>
34*33de042dSApple OSS Distributions[in scalar]
35*33de042dSApple OSS DistributionsThe sequence number of this message relative to the pager
36*33de042dSApple OSS Distributionsport.
37*33de042dSApple OSS Distributions<p>
38*33de042dSApple OSS Distributions<dt> <var>new_memory_object</var>
39*33de042dSApple OSS Distributions<dd>
40*33de042dSApple OSS Distributions[in abstract-memory-object receive right]
41*33de042dSApple OSS DistributionsThe port representing the
42*33de042dSApple OSS Distributionsnew abstract memory object created by the kernel.
43*33de042dSApple OSS Distributions<p>
44*33de042dSApple OSS Distributions<dt> <var>new_object_size</var>
45*33de042dSApple OSS Distributions<dd>
46*33de042dSApple OSS Distributions[in scalar]
47*33de042dSApple OSS DistributionsThe expected size for the new object, in bytes.
48*33de042dSApple OSS Distributions<p>
49*33de042dSApple OSS Distributions<dt> <var>new_control</var>
50*33de042dSApple OSS Distributions<dd>
51*33de042dSApple OSS Distributions[in memory-cache-control send right]
52*33de042dSApple OSS DistributionsThe memory cache control port
53*33de042dSApple OSS Distributionsto be used by the memory manager when making cache management
54*33de042dSApple OSS Distributionsrequests for the new object.
55*33de042dSApple OSS Distributions<p>
56*33de042dSApple OSS Distributions<dt> <var>new_page_size</var>
57*33de042dSApple OSS Distributions<dd>
58*33de042dSApple OSS Distributions[in scalar]
59*33de042dSApple OSS DistributionsThe page size used by the kernel.  All calls involving this
60*33de042dSApple OSS Distributionskernel must use data sizes that are integral multiples of this page size.
61*33de042dSApple OSS Distributions</dl>
62*33de042dSApple OSS Distributions<h3>DESCRIPTION</h3>
63*33de042dSApple OSS Distributions<p>
64*33de042dSApple OSS DistributionsA <strong>memory_object_create</strong> function is called as the result
65*33de042dSApple OSS Distributionsof a message from the
66*33de042dSApple OSS Distributionskernel requesting that the default memory manager accept responsibility
67*33de042dSApple OSS Distributionsfor the
68*33de042dSApple OSS Distributionsnew memory object created by the kernel.  The kernel makes this
69*33de042dSApple OSS Distributionscall only to the
70*33de042dSApple OSS Distributionssystem default memory manager.
71*33de042dSApple OSS Distributions<p>
72*33de042dSApple OSS DistributionsThe new memory object initially consists of zero-filled pages.  Only memory
73*33de042dSApple OSS Distributionspages that are actually written are provided to the memory manager.  When
74*33de042dSApple OSS Distributionsprocessing <strong>memory_object_data_request</strong> calls from the
75*33de042dSApple OSS Distributionskernel, the default
76*33de042dSApple OSS Distributionsmemory manager must use <strong>memory_object_data_unavailable</strong>
77*33de042dSApple OSS Distributionsfor any pages that have not been written previously.
78*33de042dSApple OSS Distributions<p>
79*33de042dSApple OSS DistributionsThe kernel does not expect a reply to this call.  The kernel assumes that the
80*33de042dSApple OSS Distributionsdefault memory manager will be ready to handle data requests to this object and
81*33de042dSApple OSS Distributionsdoes not need the confirmation of a <strong>memory_object_change_attributes</strong> call.
82*33de042dSApple OSS Distributions<h3>NOTES</h3>
83*33de042dSApple OSS Distributions<p>
84*33de042dSApple OSS DistributionsThe kernel requires memory objects to provide temporary backing storage for
85*33de042dSApple OSS Distributionszero-filled memory created by <strong>vm_allocate</strong> calls, issued
86*33de042dSApple OSS Distributionsby both user tasks and
87*33de042dSApple OSS Distributionsthe kernel itself.  The kernel allocates an abstract memory object port to
88*33de042dSApple OSS Distributionsrepresent the temporary backing storage and uses <strong>memory_object_create</strong>
89*33de042dSApple OSS Distributionsto pass the
90*33de042dSApple OSS Distributionsnew memory object to the default memory manager, which provides the storage.
91*33de042dSApple OSS Distributions<p>
92*33de042dSApple OSS DistributionsThe default memory manager is a trusted system component that is identified to
93*33de042dSApple OSS Distributionsthe kernel at system initialization time.  The default memory manager can also
94*33de042dSApple OSS Distributionsbe changed at run time using the <strong>host_default_memory_manager</strong> call.
95*33de042dSApple OSS Distributions<p>
96*33de042dSApple OSS DistributionsThe contents of a kernel-created (as opposed to a user-created) memory object
97*33de042dSApple OSS Distributionscan be modified only in main memory.  The default memory manager must not
98*33de042dSApple OSS Distributionschange the contents of a temporary memory object, or allow unrelated tasks to
99*33de042dSApple OSS Distributionsaccess the memory object, control, or name port.
100*33de042dSApple OSS Distributions<p>
101*33de042dSApple OSS DistributionsThe kernel provides the size of a temporary memory object based on the
102*33de042dSApple OSS Distributionsallocated size.  Since the object is not mapped by other tasks,
103*33de042dSApple OSS Distributionsthe object will not grow
104*33de042dSApple OSS Distributionsby explicit action.  However, the kernel may coalesce adjacent
105*33de042dSApple OSS Distributionstemporary objects
106*33de042dSApple OSS Distributionsin such a way that this object may appear to grow.  As such,
107*33de042dSApple OSS Distributionsthe supplied object
108*33de042dSApple OSS Distributionssize is merely a hint as to the maximum size.
109*33de042dSApple OSS Distributions<h3>RETURN VALUES</h3>
110*33de042dSApple OSS Distributions<p>
111*33de042dSApple OSS DistributionsOnly generic errors apply.
112*33de042dSApple OSS Distributions<h3>RELATED INFORMATION</h3>
113*33de042dSApple OSS Distributions<p>
114*33de042dSApple OSS DistributionsFunctions:
115*33de042dSApple OSS Distributions<a href="DP_object_create.html"><strong>default_pager_object_create</strong></a>,
116*33de042dSApple OSS Distributions<a href="MO_data_initialize.html"><strong>memory_object_data_initialize</strong></a>,
117*33de042dSApple OSS Distributions<a href="MO_data_unavailable.html"><strong>memory_object_data_unavailable</strong></a>,
118*33de042dSApple OSS Distributions<a href="MO_default_server.html"><strong>memory_object_default_server</strong></a>,
119*33de042dSApple OSS Distributions<a href="SMO_default_server.html"><strong>seqnos_memory_object_default_server</strong></a>.
120