]> git.saurik.com Git - apple/xnu.git/blobdiff - libkern/kxld/kxld_util.h
xnu-3247.1.106.tar.gz
[apple/xnu.git] / libkern / kxld / kxld_util.h
index 9d5720f043a0377179350a39217f532515ce636d..f20bc18e2f15f02714b2739033709b7c4053fc84 100644 (file)
 #ifndef _KXLD_UTIL_H_
 #define _KXLD_UTIL_H_
 
-#include <mach/machine.h>
 #include <sys/types.h>
 #if KERNEL
     #include <libkern/kxld_types.h>
+    #include <mach/machine.h>
 #else
     #include <architecture/byte_order.h>
     #include "kxld_types.h"
+
+    /* Get machine.h from the kernel source so we can support all platforms
+     * that the kernel supports. Otherwise we're at the mercy of the host.
+     */
+    #include "../../osfmk/mach/machine.h"
 #endif
 
 /* 64-bit helpers */
@@ -200,4 +205,14 @@ const char * kxld_strstr(const char *s, const char *find)
 void kxld_print_memory_report(void) 
     __attribute__((visibility("hidden")));
 
+/*******************************************************************************
+* Cross Linking
+*******************************************************************************/
+#if !KERNEL
+boolean_t kxld_set_cross_link_page_size(kxld_size_t target_page_size);
+#endif /* !KERNEL */
+kxld_size_t kxld_get_effective_page_size(void);
+kxld_addr_t kxld_round_page_cross_safe(kxld_addr_t addr);
+
+
 #endif /* _KXLD_UTIL_H_ */