2 * Copyright (c) 2000-2002 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>
76 #include <sys/appleapiopts.h>
78 #ifdef __APPLE_API_PRIVATE
80 #ifndef MACH_KERNEL_PRIVATE
82 #ifdef __APPLE_API_OBSOLETE
83 extern void kernel_vm_map_reference(vm_map_t map
);
84 #endif /* __APPLE_API_OBSOLETE */
86 extern void vm_map_reference(vm_map_t map
);
87 extern vm_map_t
current_map(void);
89 #else /* MACH_KERNEL_PRIVATE */
92 #include <task_swapper.h>
93 #include <mach_assert.h>
95 #include <vm/vm_object.h>
96 #include <vm/vm_page.h>
97 #include <kern/lock.h>
98 #include <kern/zalloc.h>
99 #include <kern/macro_help.h>
101 #include <kern/thread_act.h>
103 #define current_map_fast() (current_act_fast()->map)
104 #define current_map() (current_map_fast())
109 * vm_map_t the high-level address map data structure.
110 * vm_map_entry_t an entry in an address map.
111 * vm_map_version_t a timestamp of a map, for use with vm_map_lookup
112 * vm_map_copy_t represents memory copied from an address map,
113 * used for inter-map copy operations
115 typedef struct vm_map_entry
*vm_map_entry_t
;
119 * Type: vm_map_object_t [internal use only]
122 * The target of an address mapping, either a virtual
123 * memory object or a sub map (of the kernel map).
125 typedef union vm_map_object
{
126 struct vm_object
*vm_object
; /* object object */
127 struct vm_map
*sub_map
; /* belongs to another map */
130 #define named_entry_lock_init(object) mutex_init(&(object)->Lock, ETAP_VM_OBJ)
131 #define named_entry_lock(object) mutex_lock(&(object)->Lock)
132 #define named_entry_unlock(object) mutex_unlock(&(object)->Lock)
135 * Type: vm_named_entry_t [internal use only]
138 * Description of a mapping to a memory cache object.
141 * While the handle to this object is used as a means to map
142 * and pass around the right to map regions backed by pagers
143 * of all sorts, the named_entry itself is only manipulated
144 * by the kernel. Named entries hold information on the
145 * right to map a region of a cached object. Namely,
146 * the target cache object, the beginning and ending of the
147 * region to be mapped, and the permissions, (read, write)
148 * with which it can be mapped.
152 struct vm_named_entry
{
153 decl_mutex_data(, Lock
) /* Synchronization */
154 vm_object_t object
; /* object I point to */
155 vm_object_offset_t offset
; /* offset into object */
157 memory_object_t pager
; /* amo pager port */
158 vm_map_t map
; /* map backing submap */
160 unsigned int size
; /* size of region */
161 unsigned int protection
; /* access permissions */
162 int ref_count
; /* Number of references */
164 /* boolean_t */ internal
:1, /* is an internal object */
165 /* boolean_t */ is_sub_map
:1; /* is object is a submap? */
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_offset_t start
; /* start address */
185 vm_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 /* nested pmap */ use_pmap
:1, /* nested pmaps */
209 /* user alias */ alias
:8;
210 unsigned short wired_count
; /* can be paged if = 0 */
211 unsigned short user_wired_count
; /* for vm_wire */
215 * wired_counts are unsigned short. This value is used to safeguard
216 * against any mishaps due to runaway user programs.
218 #define MAX_WIRE_COUNT 65535
223 * Type: struct vm_map_header
226 * Header for a vm_map and a vm_map_copy.
228 struct vm_map_header
{
229 struct vm_map_links links
; /* first, last, min, max */
230 int nentries
; /* Number of entries */
231 boolean_t entries_pageable
;
232 /* are map entries pageable? */
236 * Type: vm_map_t [exported; contents invisible]
239 * An address map -- a directory relating valid
240 * regions of a task's address space to the corresponding
241 * virtual memory objects.
244 * Maps are doubly-linked lists of map entries, sorted
245 * by address. One hint is used to start
246 * searches again from the last successful search,
247 * insertion, or removal. Another hint is used to
248 * quickly find free space.
251 lock_t lock
; /* uni- and smp-lock */
252 struct vm_map_header hdr
; /* Map entry header */
253 #define min_offset hdr.links.start /* start of range */
254 #define max_offset hdr.links.end /* end of range */
255 pmap_t pmap
; /* Physical map */
256 vm_size_t size
; /* virtual size */
257 int ref_count
; /* Reference count */
259 int res_count
; /* Residence count (swap) */
260 int sw_state
; /* Swap state */
261 #endif /* TASK_SWAPPER */
262 decl_mutex_data(, s_lock
) /* Lock ref, res, hint fields */
263 vm_map_entry_t hint
; /* hint for quick lookups */
264 vm_map_entry_t first_free
; /* First free space hint */
265 boolean_t wait_for_space
; /* Should callers wait
267 boolean_t wiring_required
;/* All memory wired? */
268 boolean_t no_zero_fill
; /* No zero fill absent pages */
269 boolean_t mapped
; /* has this map been mapped */
270 unsigned int timestamp
; /* Version number */
273 #define vm_map_to_entry(map) ((struct vm_map_entry *) &(map)->hdr.links)
274 #define vm_map_first_entry(map) ((map)->hdr.links.next)
275 #define vm_map_last_entry(map) ((map)->hdr.links.prev)
279 * VM map swap states. There are no transition states.
281 #define MAP_SW_IN 1 /* map is swapped in; residence count > 0 */
282 #define MAP_SW_OUT 2 /* map is out (res_count == 0 */
283 #endif /* TASK_SWAPPER */
286 * Type: vm_map_version_t [exported; contents invisible]
289 * Map versions may be used to quickly validate a previous
293 * Because they are bulky objects, map versions are usually
294 * passed by reference.
297 * Just a timestamp for the main map.
299 typedef struct vm_map_version
{
300 unsigned int main_timestamp
;
304 * Type: vm_map_copy_t [exported; contents invisible]
307 * A map copy object represents a region of virtual memory
308 * that has been copied from an address map but is still
311 * A map copy object may only be used by a single thread
315 * There are three formats for map copy objects.
316 * The first is very similar to the main
317 * address map in structure, and as a result, some
318 * of the internal maintenance functions/macros can
319 * be used with either address maps or map copy objects.
321 * The map copy object contains a header links
322 * entry onto which the other entries that represent
323 * the region are chained.
325 * The second format is a single vm object. This is used
326 * primarily in the pageout path. The third format is a
327 * list of vm pages. An optional continuation provides
328 * a hook to be called to obtain more of the memory,
329 * or perform other operations. The continuation takes 3
330 * arguments, a saved arg buffer, a pointer to a new vm_map_copy
331 * (returned) and an abort flag (abort if TRUE).
334 #define VM_MAP_COPY_PAGE_LIST_MAX 20
335 #define VM_MAP_COPY_PAGE_LIST_MAX_SIZE (VM_MAP_COPY_PAGE_LIST_MAX * PAGE_SIZE)
339 * Options for vm_map_copyin_page_list.
342 #define VM_MAP_COPYIN_OPT_VM_PROT 0x7
343 #define VM_MAP_COPYIN_OPT_SRC_DESTROY 0x8
344 #define VM_MAP_COPYIN_OPT_STEAL_PAGES 0x10
345 #define VM_MAP_COPYIN_OPT_PMAP_ENTER 0x20
346 #define VM_MAP_COPYIN_OPT_NO_ZERO_FILL 0x40
349 * Continuation structures for vm_map_copyin_page_list.
353 vm_offset_t src_addr
;
355 vm_offset_t destroy_addr
;
356 vm_size_t destroy_len
;
358 } vm_map_copyin_args_data_t
, *vm_map_copyin_args_t
;
360 #define VM_MAP_COPYIN_ARGS_NULL ((vm_map_copyin_args_t) 0)
363 /* vm_map_copy_cont_t is a type definition/prototype
364 * for the cont function pointer in vm_map_copy structure.
366 typedef kern_return_t (*vm_map_copy_cont_t
)(
367 vm_map_copyin_args_t
,
370 #define VM_MAP_COPY_CONT_NULL ((vm_map_copy_cont_t) 0)
374 #define VM_MAP_COPY_ENTRY_LIST 1
375 #define VM_MAP_COPY_OBJECT 2
376 #define VM_MAP_COPY_KERNEL_BUFFER 3
377 vm_object_offset_t offset
;
380 struct vm_map_header hdr
; /* ENTRY_LIST */
381 struct { /* OBJECT */
383 vm_size_t index
; /* record progress as pages
384 * are moved from object to
385 * page list; must be zero
386 * when first invoking
387 * vm_map_object_to_page_list
390 struct { /* KERNEL_BUFFER */
392 vm_size_t kalloc_size
; /* size of this copy_t */
398 #define cpy_hdr c_u.hdr
400 #define cpy_object c_u.c_o.object
401 #define cpy_index c_u.c_o.index
403 #define cpy_kdata c_u.c_k.kdata
404 #define cpy_kalloc_size c_u.c_k.kalloc_size
408 * Useful macros for entry list copy objects
411 #define vm_map_copy_to_entry(copy) \
412 ((struct vm_map_entry *) &(copy)->cpy_hdr.links)
413 #define vm_map_copy_first_entry(copy) \
414 ((copy)->cpy_hdr.links.next)
415 #define vm_map_copy_last_entry(copy) \
416 ((copy)->cpy_hdr.links.prev)
419 * Macros: vm_map_lock, etc. [internal use only]
421 * Perform locking on the data portion of a map.
422 * When multiple maps are to be locked, order by map address.
423 * (See vm_map.c::vm_remap())
426 #define vm_map_lock_init(map) \
427 ((map)->timestamp = 0 , \
428 lock_init(&(map)->lock, TRUE, ETAP_VM_MAP, ETAP_VM_MAP_I))
430 #define vm_map_lock(map) lock_write(&(map)->lock)
431 #define vm_map_unlock(map) \
432 ((map)->timestamp++ , lock_write_done(&(map)->lock))
433 #define vm_map_lock_read(map) lock_read(&(map)->lock)
434 #define vm_map_unlock_read(map) lock_read_done(&(map)->lock)
435 #define vm_map_lock_write_to_read(map) \
436 ((map)->timestamp++ , lock_write_to_read(&(map)->lock))
437 #define vm_map_lock_read_to_write(map) lock_read_to_write(&(map)->lock)
439 extern zone_t vm_map_copy_zone
; /* zone for vm_map_copy structures */
442 * Exported procedures that operate on vm_map_t.
445 /* Initialize the module */
446 extern void vm_map_init(void);
448 /* Allocate a range in the specified virtual address map and
449 * return the entry allocated for that range. */
450 extern kern_return_t
vm_map_find_space(
452 vm_offset_t
*address
, /* OUT */
455 vm_map_entry_t
*o_entry
); /* OUT */
457 /* Lookup map entry containing or the specified address in the given map */
458 extern boolean_t
vm_map_lookup_entry(
461 vm_map_entry_t
*entry
); /* OUT */
463 /* Find the VM object, offset, and protection for a given virtual address
464 * in the specified map, assuming a page fault of the type specified. */
465 extern kern_return_t
vm_map_lookup_locked(
466 vm_map_t
*var_map
, /* IN/OUT */
468 vm_prot_t fault_type
,
469 vm_map_version_t
*out_version
, /* OUT */
470 vm_object_t
*object
, /* OUT */
471 vm_object_offset_t
*offset
, /* OUT */
472 vm_prot_t
*out_prot
, /* OUT */
473 boolean_t
*wired
, /* OUT */
474 int *behavior
, /* OUT */
475 vm_object_offset_t
*lo_offset
, /* OUT */
476 vm_object_offset_t
*hi_offset
, /* OUT */
477 vm_map_t
*pmap_map
); /* OUT */
479 /* Verifies that the map has not changed since the given version. */
480 extern boolean_t
vm_map_verify(
482 vm_map_version_t
*version
); /* REF */
484 /* Split a vm_map_entry into 2 entries */
485 extern void _vm_map_clip_start(
486 struct vm_map_header
*map_header
,
487 vm_map_entry_t entry
,
490 extern vm_map_entry_t
vm_map_entry_insert(
492 vm_map_entry_t insp_entry
,
496 vm_object_offset_t offset
,
497 boolean_t needs_copy
,
499 boolean_t in_transition
,
500 vm_prot_t cur_protection
,
501 vm_prot_t max_protection
,
502 vm_behavior_t behavior
,
503 vm_inherit_t inheritance
,
504 unsigned wired_count
);
506 extern kern_return_t
vm_remap_extract(
511 struct vm_map_header
*map_header
,
512 vm_prot_t
*cur_protection
,
513 vm_prot_t
*max_protection
,
514 vm_inherit_t inheritance
,
517 extern kern_return_t
vm_remap_range_allocate(
519 vm_offset_t
*address
,
523 vm_map_entry_t
*map_entry
);
525 extern kern_return_t
vm_remap_extract(
530 struct vm_map_header
*map_header
,
531 vm_prot_t
*cur_protection
,
532 vm_prot_t
*max_protection
,
533 vm_inherit_t inheritance
,
536 extern kern_return_t
vm_remap_range_allocate(
538 vm_offset_t
*address
,
542 vm_map_entry_t
*map_entry
);
545 * Functions implemented as macros
547 #define vm_map_min(map) ((map)->min_offset)
548 /* Lowest valid address in
551 #define vm_map_max(map) ((map)->max_offset)
552 /* Highest valid address */
554 #define vm_map_pmap(map) ((map)->pmap)
555 /* Physical map associated
556 * with this address map */
558 #define vm_map_verify_done(map, version) vm_map_unlock_read(map)
559 /* Operation that required
560 * a verified lookup is
564 * Macros/functions for map residence counts and swapin/out of vm maps
569 /* Gain a reference to an existing map */
570 extern void vm_map_reference(
572 /* Lose a residence count */
573 extern void vm_map_res_deallocate(
575 /* Gain a residence count on a map */
576 extern void vm_map_res_reference(
578 /* Gain reference & residence counts to possibly swapped-out map */
579 extern void vm_map_reference_swap(
582 #else /* MACH_ASSERT */
584 #define vm_map_reference(map) \
586 vm_map_t Map = (map); \
588 mutex_lock(&Map->s_lock); \
591 mutex_unlock(&Map->s_lock); \
595 #define vm_map_res_reference(map) \
597 vm_map_t Lmap = (map); \
598 if (Lmap->res_count == 0) { \
599 mutex_unlock(&Lmap->s_lock); \
601 vm_map_swapin(Lmap); \
602 mutex_lock(&Lmap->s_lock); \
604 vm_map_unlock(Lmap); \
609 #define vm_map_res_deallocate(map) \
611 vm_map_t Map = (map); \
612 if (--Map->res_count == 0) { \
613 mutex_unlock(&Map->s_lock); \
615 vm_map_swapout(Map); \
616 vm_map_unlock(Map); \
617 mutex_lock(&Map->s_lock); \
621 #define vm_map_reference_swap(map) \
623 vm_map_t Map = (map); \
624 mutex_lock(&Map->s_lock); \
626 vm_map_res_reference(Map); \
627 mutex_unlock(&Map->s_lock); \
629 #endif /* MACH_ASSERT */
631 extern void vm_map_swapin(
634 extern void vm_map_swapout(
637 #else /* TASK_SWAPPER */
639 #define vm_map_reference(map) \
641 vm_map_t Map = (map); \
643 mutex_lock(&Map->s_lock); \
645 mutex_unlock(&Map->s_lock); \
649 #define vm_map_reference_swap(map) vm_map_reference(map)
650 #define vm_map_res_reference(map)
651 #define vm_map_res_deallocate(map)
653 #endif /* TASK_SWAPPER */
656 * Submap object. Must be used to create memory to be put
657 * in a submap by vm_map_submap.
659 extern vm_object_t vm_submap_object
;
662 * Wait and wakeup macros for in_transition map entries.
664 #define vm_map_entry_wait(map, interruptible) \
665 ((map)->timestamp++ , \
666 thread_sleep_lock_write((event_t)&(map)->hdr, \
667 &(map)->lock, interruptible))
670 #define vm_map_entry_wakeup(map) thread_wakeup((event_t)(&(map)->hdr))
673 #define vm_map_ref_fast(map) \
675 mutex_lock(&map->s_lock); \
677 vm_map_res_reference(map); \
678 mutex_unlock(&map->s_lock); \
681 #define vm_map_dealloc_fast(map) \
685 mutex_lock(&map->s_lock); \
686 c = --map->ref_count; \
688 vm_map_res_deallocate(map); \
689 mutex_unlock(&map->s_lock); \
691 vm_map_destroy(map); \
695 /* simplify map entries */
696 extern void vm_map_simplify(
700 /* Steal all the pages from a vm_map_copy page_list */
701 extern void vm_map_copy_steal_pages(
704 /* Discard a copy without using it */
705 extern void vm_map_copy_discard(
708 /* Move the information in a map copy object to a new map copy object */
709 extern vm_map_copy_t
vm_map_copy_copy(
712 /* Overwrite existing memory with a copy */
713 extern kern_return_t
vm_map_copy_overwrite(
715 vm_offset_t dst_addr
,
719 /* Create a copy object from an object. */
720 extern kern_return_t
vm_map_copyin_object(
722 vm_object_offset_t offset
,
723 vm_object_size_t size
,
724 vm_map_copy_t
*copy_result
); /* OUT */
726 extern vm_map_t
vm_map_switch(
729 extern int vm_map_copy_cont_is_valid(
733 #define VM_MAP_ENTRY_NULL ((vm_map_entry_t) 0)
736 /* Enter a mapping */
737 extern kern_return_t
vm_map_enter(
739 vm_offset_t
*address
,
744 vm_object_offset_t offset
,
745 boolean_t needs_copy
,
746 vm_prot_t cur_protection
,
747 vm_prot_t max_protection
,
748 vm_inherit_t inheritance
);
750 extern kern_return_t
vm_map_write_user(
752 vm_offset_t src_addr
,
753 vm_offset_t dst_addr
,
756 extern kern_return_t
vm_map_read_user(
758 vm_offset_t src_addr
,
759 vm_offset_t dst_addr
,
762 /* Create a new task map using an existing task map as a template. */
763 extern vm_map_t
vm_map_fork(
766 /* Change inheritance */
767 extern kern_return_t
vm_map_inherit(
771 vm_inherit_t new_inheritance
);
773 /* Add or remove machine-dependent attributes from map regions */
774 extern kern_return_t
vm_map_machine_attribute(
778 vm_machine_attribute_t attribute
,
779 vm_machine_attribute_val_t
* value
); /* IN/OUT */
780 /* Set paging behavior */
781 extern kern_return_t
vm_map_behavior_set(
785 vm_behavior_t new_behavior
);
787 extern kern_return_t
vm_map_submap(
796 #endif /* MACH_KERNEL_PRIVATE */
798 /* Create an empty map */
799 extern vm_map_t
vm_map_create(
805 /* Get rid of a map */
806 extern void vm_map_destroy(
808 /* Lose a reference */
809 extern void vm_map_deallocate(
812 /* Change protection */
813 extern kern_return_t
vm_map_protect(
820 /* wire down a region */
821 extern kern_return_t
vm_map_wire(
825 vm_prot_t access_type
,
826 boolean_t user_wire
);
828 /* unwire a region */
829 extern kern_return_t
vm_map_unwire(
833 boolean_t user_wire
);
835 /* Deallocate a region */
836 extern kern_return_t
vm_map_remove(
842 /* Place a copy into a map */
843 extern kern_return_t
vm_map_copyout(
845 vm_offset_t
*dst_addr
, /* OUT */
848 extern kern_return_t
vm_map_copyin_common(
850 vm_offset_t src_addr
,
852 boolean_t src_destroy
,
853 boolean_t src_volatile
,
854 vm_map_copy_t
*copy_result
, /* OUT */
855 boolean_t use_maxprot
);
857 extern kern_return_t
vm_region_clone(
858 ipc_port_t src_region
,
859 ipc_port_t dst_region
);
861 extern kern_return_t
vm_map_region_replace(
863 ipc_port_t old_region
,
864 ipc_port_t new_region
,
868 extern boolean_t
vm_map_check_protection(
872 vm_prot_t protection
);
875 * Macros to invoke vm_map_copyin_common. vm_map_copyin is the
876 * usual form; it handles a copyin based on the current protection
877 * (current protection == VM_PROT_NONE) is a failure.
878 * vm_map_copyin_maxprot handles a copyin based on maximum possible
879 * access. The difference is that a region with no current access
880 * BUT possible maximum access is rejected by vm_map_copyin(), but
881 * returned by vm_map_copyin_maxprot.
883 #define vm_map_copyin(src_map, src_addr, len, src_destroy, copy_result) \
884 vm_map_copyin_common(src_map, src_addr, len, src_destroy, \
885 FALSE, copy_result, FALSE)
887 #define vm_map_copyin_maxprot(src_map, \
888 src_addr, len, src_destroy, copy_result) \
889 vm_map_copyin_common(src_map, src_addr, len, src_destroy, \
890 FALSE, copy_result, TRUE)
893 * Flags for vm_map_remove() and vm_map_delete()
895 #define VM_MAP_NO_FLAGS 0x0
896 #define VM_MAP_REMOVE_KUNWIRE 0x1
897 #define VM_MAP_REMOVE_INTERRUPTIBLE 0x2
898 #define VM_MAP_REMOVE_WAIT_FOR_KWIRE 0x4
901 * Backing store throttle when BS is exhausted
903 extern unsigned int vm_backing_store_low
;
905 extern void vm_backing_store_disable(
909 #endif /* __APPLE_API_PRIVATE */
911 #endif /* _VM_VM_MAP_H_ */