]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/vm/pmap.h
xnu-517.11.1.tar.gz
[apple/xnu.git] / osfmk / vm / pmap.h
index 26337c7e7c589adb4c22bc1442f6438695bc1f1d..1609c8cb27ee91819090f68a4251fc99118feb64 100644 (file)
  *     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;
@@ -138,7 +152,7 @@ extern void         pmap_init(void);        /* Initialization,
  *     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.
@@ -165,14 +179,14 @@ extern void               pmap_switch(pmap_t);
 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_offset_t     pa);
+                               ppnum_t         pn);
 
 
 /*
@@ -180,36 +194,36 @@ extern void               pmap_remove_some_phys(
  */
 
 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_offset_t     phys);
+                               ppnum_t         pn);
 
 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     src,
-                               vm_offset_t     dest);
+                               ppnum_t         src,
+                               ppnum_t         dest);
 
 extern void            (pmap_copy_part_page)(
-                               vm_offset_t     src,
+                               ppnum_t         src,
                                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,
+                               ppnum_t         dst,
                                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);
@@ -218,7 +232,7 @@ extern void         (pmap_copy_part_rpage)(
  * 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
@@ -266,8 +280,8 @@ extern kern_return_t        (pmap_attribute)(       /* Get/Set special memory
 
 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);
@@ -314,7 +328,7 @@ extern kern_return_t        (pmap_attribute_cache_sync)(  /* Flush appropriate
                pmap_enter(                                     \
                        (pmap),                                 \
                        (virtual_address),                      \
-                       (page)->phys_addr,                      \
+                       (page)->phys_page,                      \
                        (protection) & ~(page)->page_lock,      \
                        flags,                                  \
                        (wired)                                 \
@@ -328,15 +342,15 @@ extern kern_return_t      (pmap_attribute_cache_sync)(  /* Flush appropriate
  *     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 */
-extern boolean_t       (pmap_is_referenced)(vm_offset_t paddr);
+extern boolean_t       (pmap_is_referenced)(ppnum_t     pn);
                                /* Set modify bit */
-extern void             pmap_set_modify(vm_offset_t paddr);
+extern void             pmap_set_modify(ppnum_t         pn);
                                /* Clear modify bit */
-extern void            pmap_clear_modify(vm_offset_t paddr);
+extern void            pmap_clear_modify(ppnum_t pn);
                                /* 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.
@@ -391,8 +405,9 @@ extern void         pmap_change_wiring(     /* Specify pageability */
 
 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 */