]> git.saurik.com Git - apple/xnu.git/blobdiff - libsyscall/mach/mach_init.c
xnu-4903.241.1.tar.gz
[apple/xnu.git] / libsyscall / mach / mach_init.c
index 90a42ceb5e41233668d9fca2e3f93ae51810727e..338f7c95b98376881dd3edcbefc28793ab9107cb 100644 (file)
@@ -115,6 +115,12 @@ _mach_fork_child(void)
        return 0;
 }
 
        return 0;
 }
 
+#if defined(__arm__) || defined(__arm64__)
+#if !defined(_COMM_PAGE_USER_PAGE_SHIFT_64) && defined(_COMM_PAGE_UNUSED0)
+#define _COMM_PAGE_USER_PAGE_SHIFT_32 (_COMM_PAGE_UNUSED0)
+#define _COMM_PAGE_USER_PAGE_SHIFT_64 (_COMM_PAGE_UNUSED0+1)
+#endif
+#endif
 
 void
 mach_init_doit(void)
 
 void
 mach_init_doit(void)
@@ -136,7 +142,13 @@ mach_init_doit(void)
        }
        
        if (vm_page_shift == 0) {
        }
        
        if (vm_page_shift == 0) {
+#if defined(__arm64__)
+               vm_page_shift = *(uint8_t*) _COMM_PAGE_USER_PAGE_SHIFT_64;
+#elif defined(__arm__)
+               vm_page_shift = *(uint8_t*) _COMM_PAGE_USER_PAGE_SHIFT_32;
+#else
                vm_page_shift = vm_kernel_page_shift;
                vm_page_shift = vm_kernel_page_shift;
+#endif
                vm_page_size = 1 << vm_page_shift;
                vm_page_mask = vm_page_size - 1;
        }
                vm_page_size = 1 << vm_page_shift;
                vm_page_mask = vm_page_size - 1;
        }