]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/vm/vm_map.h
xnu-792.22.5.tar.gz
[apple/xnu.git] / osfmk / vm / vm_map.h
index d9eb8c6c9bb41fb7b4c041c3215e7034fb28205a..1b6c8fd6781b7db1e6692ff2919e53b2e10f39ce 100644 (file)
@@ -1,23 +1,29 @@
 /*
 /*
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
  *
  *
- * @APPLE_LICENSE_HEADER_START@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
  * 
- * The contents of this file constitute Original Code as defined in and
- * are subject to the Apple Public Source License Version 1.1 (the
- * "License").  You may not use this file except in compliance with the
- * License.  Please obtain a copy of the License at
- * http://www.apple.com/publicsource and read it before using this file.
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
  * 
  * 
- * This Original Code and all software distributed under the License are
- * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
+ * 
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
- * License for the specific language governing rights and limitations
- * under the License.
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
  * 
  * 
- * @APPLE_LICENSE_HEADER_END@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
  */
 /*
  * @OSF_COPYRIGHT@
  */
 /*
  * @OSF_COPYRIGHT@
 #include <mach/vm_prot.h>
 #include <mach/vm_inherit.h>
 #include <mach/vm_behavior.h>
 #include <mach/vm_prot.h>
 #include <mach/vm_inherit.h>
 #include <mach/vm_behavior.h>
+#include <mach/vm_param.h>
 #include <vm/pmap.h>
 
 #include <vm/pmap.h>
 
-typedef struct vm_map_entry    *vm_map_entry_t;
-
-extern void    kernel_vm_map_reference(vm_map_t        map);
+#ifdef KERNEL_PRIVATE
 
 
-#ifndef MACH_KERNEL_PRIVATE
+#include <sys/cdefs.h>
 
 
-struct vm_map_entry {};
+__BEGIN_DECLS
 
 extern void    vm_map_reference(vm_map_t       map);
 extern vm_map_t current_map(void);
 
 
 extern void    vm_map_reference(vm_map_t       map);
 extern vm_map_t current_map(void);
 
-#else /* MACH_KERNEL_PRIVATE */
+__END_DECLS
+
+#ifdef MACH_KERNEL_PRIVATE
 
 
-#include <cpus.h>
 #include <task_swapper.h>
 #include <mach_assert.h>
 
 #include <task_swapper.h>
 #include <mach_assert.h>
 
@@ -96,13 +102,9 @@ extern vm_map_t current_map(void);
 #include <kern/zalloc.h>
 #include <kern/macro_help.h>
 
 #include <kern/zalloc.h>
 #include <kern/macro_help.h>
 
-#define shared_region_mapping_lock_init(object)   \
-                       mutex_init(&(object)->Lock, ETAP_VM_OBJ)
-#define shared_region_mapping_lock(object)        mutex_lock(&(object)->Lock)
-#define shared_region_mapping_unlock(object)      mutex_unlock(&(object)->Lock)
-#include <kern/thread_act.h>
+#include <kern/thread.h>
 
 
-#define current_map_fast()     (current_act_fast()->map)
+#define current_map_fast()     (current_thread()->map)
 #define        current_map()           (current_map_fast())
 
 /*
 #define        current_map()           (current_map_fast())
 
 /*
@@ -114,6 +116,9 @@ extern vm_map_t current_map(void);
  *     vm_map_copy_t           represents memory copied from an address map,
  *                              used for inter-map copy operations
  */
  *     vm_map_copy_t           represents memory copied from an address map,
  *                              used for inter-map copy operations
  */
+typedef struct vm_map_entry    *vm_map_entry_t;
+#define VM_MAP_ENTRY_NULL      ((vm_map_entry_t) 0)
+
 
 /*
  *     Type:           vm_map_object_t [internal use only]
 
 /*
  *     Type:           vm_map_object_t [internal use only]
@@ -123,11 +128,11 @@ extern vm_map_t current_map(void);
  *             memory object or a sub map (of the kernel map).
  */
 typedef union vm_map_object {
  *             memory object or a sub map (of the kernel map).
  */
 typedef union vm_map_object {
-       struct vm_object        *vm_object;     /* object object */
-       struct vm_map           *sub_map;       /* belongs to another map */
+       vm_object_t             vm_object;      /* object object */
+       vm_map_t                sub_map;        /* belongs to another map */
 } vm_map_object_t;
 
 } vm_map_object_t;
 
-#define named_entry_lock_init(object)   mutex_init(&(object)->Lock, ETAP_VM_OBJ)
+#define named_entry_lock_init(object)   mutex_init(&(object)->Lock, 0)
 #define named_entry_lock(object)          mutex_lock(&(object)->Lock)
 #define named_entry_unlock(object)        mutex_unlock(&(object)->Lock)   
 
 #define named_entry_lock(object)          mutex_lock(&(object)->Lock)
 #define named_entry_unlock(object)        mutex_unlock(&(object)->Lock)   
 
@@ -151,23 +156,21 @@ typedef union vm_map_object {
 
 struct vm_named_entry {
        decl_mutex_data(,       Lock)           /* Synchronization */
 
 struct vm_named_entry {
        decl_mutex_data(,       Lock)           /* Synchronization */
-       vm_object_t             object;         /* object I point to */
-       vm_object_offset_t      offset;         /* offset into object */
        union {
        union {
-               ipc_port_t              pager;  /* amo pager port */
-               vm_map_t                map;    /* map backing submap */
+               vm_object_t     object;         /* object I point to */
+               memory_object_t pager;          /* amo pager port */
+               vm_map_t        map;            /* map backing submap */
        } backing;
        } backing;
-       unsigned int            size;           /* size of region */
-       unsigned int            protection;     /* access permissions */
+       vm_object_offset_t      offset;         /* offset into object */
+       vm_object_size_t        size;           /* size of region */
+       vm_prot_t               protection;     /* access permissions */
        int                     ref_count;      /* Number of references */
        int                     ref_count;      /* Number of references */
-       unsigned int
-       /* boolean_t */         internal:1,     /* is an internal object */
-       /* boolean_t */         is_sub_map:1;   /* is object is a submap? */
+       unsigned int                            /* Is backing.xxx : */
+       /* boolean_t */         internal:1,     /* ... an internal object */
+       /* boolean_t */         is_sub_map:1,   /* ... a submap? */
+       /* boolean_t */         is_pager:1;     /* ... a pager port */
 };
 
 };
 
-typedef struct vm_named_entry  *vm_named_entry_t;
-
-
 /*
  *     Type:           vm_map_entry_t [internal use only]
  *
 /*
  *     Type:           vm_map_entry_t [internal use only]
  *
@@ -184,8 +187,8 @@ typedef struct vm_named_entry       *vm_named_entry_t;
 struct vm_map_links {
        struct vm_map_entry     *prev;          /* previous entry */
        struct vm_map_entry     *next;          /* next entry */
 struct vm_map_links {
        struct vm_map_entry     *prev;          /* previous entry */
        struct vm_map_entry     *next;          /* next entry */
-       vm_offset_t             start;          /* start address */
-       vm_offset_t             end;            /* end address */
+       vm_map_offset_t         start;          /* start address */
+       vm_map_offset_t         end;            /* end address */
 };
 
 struct vm_map_entry {
 };
 
 struct vm_map_entry {
@@ -208,8 +211,9 @@ struct vm_map_entry {
        /* vm_prot_t */         protection:3,   /* protection code */
        /* vm_prot_t */         max_protection:3,/* maximum protection */
        /* vm_inherit_t */      inheritance:2,  /* inheritance */
        /* vm_prot_t */         protection:3,   /* protection code */
        /* vm_prot_t */         max_protection:3,/* maximum protection */
        /* vm_inherit_t */      inheritance:2,  /* inheritance */
-       /* nested pmap */       use_pmap:1,     /* nested pmaps */
-       /* user alias */        alias:8;
+       /* boolean_t */         use_pmap:1,     /* nested pmaps */
+       /* unsigned char */     alias:8,        /* user alias */
+       /* unsigned char */     pad:8;          /* available bits */
        unsigned short          wired_count;    /* can be paged if = 0 */
        unsigned short          user_wired_count; /* for vm_wire */
 };
        unsigned short          wired_count;    /* can be paged if = 0 */
        unsigned short          user_wired_count; /* for vm_wire */
 };
@@ -256,7 +260,7 @@ struct vm_map {
 #define min_offset             hdr.links.start /* start of range */
 #define max_offset             hdr.links.end   /* end of range */
        pmap_t                  pmap;           /* Physical map */
 #define min_offset             hdr.links.start /* start of range */
 #define max_offset             hdr.links.end   /* end of range */
        pmap_t                  pmap;           /* Physical map */
-       vm_size_t               size;           /* virtual size */
+       vm_map_size_t           size;           /* virtual size */
        int                     ref_count;      /* Reference count */
 #if    TASK_SWAPPER
        int                     res_count;      /* Residence count (swap) */
        int                     ref_count;      /* Reference count */
 #if    TASK_SWAPPER
        int                     res_count;      /* Residence count (swap) */
@@ -269,6 +273,7 @@ struct vm_map {
                                                   for space? */
        boolean_t               wiring_required;/* All memory wired? */
        boolean_t               no_zero_fill;   /* No zero fill absent pages */
                                                   for space? */
        boolean_t               wiring_required;/* All memory wired? */
        boolean_t               no_zero_fill;   /* No zero fill absent pages */
+       boolean_t               mapped;         /* has this map been mapped */
        unsigned int            timestamp;      /* Version number */
 } ;
 
        unsigned int            timestamp;      /* Version number */
 } ;
 
@@ -324,81 +329,27 @@ typedef struct vm_map_version {
  *             entry onto which the other entries that represent
  *             the region are chained.
  *
  *             entry onto which the other entries that represent
  *             the region are chained.
  *
- *             The second format is a single vm object.  This is used
- *             primarily in the pageout path.  The third format is a
- *             list of vm pages.  An optional continuation provides
- *             a hook to be called to obtain more of the memory,
- *             or perform other operations.  The continuation takes 3
- *             arguments, a saved arg buffer, a pointer to a new vm_map_copy
- *             (returned) and an abort flag (abort if TRUE).
- */
-
-#define VM_MAP_COPY_PAGE_LIST_MAX      20
-#define        VM_MAP_COPY_PAGE_LIST_MAX_SIZE  (VM_MAP_COPY_PAGE_LIST_MAX * PAGE_SIZE)
-
-
-/*
- *     Options for vm_map_copyin_page_list.
- */
-
-#define        VM_MAP_COPYIN_OPT_VM_PROT               0x7
-#define        VM_MAP_COPYIN_OPT_SRC_DESTROY           0x8
-#define        VM_MAP_COPYIN_OPT_STEAL_PAGES           0x10
-#define        VM_MAP_COPYIN_OPT_PMAP_ENTER            0x20
-#define        VM_MAP_COPYIN_OPT_NO_ZERO_FILL          0x40
-
-/*
- *     Continuation structures for vm_map_copyin_page_list.
- */
-typedef        struct {
-       vm_map_t        map;
-       vm_offset_t     src_addr;
-       vm_size_t       src_len;
-       vm_offset_t     destroy_addr;
-       vm_size_t       destroy_len;
-       int             options;
-}  vm_map_copyin_args_data_t, *vm_map_copyin_args_t;
-
-#define        VM_MAP_COPYIN_ARGS_NULL ((vm_map_copyin_args_t) 0)
-
-
-/* vm_map_copy_cont_t is a type definition/prototype
- * for the cont function pointer in vm_map_copy structure.
+ *             The second format is a single vm object.  This was used
+ *             primarily in the pageout path - but is not currently used
+ *             except for placeholder copy objects (see vm_map_copy_copy()).
+ *
+ *             The third format is a kernel buffer copy object - for data
+ *             small enough that physical copies were the most efficient
+ *             method.
  */
  */
-typedef kern_return_t (*vm_map_copy_cont_t)(
-                               vm_map_copyin_args_t,
-                               vm_map_copy_t *);
-
-#define        VM_MAP_COPY_CONT_NULL   ((vm_map_copy_cont_t) 0)
 
 struct vm_map_copy {
        int                     type;
 #define VM_MAP_COPY_ENTRY_LIST         1
 #define VM_MAP_COPY_OBJECT             2
 
 struct vm_map_copy {
        int                     type;
 #define VM_MAP_COPY_ENTRY_LIST         1
 #define VM_MAP_COPY_OBJECT             2
-#define VM_MAP_COPY_PAGE_LIST          3
-#define VM_MAP_COPY_KERNEL_BUFFER      4
+#define VM_MAP_COPY_KERNEL_BUFFER      3
        vm_object_offset_t      offset;
        vm_object_offset_t      offset;
-       vm_size_t               size;
+       vm_map_size_t           size;
        union {
            struct vm_map_header        hdr;    /* ENTRY_LIST */
        union {
            struct vm_map_header        hdr;    /* ENTRY_LIST */
-           struct {                            /* OBJECT */
-               vm_object_t             object;
-               vm_size_t               index;  /* record progress as pages
-                                                * are moved from object to
-                                                * page list; must be zero
-                                                * when first invoking
-                                                * vm_map_object_to_page_list
-                                                */
-           } c_o;
-           struct {                            /* PAGE_LIST */
-               int                     npages;
-               boolean_t               page_loose;
-               vm_map_copy_cont_t      cont;
-               vm_map_copyin_args_t    cont_args;
-               vm_page_t               page_list[VM_MAP_COPY_PAGE_LIST_MAX];
-           } c_p;
-           struct {                            /* KERNEL_BUFFER */
-               vm_offset_t             kdata;
+           vm_object_t                 object; /* OBJECT */
+           struct {                            
+               void                    *kdata;       /* KERNEL_BUFFER */
                vm_size_t               kalloc_size;  /* size of this copy_t */
            } c_k;
        } c_u;
                vm_size_t               kalloc_size;  /* size of this copy_t */
            } c_k;
        } c_u;
@@ -407,14 +358,7 @@ struct vm_map_copy {
 
 #define cpy_hdr                        c_u.hdr
 
 
 #define cpy_hdr                        c_u.hdr
 
-#define cpy_object             c_u.c_o.object
-#define        cpy_index               c_u.c_o.index
-
-#define cpy_page_list          c_u.c_p.page_list
-#define cpy_npages             c_u.c_p.npages
-#define cpy_page_loose         c_u.c_p.page_loose
-#define cpy_cont               c_u.c_p.cont
-#define cpy_cont_args          c_u.c_p.cont_args
+#define cpy_object             c_u.object
 
 #define cpy_kdata              c_u.c_k.kdata
 #define cpy_kalloc_size                c_u.c_k.kalloc_size
 
 #define cpy_kdata              c_u.c_k.kdata
 #define cpy_kalloc_size                c_u.c_k.kalloc_size
@@ -431,47 +375,6 @@ struct vm_map_copy {
 #define vm_map_copy_last_entry(copy)           \
                ((copy)->cpy_hdr.links.prev)
 
 #define vm_map_copy_last_entry(copy)           \
                ((copy)->cpy_hdr.links.prev)
 
-/*
- *     Continuation macros for page list copy objects
- */
-
-#define        vm_map_copy_invoke_cont(old_copy, new_copy, result)             \
-MACRO_BEGIN                                                            \
-       assert(vm_map_copy_cont_is_valid(old_copy));                    \
-       vm_map_copy_page_discard(old_copy);                             \
-       *result = (*((old_copy)->cpy_cont))((old_copy)->cpy_cont_args,  \
-                                           new_copy);                  \
-       (old_copy)->cpy_cont = VM_MAP_COPY_CONT_NULL;                   \
-MACRO_END
-
-#define        vm_map_copy_invoke_extend_cont(old_copy, new_copy, result)      \
-MACRO_BEGIN                                                            \
-       assert(vm_map_copy_cont_is_valid(old_copy));                    \
-       *result = (*((old_copy)->cpy_cont))((old_copy)->cpy_cont_args,  \
-                                           new_copy);                  \
-       (old_copy)->cpy_cont = VM_MAP_COPY_CONT_NULL;                   \
-MACRO_END
-
-#define vm_map_copy_abort_cont(old_copy)                               \
-MACRO_BEGIN                                                            \
-       assert(vm_map_copy_cont_is_valid(old_copy));                    \
-       vm_map_copy_page_discard(old_copy);                             \
-       (*((old_copy)->cpy_cont))((old_copy)->cpy_cont_args,            \
-                                 (vm_map_copy_t *) 0);                 \
-       (old_copy)->cpy_cont = VM_MAP_COPY_CONT_NULL;                   \
-       (old_copy)->cpy_cont_args = VM_MAP_COPYIN_ARGS_NULL;            \
-MACRO_END
-
-#define vm_map_copy_has_cont(copy)                                     \
-    (((copy)->cpy_cont) != VM_MAP_COPY_CONT_NULL)
-
-/*
- *     Macro to determine number of pages in a page-list copy chain.
- */
-
-#define vm_map_copy_page_count(copy)                                   \
-    (round_page(((vm_offset_t)(copy)->offset - trunc_page((vm_offset_t)(copy)->offset)) + (copy)->size) / PAGE_SIZE)
-
 /*
  *     Macros:         vm_map_lock, etc. [internal use only]
  *     Description:
 /*
  *     Macros:         vm_map_lock, etc. [internal use only]
  *     Description:
@@ -481,25 +384,17 @@ MACRO_END
  */
 
 #define vm_map_lock_init(map)                                          \
  */
 
 #define vm_map_lock_init(map)                                          \
-MACRO_BEGIN                                                            \
-       lock_init(&(map)->lock, TRUE, ETAP_VM_MAP, ETAP_VM_MAP_I);      \
-       (map)->timestamp = 0;                                           \
-MACRO_END
-#define vm_map_lock(map)                       \
-MACRO_BEGIN                                    \
-       lock_write(&(map)->lock);               \
-       (map)->timestamp++;                     \
-MACRO_END
-
-#define vm_map_unlock(map)     lock_write_done(&(map)->lock)
-#define vm_map_lock_read(map)  lock_read(&(map)->lock)
-#define vm_map_unlock_read(map)        lock_read_done(&(map)->lock)
+       ((map)->timestamp = 0 ,                                         \
+       lock_init(&(map)->lock, TRUE, 0, 0))
+
+#define vm_map_lock(map)               lock_write(&(map)->lock)
+#define vm_map_unlock(map)                                             \
+               ((map)->timestamp++ ,   lock_write_done(&(map)->lock))
+#define vm_map_lock_read(map)          lock_read(&(map)->lock)
+#define vm_map_unlock_read(map)                lock_read_done(&(map)->lock)
 #define vm_map_lock_write_to_read(map)                                 \
 #define vm_map_lock_write_to_read(map)                                 \
-               lock_write_to_read(&(map)->lock)
-#define vm_map_lock_read_to_write(map)                                 \
-               (lock_read_to_write(&(map)->lock) || (((map)->timestamp++), 0))
-
-extern zone_t          vm_map_copy_zone; /* zone for vm_map_copy structures */
+               ((map)->timestamp++ ,   lock_write_to_read(&(map)->lock))
+#define vm_map_lock_read_to_write(map) lock_read_to_write(&(map)->lock)
 
 /*
  *     Exported procedures that operate on vm_map_t.
 
 /*
  *     Exported procedures that operate on vm_map_t.
@@ -511,56 +406,45 @@ extern void               vm_map_init(void);
 /* Allocate a range in the specified virtual address map and
  * return the entry allocated for that range. */
 extern kern_return_t vm_map_find_space(
 /* Allocate a range in the specified virtual address map and
  * return the entry allocated for that range. */
 extern kern_return_t vm_map_find_space(
-                               vm_map_t        map,
-                               vm_offset_t     *address,       /* OUT */
-                               vm_size_t       size,
-                               vm_offset_t     mask,
-                               vm_map_entry_t  *o_entry);      /* OUT */
+                               vm_map_t                map,
+                               vm_map_address_t        *address,       /* OUT */
+                               vm_map_size_t           size,
+                               vm_map_offset_t         mask,
+                               int                     flags,
+                               vm_map_entry_t          *o_entry);      /* OUT */
 
 /* Lookup map entry containing or the specified address in the given map */
 extern boolean_t       vm_map_lookup_entry(
 
 /* Lookup map entry containing or the specified address in the given map */
 extern boolean_t       vm_map_lookup_entry(
-                               vm_map_t        map,
-                               vm_offset_t     address,
-                               vm_map_entry_t  *entry);        /* OUT */
-
-/* A version of vm_map_copy_discard that can be called
- * as a continuation from a vm_map_copy page list. */
-extern kern_return_t   vm_map_copy_discard_cont(
-                               vm_map_copyin_args_t    cont_args,
-                               vm_map_copy_t           *copy_result);/* OUT */
+                               vm_map_t                map,
+                               vm_map_address_t        address,
+                               vm_map_entry_t          *entry);        /* OUT */
 
 /* Find the VM object, offset, and protection for a given virtual address
  * in the specified map, assuming a page fault of the  type specified. */
 extern kern_return_t   vm_map_lookup_locked(
 
 /* Find the VM object, offset, and protection for a given virtual address
  * in the specified map, assuming a page fault of the  type specified. */
 extern kern_return_t   vm_map_lookup_locked(
-                               vm_map_t        *var_map,       /* IN/OUT */
-                               vm_offset_t     vaddr,
-                               vm_prot_t       fault_type,
-                               vm_map_version_t *out_version,  /* OUT */
-                               vm_object_t     *object,        /* OUT */
-                               vm_object_offset_t *offset,     /* OUT */
-                               vm_prot_t       *out_prot,      /* OUT */
-                               boolean_t       *wired,         /* OUT */
-                               int             *behavior,      /* OUT */
-                               vm_object_offset_t *lo_offset,  /* OUT */
-                               vm_object_offset_t *hi_offset,  /* OUT */
-                               vm_map_t        *pmap_map);     /* OUT */
+                               vm_map_t                *var_map,       /* IN/OUT */
+                               vm_map_address_t        vaddr,
+                               vm_prot_t               fault_type,
+                               vm_map_version_t        *out_version,   /* OUT */
+                               vm_object_t             *object,        /* OUT */
+                               vm_object_offset_t      *offset,        /* OUT */
+                               vm_prot_t               *out_prot,      /* OUT */
+                               boolean_t               *wired,         /* OUT */
+                               int                     *behavior,      /* OUT */
+                               vm_map_offset_t         *lo_offset,     /* OUT */
+                               vm_map_offset_t         *hi_offset,     /* OUT */
+                               vm_map_t                *real_map);     /* OUT */
 
 /* Verifies that the map has not changed since the given version. */
 extern boolean_t       vm_map_verify(
 
 /* Verifies that the map has not changed since the given version. */
 extern boolean_t       vm_map_verify(
-                               vm_map_t         map,
-                               vm_map_version_t *version);     /* REF */
-
-/* Split a vm_map_entry into 2 entries */
-extern void            _vm_map_clip_start(
-                               struct vm_map_header    *map_header,
-                               vm_map_entry_t          entry,
-                               vm_offset_t             start);
+                               vm_map_t                map,
+                               vm_map_version_t        *version);      /* REF */
 
 extern vm_map_entry_t  vm_map_entry_insert(
                                vm_map_t                map,
                                vm_map_entry_t          insp_entry,
 
 extern vm_map_entry_t  vm_map_entry_insert(
                                vm_map_t                map,
                                vm_map_entry_t          insp_entry,
-                               vm_offset_t             start,
-                               vm_offset_t             end,
+                               vm_map_offset_t         start,
+                               vm_map_offset_t         end,
                                vm_object_t             object,
                                vm_object_offset_t      offset,
                                boolean_t               needs_copy,
                                vm_object_t             object,
                                vm_object_offset_t      offset,
                                boolean_t               needs_copy,
@@ -572,52 +456,15 @@ extern vm_map_entry_t     vm_map_entry_insert(
                                vm_inherit_t            inheritance,
                                unsigned                wired_count);
 
                                vm_inherit_t            inheritance,
                                unsigned                wired_count);
 
-extern kern_return_t   vm_remap_extract(
-                               vm_map_t        map,
-                               vm_offset_t     addr,
-                               vm_size_t       size,
-                               boolean_t       copy,
-                               struct vm_map_header *map_header,
-                               vm_prot_t       *cur_protection,
-                               vm_prot_t       *max_protection,
-                               vm_inherit_t    inheritance,
-                               boolean_t       pageable);
-
-extern kern_return_t   vm_remap_range_allocate(
-                               vm_map_t        map,
-                               vm_offset_t     *address,
-                               vm_size_t       size,
-                               vm_offset_t     mask,
-                               boolean_t       anywhere,
-                               vm_map_entry_t  *map_entry);
-
-extern kern_return_t   vm_remap_extract(
-                               vm_map_t        map,
-                               vm_offset_t     addr,
-                               vm_size_t       size,
-                               boolean_t       copy,
-                               struct vm_map_header *map_header,
-                               vm_prot_t       *cur_protection,
-                               vm_prot_t       *max_protection,
-                               vm_inherit_t    inheritance,
-                               boolean_t       pageable);
-
-extern kern_return_t   vm_remap_range_allocate(
-                               vm_map_t        map,
-                               vm_offset_t     *address,
-                               vm_size_t       size,
-                               vm_offset_t     mask,
-                               boolean_t       anywhere,
-                               vm_map_entry_t  *map_entry);
 
 /*
  *     Functions implemented as macros
  */
 
 /*
  *     Functions implemented as macros
  */
-#define                vm_map_min(map)         ((map)->min_offset)
+#define                vm_map_min(map) ((map)->min_offset)
                                                /* Lowest valid address in
                                                 * a map */
 
                                                /* Lowest valid address in
                                                 * a map */
 
-#define                vm_map_max(map)         ((map)->max_offset)
+#define                vm_map_max(map) ((map)->max_offset)
                                                /* Highest valid address */
 
 #define                vm_map_pmap(map)        ((map)->pmap)
                                                /* Highest valid address */
 
 #define                vm_map_pmap(map)        ((map)->pmap)
@@ -650,9 +497,9 @@ extern void         vm_map_reference_swap(
 
 #else  /* MACH_ASSERT */
 
 
 #else  /* MACH_ASSERT */
 
-#define vm_map_reference(map)                  \
+#define vm_map_reference(map)          \
 MACRO_BEGIN                                    \
 MACRO_BEGIN                                    \
-       vm_map_t Map = (map);                   \
+       vm_map_t Map = (map);           \
        if (Map) {                              \
                mutex_lock(&Map->s_lock);       \
                Map->res_count++;               \
        if (Map) {                              \
                mutex_lock(&Map->s_lock);       \
                Map->res_count++;               \
@@ -663,9 +510,9 @@ MACRO_END
 
 #define vm_map_res_reference(map)              \
 MACRO_BEGIN                                    \
 
 #define vm_map_res_reference(map)              \
 MACRO_BEGIN                                    \
-       vm_map_t Lmap = (map);                  \
+       vm_map_t Lmap = (map);          \
        if (Lmap->res_count == 0) {             \
        if (Lmap->res_count == 0) {             \
-               mutex_unlock(&Lmap->s_lock);    \
+               mutex_unlock(&Lmap->s_lock);\
                vm_map_lock(Lmap);              \
                vm_map_swapin(Lmap);            \
                mutex_lock(&Lmap->s_lock);      \
                vm_map_lock(Lmap);              \
                vm_map_swapin(Lmap);            \
                mutex_lock(&Lmap->s_lock);      \
@@ -677,8 +524,8 @@ MACRO_END
 
 #define vm_map_res_deallocate(map)             \
 MACRO_BEGIN                                    \
 
 #define vm_map_res_deallocate(map)             \
 MACRO_BEGIN                                    \
-       vm_map_t Map = (map);                   \
-       if (--Map->res_count == 0) {            \
+       vm_map_t Map = (map);           \
+       if (--Map->res_count == 0) {    \
                mutex_unlock(&Map->s_lock);     \
                vm_map_lock(Map);               \
                vm_map_swapout(Map);            \
                mutex_unlock(&Map->s_lock);     \
                vm_map_lock(Map);               \
                vm_map_swapout(Map);            \
@@ -731,17 +578,16 @@ extern vm_object_t        vm_submap_object;
  *     Wait and wakeup macros for in_transition map entries.
  */
 #define vm_map_entry_wait(map, interruptible)          \
  *     Wait and wakeup macros for in_transition map entries.
  */
 #define vm_map_entry_wait(map, interruptible)          \
-        MACRO_BEGIN                                     \
-        assert_wait((event_t)&(map)->hdr, interruptible);      \
-        vm_map_unlock(map);                             \
-       thread_block((void (*)(void))0);                \
-        MACRO_END
+       ((map)->timestamp++ ,                           \
+        thread_sleep_lock_write((event_t)&(map)->hdr,  \
+                        &(map)->lock, interruptible))
 
 
-#define vm_map_entry_wakeup(map)        thread_wakeup((event_t)(&(map)->hdr))
 
 
+#define vm_map_entry_wakeup(map)        \
+       thread_wakeup((event_t)(&(map)->hdr))
 
 
 
 
-#define        vm_map_ref_fast(map)                            \
+#define        vm_map_ref_fast(map)                    \
        MACRO_BEGIN                                     \
        mutex_lock(&map->s_lock);                       \
        map->ref_count++;                               \
        MACRO_BEGIN                                     \
        mutex_lock(&map->s_lock);                       \
        map->ref_count++;                               \
@@ -749,12 +595,12 @@ extern vm_object_t        vm_submap_object;
        mutex_unlock(&map->s_lock);                     \
        MACRO_END
 
        mutex_unlock(&map->s_lock);                     \
        MACRO_END
 
-#define        vm_map_dealloc_fast(map)                        \
+#define        vm_map_dealloc_fast(map)                \
        MACRO_BEGIN                                     \
        MACRO_BEGIN                                     \
-       register int c;                                 \
+       register int c;                         \
                                                        \
        mutex_lock(&map->s_lock);                       \
                                                        \
        mutex_lock(&map->s_lock);                       \
-       c = --map->ref_count;                           \
+       c = --map->ref_count;                   \
        if (c > 0)                                      \
                vm_map_res_deallocate(map);             \
        mutex_unlock(&map->s_lock);                     \
        if (c > 0)                                      \
                vm_map_res_deallocate(map);             \
        mutex_unlock(&map->s_lock);                     \
@@ -764,38 +610,16 @@ extern vm_object_t        vm_submap_object;
 
 
 /* simplify map entries */
 
 
 /* simplify map entries */
+extern void            vm_map_simplify_entry(
+       vm_map_t        map,
+       vm_map_entry_t  this_entry);
 extern void            vm_map_simplify(
 extern void            vm_map_simplify(
-                               vm_map_t        map,
-                               vm_offset_t     start);
-
-/* Steal all the pages from a vm_map_copy page_list */
-extern void            vm_map_copy_steal_pages(
-                               vm_map_copy_t   copy);
-
-/* Discard a copy without using it */
-extern void            vm_map_copy_discard(
-                               vm_map_copy_t   copy);
+                               vm_map_t                map,
+                               vm_map_offset_t         start);
 
 /* Move the information in a map copy object to a new map copy object */
 extern vm_map_copy_t   vm_map_copy_copy(
 
 /* Move the information in a map copy object to a new map copy object */
 extern vm_map_copy_t   vm_map_copy_copy(
-                               vm_map_copy_t   copy);
-
-/* Overwrite existing memory with a copy */
-extern kern_return_t   vm_map_copy_overwrite(
-                               vm_map_t        dst_map,
-                               vm_offset_t     dst_addr,
-                               vm_map_copy_t   copy,
-                               int             interruptible);
-
-/* Version of vm_map_copyout() for page list vm map copies. */
-extern kern_return_t   vm_map_copyout_page_list(
-                               vm_map_t        dst_map,
-                               vm_offset_t     *dst_addr,      /* OUT */
-                               vm_map_copy_t   copy);
-
-/* Get rid of the pages in a page_list copy. */
-extern void            vm_map_copy_page_discard(
-                               vm_map_copy_t   copy);
+                               vm_map_copy_t           copy);
 
 /* Create a copy object from an object. */
 extern kern_return_t   vm_map_copyin_object(
 
 /* Create a copy object from an object. */
 extern kern_return_t   vm_map_copyin_object(
@@ -804,48 +628,12 @@ extern kern_return_t      vm_map_copyin_object(
                                vm_object_size_t        size,
                                vm_map_copy_t           *copy_result); /* OUT */
 
                                vm_object_size_t        size,
                                vm_map_copy_t           *copy_result); /* OUT */
 
-
-/* Make a copy of a region */
-/* Make a copy of a region using a page list copy */
-extern kern_return_t   vm_map_copyin_page_list(
-                               vm_map_t        src_map,
-                               vm_offset_t     src_addr,
-                               vm_size_t       len,
-                               int             options,
-                               vm_map_copy_t   *copy_result,   /* OUT */
-                               boolean_t       is_cont);
-
-extern vm_map_t                vm_map_switch(
-                               vm_map_t        map);
-
-extern int             vm_map_copy_cont_is_valid(
-                               vm_map_copy_t   copy);
-
-
-
-#endif /* !MACH_KERNEL_PRIVATE */
-
-/* Get rid of a map */
-extern void            vm_map_destroy(
-                               vm_map_t        map);
-/* Lose a reference */
-extern void            vm_map_deallocate(
-                               vm_map_t        map);
-
-/* Create an empty map */
-extern vm_map_t                vm_map_create(
-                               pmap_t          pmap,
-                               vm_offset_t     min,
-                               vm_offset_t     max,
-                               boolean_t       pageable);
-
-
 /* Enter a mapping */
 extern kern_return_t   vm_map_enter(
                                vm_map_t                map,
 /* Enter a mapping */
 extern kern_return_t   vm_map_enter(
                                vm_map_t                map,
-                               vm_offset_t             *address,
-                               vm_size_t               size,
-                               vm_offset_t             mask,
+                               vm_map_offset_t         *address,
+                               vm_map_size_t           size,
+                               vm_map_offset_t         mask,
                                int                     flags,
                                vm_object_t             object,
                                vm_object_offset_t      offset,
                                int                     flags,
                                vm_object_t             object,
                                vm_object_offset_t      offset,
@@ -854,96 +642,235 @@ extern kern_return_t     vm_map_enter(
                                vm_prot_t               max_protection,
                                vm_inherit_t            inheritance);
 
                                vm_prot_t               max_protection,
                                vm_inherit_t            inheritance);
 
+/* XXX should go away - replaced with regular enter of contig object */
+extern  kern_return_t  vm_map_enter_cpm(
+                               vm_map_t                map,
+                               vm_map_address_t        *addr,
+                               vm_map_size_t           size,
+                               int                     flags);
+
+extern kern_return_t vm_map_remap(
+                               vm_map_t                target_map,
+                               vm_map_offset_t         *address,
+                               vm_map_size_t           size,
+                               vm_map_offset_t         mask,
+                               boolean_t               anywhere,
+                               vm_map_t                src_map,
+                               vm_map_offset_t         memory_address,
+                               boolean_t               copy,
+                               vm_prot_t               *cur_protection,
+                               vm_prot_t               *max_protection,
+                               vm_inherit_t            inheritance);
+
+
+/*
+ * Read and write from a kernel buffer to a specified map.
+ */
 extern kern_return_t   vm_map_write_user(
 extern kern_return_t   vm_map_write_user(
-                               vm_map_t        map,
-                               vm_offset_t     src_addr,
-                               vm_offset_t     dst_addr,
-                               vm_size_t       size);
+                               vm_map_t                map,
+                               void                    *src_p,
+                               vm_map_offset_t         dst_addr,
+                               vm_size_t               size);
 
 extern kern_return_t   vm_map_read_user(
 
 extern kern_return_t   vm_map_read_user(
-                               vm_map_t        map,
-                               vm_offset_t     src_addr,
-                               vm_offset_t     dst_addr,
-                               vm_size_t       size);
+                               vm_map_t                map,
+                               vm_map_offset_t         src_addr,
+                               void                    *dst_p,
+                               vm_size_t               size);
 
 /* Create a new task map using an existing task map as a template. */
 extern vm_map_t                vm_map_fork(
 
 /* Create a new task map using an existing task map as a template. */
 extern vm_map_t                vm_map_fork(
-                               vm_map_t        old_map);
+                               vm_map_t                old_map);
+
+/* Change inheritance */
+extern kern_return_t   vm_map_inherit(
+                               vm_map_t                map,
+                               vm_map_offset_t         start,
+                               vm_map_offset_t         end,
+                               vm_inherit_t            new_inheritance);
+
+/* Add or remove machine-dependent attributes from map regions */
+extern kern_return_t   vm_map_machine_attribute(
+                               vm_map_t                map,
+                               vm_map_offset_t         start,
+                               vm_map_offset_t         end,
+                               vm_machine_attribute_t  attribute,
+                               vm_machine_attribute_val_t* value); /* IN/OUT */
+
+extern kern_return_t   vm_map_msync(
+                               vm_map_t                map,
+                               vm_map_address_t        address,
+                               vm_map_size_t           size,
+                               vm_sync_t               sync_flags);
+
+/* Set paging behavior */
+extern kern_return_t   vm_map_behavior_set(
+                               vm_map_t                map,
+                               vm_map_offset_t         start,
+                               vm_map_offset_t         end,
+                               vm_behavior_t           new_behavior);
+
+extern kern_return_t vm_map_purgable_control(
+                               vm_map_t                map,
+                               vm_map_offset_t         address,
+                               vm_purgable_t           control,
+                               int                     *state);
+
+extern kern_return_t vm_map_region(
+                               vm_map_t                 map,
+                               vm_map_offset_t         *address,
+                               vm_map_size_t           *size,
+                               vm_region_flavor_t       flavor,
+                               vm_region_info_t         info,
+                               mach_msg_type_number_t  *count,
+                               mach_port_t             *object_name);
+
+extern kern_return_t vm_map_region_recurse_64(
+                               vm_map_t                 map,
+                               vm_map_offset_t         *address,
+                               vm_map_size_t           *size,
+                               natural_t               *nesting_depth,
+                               vm_region_submap_info_64_t info,
+                               mach_msg_type_number_t  *count);
+
+extern kern_return_t vm_map_page_info(
+                               vm_map_t                map,
+                               vm_map_offset_t         offset,
+                               int                     *disposition,
+                               int                     *ref_count);
+
+extern kern_return_t   vm_map_submap(
+                               vm_map_t                map,
+                               vm_map_offset_t         start,
+                               vm_map_offset_t         end,
+                               vm_map_t                submap,
+                               vm_map_offset_t         offset,
+                               boolean_t               use_pmap);
+
+extern void vm_map_submap_pmap_clean(
+       vm_map_t        map,
+       vm_map_offset_t start,
+       vm_map_offset_t end,
+       vm_map_t        sub_map,
+       vm_map_offset_t offset);
+
+/* Convert from a map entry port to a map */
+extern vm_map_t convert_port_entry_to_map(
+       ipc_port_t      port);
+
+/* Convert from a port to a vm_object */
+extern vm_object_t convert_port_entry_to_object(
+       ipc_port_t      port);
+
+
+#endif /* MACH_KERNEL_PRIVATE */
+
+__BEGIN_DECLS
+
+/* Create an empty map */
+extern vm_map_t                vm_map_create(
+                               pmap_t                  pmap,
+                               vm_map_offset_t         min_off,
+                               vm_map_offset_t         max_off,
+                               boolean_t               pageable);
+
+/* Get rid of a map */
+extern void            vm_map_destroy(
+                               vm_map_t                map);
+/* Lose a reference */
+extern void            vm_map_deallocate(
+                               vm_map_t                map);
+
+extern vm_map_t                vm_map_switch(
+                               vm_map_t                map);
 
 /* Change protection */
 extern kern_return_t   vm_map_protect(
 
 /* Change protection */
 extern kern_return_t   vm_map_protect(
-                               vm_map_t        map,
-                               vm_offset_t     start,
-                               vm_offset_t     end,
-                               vm_prot_t       new_prot,
-                               boolean_t       set_max);
+                               vm_map_t                map,
+                               vm_map_offset_t         start,
+                               vm_map_offset_t         end,
+                               vm_prot_t               new_prot,
+                               boolean_t               set_max);
 
 
-/* Change inheritance */
-extern kern_return_t   vm_map_inherit(
-                               vm_map_t        map,
-                               vm_offset_t     start,
-                               vm_offset_t     end,
-                               vm_inherit_t    new_inheritance);
+/* Check protection */
+extern boolean_t vm_map_check_protection(
+                               vm_map_t                map,
+                               vm_map_offset_t         start,
+                               vm_map_offset_t         end,
+                               vm_prot_t               protection);
 
 /* wire down a region */
 extern kern_return_t   vm_map_wire(
 
 /* wire down a region */
 extern kern_return_t   vm_map_wire(
-                               vm_map_t        map,
-                               vm_offset_t     start,
-                               vm_offset_t     end,
-                               vm_prot_t       access_type,
-                               boolean_t       user_wire);
+                               vm_map_t                map,
+                               vm_map_offset_t         start,
+                               vm_map_offset_t         end,
+                               vm_prot_t               access_type,
+                               boolean_t               user_wire);
 
 /* unwire a region */
 extern kern_return_t   vm_map_unwire(
 
 /* unwire a region */
 extern kern_return_t   vm_map_unwire(
-                               vm_map_t        map,
-                               vm_offset_t     start,
-                               vm_offset_t     end,
-                               boolean_t       user_wire);
+                               vm_map_t                map,
+                               vm_map_offset_t         start,
+                               vm_map_offset_t         end,
+                               boolean_t               user_wire);
 
 /* Deallocate a region */
 extern kern_return_t   vm_map_remove(
 
 /* Deallocate a region */
 extern kern_return_t   vm_map_remove(
-                               vm_map_t        map,
-                               vm_offset_t     start,
-                               vm_offset_t     end,
-                               boolean_t       flags);
+                               vm_map_t                map,
+                               vm_map_offset_t         start,
+                               vm_map_offset_t         end,
+                               boolean_t               flags);
+
+/* Discard a copy without using it */
+extern void            vm_map_copy_discard(
+                               vm_map_copy_t           copy);
+
+/* Overwrite existing memory with a copy */
+extern kern_return_t   vm_map_copy_overwrite(
+                               vm_map_t                dst_map,
+                               vm_map_address_t        dst_addr,
+                               vm_map_copy_t           copy,
+                               int                     interruptible);
 
 /* Place a copy into a map */
 extern kern_return_t   vm_map_copyout(
 
 /* Place a copy into a map */
 extern kern_return_t   vm_map_copyout(
-                               vm_map_t        dst_map,
-                               vm_offset_t     *dst_addr,      /* OUT */
-                               vm_map_copy_t   copy);
+                               vm_map_t                dst_map,
+                               vm_map_address_t        *dst_addr,      /* OUT */
+                               vm_map_copy_t           copy);
 
 
+extern kern_return_t   vm_map_copyin_common(
+                               vm_map_t                src_map,
+                               vm_map_address_t        src_addr,
+                               vm_map_size_t           len,
+                               boolean_t               src_destroy,
+                               boolean_t               src_volatile,
+                               vm_map_copy_t           *copy_result,   /* OUT */
+                               boolean_t               use_maxprot);
 
 
-/* Add or remove machine-dependent attributes from map regions */
-extern kern_return_t   vm_map_machine_attribute(
-                               vm_map_t        map,
-                               vm_offset_t     address,
-                               vm_size_t       size,
-                               vm_machine_attribute_t  attribute,
-                               vm_machine_attribute_val_t* value); /* IN/OUT */
-/* Set paging behavior */
-extern kern_return_t   vm_map_behavior_set(
-                               vm_map_t        map,
-                               vm_offset_t     start,
-                               vm_offset_t     end,
-                               vm_behavior_t   new_behavior);
+extern void            vm_map_disable_NX(
+                               vm_map_t                map);
 
 
-extern kern_return_t   vm_map_copyin_common(
-                               vm_map_t        src_map,
-                               vm_offset_t     src_addr,
-                               vm_size_t       len,
-                               boolean_t       src_destroy,
-                               boolean_t       src_volatile,
-                               vm_map_copy_t   *copy_result,   /* OUT */
-                               boolean_t       use_maxprot);
+extern void            vm_map_set_64bit(
+                               vm_map_t                map);
 
 
-extern kern_return_t   vm_map_submap(
-                               vm_map_t        map,
-                               vm_offset_t     start,
-                               vm_offset_t     end,
-                               vm_map_t        submap,
-                               vm_offset_t     offset,
-                               boolean_t       use_pmap);
+extern void            vm_map_set_32bit(
+                               vm_map_t                map);
+
+extern boolean_t       vm_map_has_4GB_pagezero(
+                               vm_map_t                map);
+
+extern void            vm_map_set_4GB_pagezero(
+                               vm_map_t                map);
+
+extern void            vm_map_clear_4GB_pagezero(
+                               vm_map_t                map);
+
+extern kern_return_t   vm_map_raise_min_offset(
+       vm_map_t        map,
+       vm_map_offset_t new_min_offset);
+
+extern vm_map_offset_t vm_compute_max_offset(
+                               unsigned                is64);
 
 /*
  *     Macros to invoke vm_map_copyin_common.  vm_map_copyin is the
 
 /*
  *     Macros to invoke vm_map_copyin_common.  vm_map_copyin is the
@@ -963,7 +890,11 @@ extern kern_return_t       vm_map_submap(
                vm_map_copyin_common(src_map, src_addr, len, src_destroy, \
                                        FALSE, copy_result, TRUE)
 
                vm_map_copyin_common(src_map, src_addr, len, src_destroy, \
                                        FALSE, copy_result, TRUE)
 
-#define VM_MAP_ENTRY_NULL      ((vm_map_entry_t) 0)
+/*
+ * Macros for rounding and truncation of vm_map offsets and sizes
+ */
+#define vm_map_round_page(x) (((vm_map_offset_t)(x) + PAGE_MASK) & ~((signed)PAGE_MASK))
+#define vm_map_trunc_page(x) ((vm_map_offset_t)(x) & ~((signed)PAGE_MASK))     
 
 /*
  * Flags for vm_map_remove() and vm_map_delete()
 
 /*
  * Flags for vm_map_remove() and vm_map_delete()
@@ -972,42 +903,34 @@ extern kern_return_t      vm_map_submap(
 #define        VM_MAP_REMOVE_KUNWIRE           0x1
 #define        VM_MAP_REMOVE_INTERRUPTIBLE     0x2
 #define        VM_MAP_REMOVE_WAIT_FOR_KWIRE    0x4
 #define        VM_MAP_REMOVE_KUNWIRE           0x1
 #define        VM_MAP_REMOVE_INTERRUPTIBLE     0x2
 #define        VM_MAP_REMOVE_WAIT_FOR_KWIRE    0x4
-
+#define VM_MAP_REMOVE_SAVE_ENTRIES     0x8
+
+/* Support for shared regions */
+extern kern_return_t vm_region_clone(
+                               ipc_port_t              src_region,
+                               ipc_port_t              dst_region);
+
+extern kern_return_t vm_map_region_replace(
+                               vm_map_t                target_map,
+                               ipc_port_t              old_region,
+                               ipc_port_t              new_region,
+                               vm_map_offset_t         start,  
+                               vm_map_offset_t         end);
+
+/* Support for UPLs from vm_maps */
+
+extern kern_return_t vm_map_get_upl(
+                               vm_map_t                target_map,
+                               vm_map_offset_t         map_offset,
+                               vm_size_t               *size,
+                               upl_t                   *upl,
+                               upl_page_info_array_t   page_info,
+                               mach_msg_type_number_t  *page_infoCnt,
+                               integer_t               *flags,
+                               integer_t               force_data_sync);
+
+__END_DECLS
+
+#endif /* KERNEL_PRIVATE */
  
  
-#ifdef MACH_KERNEL_PRIVATE 
-
-/* address space shared region descriptor */
-
-struct shared_region_mapping {
-        decl_mutex_data(,       Lock)   /* Synchronization */
-       int                     ref_count;
-       ipc_port_t              text_region;
-       vm_size_t               text_size;
-       ipc_port_t              data_region;
-       vm_size_t               data_size;
-       vm_offset_t             region_mappings;
-       vm_offset_t             client_base;
-       vm_offset_t             alternate_base;
-       vm_offset_t             alternate_next;
-       int                     flags;
-       int                     depth;
-       struct shared_region_object_chain *object_chain;
-       struct shared_region_mapping *self;
-       struct shared_region_mapping *next;
-};
-
-typedef struct shared_region_mapping *shared_region_mapping_t;
-
-struct shared_region_object_chain {
-       shared_region_mapping_t object_chain_region;
-       int                     depth;
-       struct shared_region_object_chain *next;
-};
-
-typedef struct shared_region_object_chain *shared_region_object_chain_t;
-
-#endif /* MACH_KERNEL_PRIVATE */
-
-
 #endif /* _VM_VM_MAP_H_ */
 #endif /* _VM_VM_MAP_H_ */
-