]>
Commit | Line | Data |
---|---|---|
1 | <h2>memory_object_init</h2> | |
2 | <hr> | |
3 | <p> | |
4 | <strong>Server Interface</strong> - Initializes a memory object. | |
5 | <h3>SYNOPSIS</h3> | |
6 | <pre> | |
7 | <strong>kern_return_t memory_object_init</strong> | |
8 | <strong>(memory_object_t</strong> <var>memory_object</var>, | |
9 | <strong>memory_object_control_t </strong><var>memory_control</var>, | |
10 | <strong>vm_size_t</strong> <var>memory_object_page_size</var><strong>);</strong> | |
11 | ||
12 | ||
13 | <strong>kern_return_t seqnos_memory_object_init</strong> | |
14 | <strong>(memory_object_t</strong> <var>memory_object</var>, | |
15 | <strong>mach_port_seqno_t</strong> <var>seqno</var>, | |
16 | <strong>memory_object_control_t</strong> <var>memory_control</var>, | |
17 | <strong>vm_size_t</strong> <var>memory_object_page_size</var><strong>);</strong> | |
18 | </pre> | |
19 | <h3>PARAMETERS</h3> | |
20 | <dl> | |
21 | <dt> <var>memory_object</var> | |
22 | <dd> | |
23 | [in abstract-memory-object port] The abstract memory object port that represents the memory object data, as supplied to the kernel in a vm_map call. | |
24 | <p> | |
25 | <dt> <var>seqno</var> | |
26 | <dd> | |
27 | [in scalar] The sequence number of this message relative to the abstract memory object port. | |
28 | <p> | |
29 | <dt> <var>memory_control</var> | |
30 | <dd> | |
31 | [in memory-cache-control port] The memory cache control port to be used by the memory manager. If the memory object has been supplied to more than one kernel, this parameter identifies the kernel that is making the call. | |
32 | <p> | |
33 | <dt> <var>memory_object_page_size</var> | |
34 | <dd> | |
35 | [in scalar] The page size used by the kernel. All calls involving this kernel must use data sizes that are integral multiples of this page size. | |
36 | </dl> | |
37 | <h3>DESCRIPTION</h3> | |
38 | <p> | |
39 | A <strong>memory_object_init</strong> function is called as the result | |
40 | of a kernel message notifying a memory manager that the kernel has | |
41 | been asked to map the specified memory object into a task's virtual | |
42 | address space. When asked to map a memory object for the first time, | |
43 | the kernel responds by making a <strong>memory_object_init</strong> | |
44 | call on the abstract memory object. This call is provided as a | |
45 | convenience to the memory manager, to allow it to initialize data | |
46 | structures and prepare to receive other requests. | |
47 | <p> | |
48 | In addition to the | |
49 | abstract memory object port itself, the call provides | |
50 | a memory cache control port that the memory manager can use to | |
51 | control use of its data by the kernel. The memory manager gets send | |
52 | rights for this port. | |
53 | <p> | |
54 | The kernel holds send rights for the abstract memory object port, and | |
55 | both send and receive rights for the memory cache control port. | |
56 | The call also supplies the virtual page size to be used for | |
57 | the memory mapping. The memory manager can use this size to detect | |
58 | mappings that use different data structures at initialization time, or | |
59 | to allocate buffers for use in reading data. | |
60 | <p> | |
61 | If a memory object is | |
62 | mapped into the address space of more than one task on different hosts | |
63 | (with independent kernels), the memory manager will receive a | |
64 | <strong>memory_object_init</strong> call from each kernel, containing | |
65 | a unique set of control and name ports. Note that each kernel may also | |
66 | use a different page size. | |
67 | <h3>RETURN VALUES</h3> | |
68 | <p> | |
69 | ||
70 | Any return value other than <strong>KERN_SUCCESS</strong> | |
71 | or <strong>MIG_NO_REPLY</strong>will cause | |
72 | <strong>mach_msg_server</strong> to remove the memory cache control reference. | |
73 | <h3>RELATED INFORMATION</h3> | |
74 | <p> | |
75 | Functions: | |
76 | <a href="memory_object_terminate.html"><strong>memory_object_terminate</strong></a>. |