2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
26 * Mach Operating System
27 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
28 * All Rights Reserved.
30 * Permission to use, copy, modify and distribute this software and its
31 * documentation is hereby granted, provided that both the copyright
32 * notice and this permission notice appear in all copies of the
33 * software, derivative works or modified versions, and any portions
34 * thereof, and that both notices appear in supporting documentation.
36 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
37 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
38 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
40 * Carnegie Mellon requests users of this software to return to
42 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
43 * School of Computer Science
44 * Carnegie Mellon University
45 * Pittsburgh PA 15213-3890
47 * any improvements or extensions that they make and grant Carnegie Mellon
48 * the rights to redistribute these changes.
55 * Author: Avadis Tevanian, Jr., Michael Wayne Young
58 * Virtual memory map module definitions.
67 #include <mach/mach_types.h>
68 #include <mach/kern_return.h>
69 #include <mach/boolean.h>
70 #include <mach/vm_types.h>
71 #include <mach/vm_prot.h>
72 #include <mach/vm_inherit.h>
73 #include <mach/vm_behavior.h>
74 #include <mach/vm_param.h>
79 #include <sys/cdefs.h>
83 extern void vm_map_reference(vm_map_t map
);
84 extern vm_map_t
current_map(void);
88 #ifdef MACH_KERNEL_PRIVATE
90 #include <task_swapper.h>
91 #include <mach_assert.h>
93 #include <vm/vm_object.h>
94 #include <vm/vm_page.h>
95 #include <kern/lock.h>
96 #include <kern/zalloc.h>
97 #include <kern/macro_help.h>
99 #include <kern/thread.h>
101 #define current_map_fast() (current_thread()->map)
102 #define current_map() (current_map_fast())
107 * vm_map_t the high-level address map data structure.
108 * vm_map_entry_t an entry in an address map.
109 * vm_map_version_t a timestamp of a map, for use with vm_map_lookup
110 * vm_map_copy_t represents memory copied from an address map,
111 * used for inter-map copy operations
113 typedef struct vm_map_entry
*vm_map_entry_t
;
114 #define VM_MAP_ENTRY_NULL ((vm_map_entry_t) 0)
118 * Type: vm_map_object_t [internal use only]
121 * The target of an address mapping, either a virtual
122 * memory object or a sub map (of the kernel map).
124 typedef union vm_map_object
{
125 vm_object_t vm_object
; /* object object */
126 vm_map_t sub_map
; /* belongs to another map */
129 #define named_entry_lock_init(object) mutex_init(&(object)->Lock, 0)
130 #define named_entry_lock(object) mutex_lock(&(object)->Lock)
131 #define named_entry_unlock(object) mutex_unlock(&(object)->Lock)
134 * Type: vm_named_entry_t [internal use only]
137 * Description of a mapping to a memory cache object.
140 * While the handle to this object is used as a means to map
141 * and pass around the right to map regions backed by pagers
142 * of all sorts, the named_entry itself is only manipulated
143 * by the kernel. Named entries hold information on the
144 * right to map a region of a cached object. Namely,
145 * the target cache object, the beginning and ending of the
146 * region to be mapped, and the permissions, (read, write)
147 * with which it can be mapped.
151 struct vm_named_entry
{
152 decl_mutex_data(, Lock
) /* Synchronization */
154 vm_object_t object
; /* object I point to */
155 memory_object_t pager
; /* amo pager port */
156 vm_map_t map
; /* map backing submap */
158 vm_object_offset_t offset
; /* offset into object */
159 vm_object_size_t size
; /* size of region */
160 vm_prot_t protection
; /* access permissions */
161 int ref_count
; /* Number of references */
162 unsigned int /* Is backing.xxx : */
163 /* boolean_t */ internal
:1, /* ... an internal object */
164 /* boolean_t */ is_sub_map
:1, /* ... a submap? */
165 /* boolean_t */ is_pager
:1; /* ... a pager port */
169 * Type: vm_map_entry_t [internal use only]
172 * A single mapping within an address map.
175 * Address map entries consist of start and end addresses,
176 * a VM object (or sub map) and offset into that object,
177 * and user-exported inheritance and protection information.
178 * Control information for virtual copy operations is also
179 * stored in the address map entry.
181 struct vm_map_links
{
182 struct vm_map_entry
*prev
; /* previous entry */
183 struct vm_map_entry
*next
; /* next entry */
184 vm_map_offset_t start
; /* start address */
185 vm_map_offset_t end
; /* end address */
188 struct vm_map_entry
{
189 struct vm_map_links links
; /* links to other entries */
190 #define vme_prev links.prev
191 #define vme_next links.next
192 #define vme_start links.start
193 #define vme_end links.end
194 union vm_map_object object
; /* object I point to */
195 vm_object_offset_t offset
; /* offset into object */
197 /* boolean_t */ is_shared
:1, /* region is shared */
198 /* boolean_t */ is_sub_map
:1, /* Is "object" a submap? */
199 /* boolean_t */ in_transition
:1, /* Entry being changed */
200 /* boolean_t */ needs_wakeup
:1, /* Waiters on in_transition */
201 /* vm_behavior_t */ behavior
:2, /* user paging behavior hint */
202 /* behavior is not defined for submap type */
203 /* boolean_t */ needs_copy
:1, /* object need to be copied? */
204 /* Only in task maps: */
205 /* vm_prot_t */ protection
:3, /* protection code */
206 /* vm_prot_t */ max_protection
:3,/* maximum protection */
207 /* vm_inherit_t */ inheritance
:2, /* inheritance */
208 /* boolean_t */ use_pmap
:1, /* nested pmaps */
209 /* unsigned char */ alias
:8, /* user alias */
210 /* unsigned char */ pad
:8; /* available bits */
211 unsigned short wired_count
; /* can be paged if = 0 */
212 unsigned short user_wired_count
; /* for vm_wire */
216 * wired_counts are unsigned short. This value is used to safeguard
217 * against any mishaps due to runaway user programs.
219 #define MAX_WIRE_COUNT 65535
224 * Type: struct vm_map_header
227 * Header for a vm_map and a vm_map_copy.
229 struct vm_map_header
{
230 struct vm_map_links links
; /* first, last, min, max */
231 int nentries
; /* Number of entries */
232 boolean_t entries_pageable
;
233 /* are map entries pageable? */
237 * Type: vm_map_t [exported; contents invisible]
240 * An address map -- a directory relating valid
241 * regions of a task's address space to the corresponding
242 * virtual memory objects.
245 * Maps are doubly-linked lists of map entries, sorted
246 * by address. One hint is used to start
247 * searches again from the last successful search,
248 * insertion, or removal. Another hint is used to
249 * quickly find free space.
252 lock_t lock
; /* uni- and smp-lock */
253 struct vm_map_header hdr
; /* Map entry header */
254 #define min_offset hdr.links.start /* start of range */
255 #define max_offset hdr.links.end /* end of range */
256 pmap_t pmap
; /* Physical map */
257 vm_map_size_t size
; /* virtual size */
258 int ref_count
; /* Reference count */
260 int res_count
; /* Residence count (swap) */
261 int sw_state
; /* Swap state */
262 #endif /* TASK_SWAPPER */
263 decl_mutex_data(, s_lock
) /* Lock ref, res, hint fields */
264 vm_map_entry_t hint
; /* hint for quick lookups */
265 vm_map_entry_t first_free
; /* First free space hint */
266 boolean_t wait_for_space
; /* Should callers wait
268 boolean_t wiring_required
;/* All memory wired? */
269 boolean_t no_zero_fill
; /* No zero fill absent pages */
270 boolean_t mapped
; /* has this map been mapped */
271 unsigned int timestamp
; /* Version number */
274 #define vm_map_to_entry(map) ((struct vm_map_entry *) &(map)->hdr.links)
275 #define vm_map_first_entry(map) ((map)->hdr.links.next)
276 #define vm_map_last_entry(map) ((map)->hdr.links.prev)
280 * VM map swap states. There are no transition states.
282 #define MAP_SW_IN 1 /* map is swapped in; residence count > 0 */
283 #define MAP_SW_OUT 2 /* map is out (res_count == 0 */
284 #endif /* TASK_SWAPPER */
287 * Type: vm_map_version_t [exported; contents invisible]
290 * Map versions may be used to quickly validate a previous
294 * Because they are bulky objects, map versions are usually
295 * passed by reference.
298 * Just a timestamp for the main map.
300 typedef struct vm_map_version
{
301 unsigned int main_timestamp
;
305 * Type: vm_map_copy_t [exported; contents invisible]
308 * A map copy object represents a region of virtual memory
309 * that has been copied from an address map but is still
312 * A map copy object may only be used by a single thread
316 * There are three formats for map copy objects.
317 * The first is very similar to the main
318 * address map in structure, and as a result, some
319 * of the internal maintenance functions/macros can
320 * be used with either address maps or map copy objects.
322 * The map copy object contains a header links
323 * entry onto which the other entries that represent
324 * the region are chained.
326 * The second format is a single vm object. This was used
327 * primarily in the pageout path - but is not currently used
328 * except for placeholder copy objects (see vm_map_copy_copy()).
330 * The third format is a kernel buffer copy object - for data
331 * small enough that physical copies were the most efficient
337 #define VM_MAP_COPY_ENTRY_LIST 1
338 #define VM_MAP_COPY_OBJECT 2
339 #define VM_MAP_COPY_KERNEL_BUFFER 3
340 vm_object_offset_t offset
;
343 struct vm_map_header hdr
; /* ENTRY_LIST */
344 vm_object_t object
; /* OBJECT */
346 void *kdata
; /* KERNEL_BUFFER */
347 vm_size_t kalloc_size
; /* size of this copy_t */
353 #define cpy_hdr c_u.hdr
355 #define cpy_object c_u.object
357 #define cpy_kdata c_u.c_k.kdata
358 #define cpy_kalloc_size c_u.c_k.kalloc_size
362 * Useful macros for entry list copy objects
365 #define vm_map_copy_to_entry(copy) \
366 ((struct vm_map_entry *) &(copy)->cpy_hdr.links)
367 #define vm_map_copy_first_entry(copy) \
368 ((copy)->cpy_hdr.links.next)
369 #define vm_map_copy_last_entry(copy) \
370 ((copy)->cpy_hdr.links.prev)
373 * Macros: vm_map_lock, etc. [internal use only]
375 * Perform locking on the data portion of a map.
376 * When multiple maps are to be locked, order by map address.
377 * (See vm_map.c::vm_remap())
380 #define vm_map_lock_init(map) \
381 ((map)->timestamp = 0 , \
382 lock_init(&(map)->lock, TRUE, 0, 0))
384 #define vm_map_lock(map) lock_write(&(map)->lock)
385 #define vm_map_unlock(map) \
386 ((map)->timestamp++ , lock_write_done(&(map)->lock))
387 #define vm_map_lock_read(map) lock_read(&(map)->lock)
388 #define vm_map_unlock_read(map) lock_read_done(&(map)->lock)
389 #define vm_map_lock_write_to_read(map) \
390 ((map)->timestamp++ , lock_write_to_read(&(map)->lock))
391 #define vm_map_lock_read_to_write(map) lock_read_to_write(&(map)->lock)
394 * Exported procedures that operate on vm_map_t.
397 /* Initialize the module */
398 extern void vm_map_init(void);
400 /* Allocate a range in the specified virtual address map and
401 * return the entry allocated for that range. */
402 extern kern_return_t
vm_map_find_space(
404 vm_map_address_t
*address
, /* OUT */
406 vm_map_offset_t mask
,
407 vm_map_entry_t
*o_entry
); /* OUT */
409 /* Lookup map entry containing or the specified address in the given map */
410 extern boolean_t
vm_map_lookup_entry(
412 vm_map_address_t address
,
413 vm_map_entry_t
*entry
); /* OUT */
415 /* Find the VM object, offset, and protection for a given virtual address
416 * in the specified map, assuming a page fault of the type specified. */
417 extern kern_return_t
vm_map_lookup_locked(
418 vm_map_t
*var_map
, /* IN/OUT */
419 vm_map_address_t vaddr
,
420 vm_prot_t fault_type
,
421 vm_map_version_t
*out_version
, /* OUT */
422 vm_object_t
*object
, /* OUT */
423 vm_object_offset_t
*offset
, /* OUT */
424 vm_prot_t
*out_prot
, /* OUT */
425 boolean_t
*wired
, /* OUT */
426 int *behavior
, /* OUT */
427 vm_map_offset_t
*lo_offset
, /* OUT */
428 vm_map_offset_t
*hi_offset
, /* OUT */
429 vm_map_t
*real_map
); /* OUT */
431 /* Verifies that the map has not changed since the given version. */
432 extern boolean_t
vm_map_verify(
434 vm_map_version_t
*version
); /* REF */
436 extern vm_map_entry_t
vm_map_entry_insert(
438 vm_map_entry_t insp_entry
,
439 vm_map_offset_t start
,
442 vm_object_offset_t offset
,
443 boolean_t needs_copy
,
445 boolean_t in_transition
,
446 vm_prot_t cur_protection
,
447 vm_prot_t max_protection
,
448 vm_behavior_t behavior
,
449 vm_inherit_t inheritance
,
450 unsigned wired_count
);
454 * Functions implemented as macros
456 #define vm_map_min(map) ((map)->min_offset)
457 /* Lowest valid address in
460 #define vm_map_max(map) ((map)->max_offset)
461 /* Highest valid address */
463 #define vm_map_pmap(map) ((map)->pmap)
464 /* Physical map associated
465 * with this address map */
467 #define vm_map_verify_done(map, version) vm_map_unlock_read(map)
468 /* Operation that required
469 * a verified lookup is
473 * Macros/functions for map residence counts and swapin/out of vm maps
478 /* Gain a reference to an existing map */
479 extern void vm_map_reference(
481 /* Lose a residence count */
482 extern void vm_map_res_deallocate(
484 /* Gain a residence count on a map */
485 extern void vm_map_res_reference(
487 /* Gain reference & residence counts to possibly swapped-out map */
488 extern void vm_map_reference_swap(
491 #else /* MACH_ASSERT */
493 #define vm_map_reference(map) \
495 vm_map_t Map = (map); \
497 mutex_lock(&Map->s_lock); \
500 mutex_unlock(&Map->s_lock); \
504 #define vm_map_res_reference(map) \
506 vm_map_t Lmap = (map); \
507 if (Lmap->res_count == 0) { \
508 mutex_unlock(&Lmap->s_lock);\
510 vm_map_swapin(Lmap); \
511 mutex_lock(&Lmap->s_lock); \
513 vm_map_unlock(Lmap); \
518 #define vm_map_res_deallocate(map) \
520 vm_map_t Map = (map); \
521 if (--Map->res_count == 0) { \
522 mutex_unlock(&Map->s_lock); \
524 vm_map_swapout(Map); \
525 vm_map_unlock(Map); \
526 mutex_lock(&Map->s_lock); \
530 #define vm_map_reference_swap(map) \
532 vm_map_t Map = (map); \
533 mutex_lock(&Map->s_lock); \
535 vm_map_res_reference(Map); \
536 mutex_unlock(&Map->s_lock); \
538 #endif /* MACH_ASSERT */
540 extern void vm_map_swapin(
543 extern void vm_map_swapout(
546 #else /* TASK_SWAPPER */
548 #define vm_map_reference(map) \
550 vm_map_t Map = (map); \
552 mutex_lock(&Map->s_lock); \
554 mutex_unlock(&Map->s_lock); \
558 #define vm_map_reference_swap(map) vm_map_reference(map)
559 #define vm_map_res_reference(map)
560 #define vm_map_res_deallocate(map)
562 #endif /* TASK_SWAPPER */
565 * Submap object. Must be used to create memory to be put
566 * in a submap by vm_map_submap.
568 extern vm_object_t vm_submap_object
;
571 * Wait and wakeup macros for in_transition map entries.
573 #define vm_map_entry_wait(map, interruptible) \
574 ((map)->timestamp++ , \
575 thread_sleep_lock_write((event_t)&(map)->hdr, \
576 &(map)->lock, interruptible))
579 #define vm_map_entry_wakeup(map) \
580 thread_wakeup((event_t)(&(map)->hdr))
583 #define vm_map_ref_fast(map) \
585 mutex_lock(&map->s_lock); \
587 vm_map_res_reference(map); \
588 mutex_unlock(&map->s_lock); \
591 #define vm_map_dealloc_fast(map) \
595 mutex_lock(&map->s_lock); \
596 c = --map->ref_count; \
598 vm_map_res_deallocate(map); \
599 mutex_unlock(&map->s_lock); \
601 vm_map_destroy(map); \
605 /* simplify map entries */
606 extern void vm_map_simplify_entry(
608 vm_map_entry_t this_entry
);
609 extern void vm_map_simplify(
611 vm_map_offset_t start
);
613 /* Move the information in a map copy object to a new map copy object */
614 extern vm_map_copy_t
vm_map_copy_copy(
617 /* Create a copy object from an object. */
618 extern kern_return_t
vm_map_copyin_object(
620 vm_object_offset_t offset
,
621 vm_object_size_t size
,
622 vm_map_copy_t
*copy_result
); /* OUT */
624 /* Enter a mapping */
625 extern kern_return_t
vm_map_enter(
627 vm_map_offset_t
*address
,
629 vm_map_offset_t mask
,
632 vm_object_offset_t offset
,
633 boolean_t needs_copy
,
634 vm_prot_t cur_protection
,
635 vm_prot_t max_protection
,
636 vm_inherit_t inheritance
);
638 /* XXX should go away - replaced with regular enter of contig object */
639 extern kern_return_t
vm_map_enter_cpm(
641 vm_map_address_t
*addr
,
645 extern kern_return_t
vm_map_remap(
647 vm_map_offset_t
*address
,
649 vm_map_offset_t mask
,
652 vm_map_offset_t memory_address
,
654 vm_prot_t
*cur_protection
,
655 vm_prot_t
*max_protection
,
656 vm_inherit_t inheritance
);
660 * Read and write from a kernel buffer to a specified map.
662 extern kern_return_t
vm_map_write_user(
665 vm_map_offset_t dst_addr
,
668 extern kern_return_t
vm_map_read_user(
670 vm_map_offset_t src_addr
,
674 /* Create a new task map using an existing task map as a template. */
675 extern vm_map_t
vm_map_fork(
678 /* Change inheritance */
679 extern kern_return_t
vm_map_inherit(
681 vm_map_offset_t start
,
683 vm_inherit_t new_inheritance
);
685 /* Add or remove machine-dependent attributes from map regions */
686 extern kern_return_t
vm_map_machine_attribute(
688 vm_map_offset_t start
,
690 vm_machine_attribute_t attribute
,
691 vm_machine_attribute_val_t
* value
); /* IN/OUT */
693 extern kern_return_t
vm_map_msync(
695 vm_map_address_t address
,
697 vm_sync_t sync_flags
);
699 /* Set paging behavior */
700 extern kern_return_t
vm_map_behavior_set(
702 vm_map_offset_t start
,
704 vm_behavior_t new_behavior
);
706 extern kern_return_t
vm_map_purgable_control(
708 vm_map_offset_t address
,
709 vm_purgable_t control
,
712 extern kern_return_t
vm_map_region(
714 vm_map_offset_t
*address
,
716 vm_region_flavor_t flavor
,
717 vm_region_info_t info
,
718 mach_msg_type_number_t
*count
,
719 mach_port_t
*object_name
);
721 extern kern_return_t
vm_map_region_recurse_64(
723 vm_map_offset_t
*address
,
725 natural_t
*nesting_depth
,
726 vm_region_submap_info_64_t info
,
727 mach_msg_type_number_t
*count
);
729 extern kern_return_t
vm_map_page_info(
731 vm_map_offset_t offset
,
735 extern kern_return_t
vm_map_submap(
737 vm_map_offset_t start
,
740 vm_map_offset_t offset
,
743 extern void vm_map_submap_pmap_clean(
745 vm_map_offset_t start
,
748 vm_map_offset_t offset
);
750 /* Convert from a map entry port to a map */
751 extern vm_map_t
convert_port_entry_to_map(
754 /* Convert from a port to a vm_object */
755 extern vm_object_t
convert_port_entry_to_object(
759 #endif /* MACH_KERNEL_PRIVATE */
763 /* Create an empty map */
764 extern vm_map_t
vm_map_create(
766 vm_map_offset_t min_off
,
767 vm_map_offset_t max_off
,
770 /* Get rid of a map */
771 extern void vm_map_destroy(
773 /* Lose a reference */
774 extern void vm_map_deallocate(
777 extern vm_map_t
vm_map_switch(
780 /* Change protection */
781 extern kern_return_t
vm_map_protect(
783 vm_map_offset_t start
,
788 /* Check protection */
789 extern boolean_t
vm_map_check_protection(
791 vm_map_offset_t start
,
793 vm_prot_t protection
);
795 /* wire down a region */
796 extern kern_return_t
vm_map_wire(
798 vm_map_offset_t start
,
800 vm_prot_t access_type
,
801 boolean_t user_wire
);
803 /* unwire a region */
804 extern kern_return_t
vm_map_unwire(
806 vm_map_offset_t start
,
808 boolean_t user_wire
);
810 /* Deallocate a region */
811 extern kern_return_t
vm_map_remove(
813 vm_map_offset_t start
,
817 /* Discard a copy without using it */
818 extern void vm_map_copy_discard(
821 /* Overwrite existing memory with a copy */
822 extern kern_return_t
vm_map_copy_overwrite(
824 vm_map_address_t dst_addr
,
828 /* Place a copy into a map */
829 extern kern_return_t
vm_map_copyout(
831 vm_map_address_t
*dst_addr
, /* OUT */
834 extern kern_return_t
vm_map_copyin_common(
836 vm_map_address_t src_addr
,
838 boolean_t src_destroy
,
839 boolean_t src_volatile
,
840 vm_map_copy_t
*copy_result
, /* OUT */
841 boolean_t use_maxprot
);
844 * Macros to invoke vm_map_copyin_common. vm_map_copyin is the
845 * usual form; it handles a copyin based on the current protection
846 * (current protection == VM_PROT_NONE) is a failure.
847 * vm_map_copyin_maxprot handles a copyin based on maximum possible
848 * access. The difference is that a region with no current access
849 * BUT possible maximum access is rejected by vm_map_copyin(), but
850 * returned by vm_map_copyin_maxprot.
852 #define vm_map_copyin(src_map, src_addr, len, src_destroy, copy_result) \
853 vm_map_copyin_common(src_map, src_addr, len, src_destroy, \
854 FALSE, copy_result, FALSE)
856 #define vm_map_copyin_maxprot(src_map, \
857 src_addr, len, src_destroy, copy_result) \
858 vm_map_copyin_common(src_map, src_addr, len, src_destroy, \
859 FALSE, copy_result, TRUE)
862 * Macros for rounding and truncation of vm_map offsets and sizes
864 #define vm_map_round_page(x) (((vm_map_offset_t)(x) + PAGE_MASK) & ~((signed)PAGE_MASK))
865 #define vm_map_trunc_page(x) ((vm_map_offset_t)(x) & ~((signed)PAGE_MASK))
868 * Flags for vm_map_remove() and vm_map_delete()
870 #define VM_MAP_NO_FLAGS 0x0
871 #define VM_MAP_REMOVE_KUNWIRE 0x1
872 #define VM_MAP_REMOVE_INTERRUPTIBLE 0x2
873 #define VM_MAP_REMOVE_WAIT_FOR_KWIRE 0x4
874 #define VM_MAP_REMOVE_SAVE_ENTRIES 0x8
876 /* Support for shared regions */
877 extern kern_return_t
vm_region_clone(
878 ipc_port_t src_region
,
879 ipc_port_t dst_region
);
881 extern kern_return_t
vm_map_region_replace(
883 ipc_port_t old_region
,
884 ipc_port_t new_region
,
885 vm_map_offset_t start
,
886 vm_map_offset_t end
);
888 /* Support for UPLs from vm_maps */
890 extern kern_return_t
vm_map_get_upl(
892 vm_map_offset_t map_offset
,
895 upl_page_info_array_t page_info
,
896 mach_msg_type_number_t
*page_infoCnt
,
898 integer_t force_data_sync
);
902 #endif /* KERNEL_PRIVATE */
904 #endif /* _VM_VM_MAP_H_ */