]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/vm/pmap.h
xnu-517.3.7.tar.gz
[apple/xnu.git] / osfmk / vm / pmap.h
index 26337c7e7c589adb4c22bc1442f6438695bc1f1d..02793058b89fcbe79d7cfcc6f8ac69bae7a1d27a 100644 (file)
@@ -3,19 +3,22 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
  *
  * @APPLE_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.
+ * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
  * 
  * 
- * This Original Code and all software distributed under the License are
- * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * 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. 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_LICENSE_HEADER_END@
  */
  *     many address spaces.
  */
 
  *     many address spaces.
  */
 
+/* Copy between a physical page and a virtual address */
+extern kern_return_t   copypv(
+                               addr64_t source, 
+                               addr64_t sink, 
+                               unsigned int size, 
+                               int which);     
+#define cppvPsnk       1
+#define cppvPsrc       2
+#define cppvFsnk       4
+#define cppvFsrc       8
+#define cppvNoModSnk   16
+#define cppvNoRefSrc   32
+#define cppvKmap       64      /* User the kernel's vm_map */
+
 #if !defined(MACH_KERNEL_PRIVATE)
 
 typedef void *pmap_t;
 #if !defined(MACH_KERNEL_PRIVATE)
 
 typedef void *pmap_t;
@@ -138,7 +155,7 @@ extern void         pmap_init(void);        /* Initialization,
  *     However, for best performance pmap_free_pages should be accurate.
  */
 
  *     However, for best performance pmap_free_pages should be accurate.
  */
 
-extern boolean_t       pmap_next_page(vm_offset_t *paddr);
+extern boolean_t       pmap_next_page(ppnum_t *pnum);
                                                /* During VM initialization,
                                                 * return the next unused
                                                 * physical page.
                                                /* During VM initialization,
                                                 * return the next unused
                                                 * physical page.
@@ -165,14 +182,14 @@ extern void               pmap_switch(pmap_t);
 extern void            pmap_enter(     /* Enter a mapping */
                                pmap_t          pmap,
                                vm_offset_t     v,
 extern void            pmap_enter(     /* Enter a mapping */
                                pmap_t          pmap,
                                vm_offset_t     v,
-                               vm_offset_t     pa,
+                               ppnum_t         pn,
                                vm_prot_t       prot,
                                unsigned int    flags,
                                boolean_t       wired);
 
 extern void            pmap_remove_some_phys(
                                pmap_t          pmap,
                                vm_prot_t       prot,
                                unsigned int    flags,
                                boolean_t       wired);
 
 extern void            pmap_remove_some_phys(
                                pmap_t          pmap,
-                               vm_offset_t     pa);
+                               ppnum_t         pn);
 
 
 /*
 
 
 /*
@@ -180,36 +197,36 @@ extern void               pmap_remove_some_phys(
  */
 
 extern void            pmap_page_protect(      /* Restrict access to page. */
  */
 
 extern void            pmap_page_protect(      /* Restrict access to page. */
-                               vm_offset_t     phys,
+                               ppnum_t phys,
                                vm_prot_t       prot);
 
 extern void            (pmap_zero_page)(
                                vm_prot_t       prot);
 
 extern void            (pmap_zero_page)(
-                               vm_offset_t     phys);
+                               ppnum_t         pn);
 
 extern void            (pmap_zero_part_page)(
 
 extern void            (pmap_zero_part_page)(
-                               vm_offset_t     p,
+                               ppnum_t         pn,
                                vm_offset_t     offset,
                                vm_size_t       len);
 
 extern void            (pmap_copy_page)(
                                vm_offset_t     offset,
                                vm_size_t       len);
 
 extern void            (pmap_copy_page)(
-                               vm_offset_t     src,
-                               vm_offset_t     dest);
+                               ppnum_t         src,
+                               ppnum_t         dest);
 
 extern void            (pmap_copy_part_page)(
 
 extern void            (pmap_copy_part_page)(
-                               vm_offset_t     src,
+                               ppnum_t         src,
                                vm_offset_t     src_offset,
                                vm_offset_t     src_offset,
-                               vm_offset_t     dst,
+                               ppnum_t         dst,
                                vm_offset_t     dst_offset,
                                vm_size_t       len);
 
 extern void            (pmap_copy_part_lpage)(
                                vm_offset_t     src,
                                vm_offset_t     dst_offset,
                                vm_size_t       len);
 
 extern void            (pmap_copy_part_lpage)(
                                vm_offset_t     src,
-                               vm_offset_t     dst,
+                               ppnum_t         dst,
                                vm_offset_t     dst_offset,
                                vm_size_t       len);
 
 extern void            (pmap_copy_part_rpage)(
                                vm_offset_t     dst_offset,
                                vm_size_t       len);
 
 extern void            (pmap_copy_part_rpage)(
-                               vm_offset_t     src,
+                               ppnum_t         src,
                                vm_offset_t     src_offset,
                                vm_offset_t     dst,
                                vm_size_t       len);
                                vm_offset_t     src_offset,
                                vm_offset_t     dst,
                                vm_size_t       len);
@@ -218,7 +235,7 @@ extern void         (pmap_copy_part_rpage)(
  * debug/assertions. pmap_verify_free returns true iff
  * the given physical page is mapped into no pmap.
  */
  * debug/assertions. pmap_verify_free returns true iff
  * the given physical page is mapped into no pmap.
  */
-extern boolean_t       pmap_verify_free(vm_offset_t paddr);
+extern boolean_t       pmap_verify_free(ppnum_t pn);
 
 /*
  *     Statistics routines
 
 /*
  *     Statistics routines
@@ -266,8 +283,8 @@ extern kern_return_t        (pmap_attribute)(       /* Get/Set special memory
 
 extern kern_return_t   (pmap_attribute_cache_sync)(  /* Flush appropriate 
                                                       * cache based on
 
 extern kern_return_t   (pmap_attribute_cache_sync)(  /* Flush appropriate 
                                                       * cache based on
-                                                      * phys addr sent */
-                               vm_offset_t     addr
+                                                      * page number sent */
+                               ppnum_t         pn
                                vm_size_t       size, 
                                vm_machine_attribute_t attribute, 
                                vm_machine_attribute_val_t* value);
                                vm_size_t       size, 
                                vm_machine_attribute_t attribute, 
                                vm_machine_attribute_val_t* value);
@@ -314,7 +331,7 @@ extern kern_return_t        (pmap_attribute_cache_sync)(  /* Flush appropriate
                pmap_enter(                                     \
                        (pmap),                                 \
                        (virtual_address),                      \
                pmap_enter(                                     \
                        (pmap),                                 \
                        (virtual_address),                      \
-                       (page)->phys_addr,                      \
+                       (page)->phys_page,                      \
                        (protection) & ~(page)->page_lock,      \
                        flags,                                  \
                        (wired)                                 \
                        (protection) & ~(page)->page_lock,      \
                        flags,                                  \
                        (wired)                                 \
@@ -328,15 +345,15 @@ extern kern_return_t      (pmap_attribute_cache_sync)(  /* Flush appropriate
  *     by the hardware.
  */
                                /* Clear reference bit */
  *     by the hardware.
  */
                                /* Clear reference bit */
-extern void            pmap_clear_reference(vm_offset_t paddr);
+extern void            pmap_clear_reference(ppnum_t     pn);
                                /* Return reference bit */
                                /* Return reference bit */
-extern boolean_t       (pmap_is_referenced)(vm_offset_t paddr);
+extern boolean_t       (pmap_is_referenced)(ppnum_t     pn);
                                /* Set modify bit */
                                /* Set modify bit */
-extern void             pmap_set_modify(vm_offset_t paddr);
+extern void             pmap_set_modify(ppnum_t         pn);
                                /* Clear modify bit */
                                /* Clear modify bit */
-extern void            pmap_clear_modify(vm_offset_t paddr);
+extern void            pmap_clear_modify(ppnum_t pn);
                                /* Return modify bit */
                                /* Return modify bit */
-extern boolean_t       pmap_is_modified(vm_offset_t paddr);
+extern boolean_t       pmap_is_modified(ppnum_t pn);
 
 /*
  *     Routines that operate on ranges of virtual addresses.
 
 /*
  *     Routines that operate on ranges of virtual addresses.
@@ -391,8 +408,9 @@ extern void         pmap_change_wiring(     /* Specify pageability */
 
 extern void            pmap_remove(    /* Remove mappings. */
                                pmap_t          map,
 
 extern void            pmap_remove(    /* Remove mappings. */
                                pmap_t          map,
-                               vm_offset_t     s,
-                               vm_offset_t     e);
+                               addr64_t        s,
+                               addr64_t        e);
+
 
 #endif  /* __APPLE_API_PRIVATE */
 
 
 #endif  /* __APPLE_API_PRIVATE */