]> git.saurik.com Git - apple/xnu.git/blobdiff - libkern/kxld/kxld_util.h
xnu-4570.1.46.tar.gz
[apple/xnu.git] / libkern / kxld / kxld_util.h
index 9d5720f043a0377179350a39217f532515ce636d..d8be6faefc539607208393c7ce7605c2cf6cb9aa 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 */
@@ -191,7 +196,7 @@ boolean_t kxld_is_32_bit(cpu_type_t)
     __attribute__((const, visibility("hidden")));
 
 const char * kxld_strstr(const char *s, const char *find)
-    __attribute__((pure, nonnull, visibility("hidden")));
+    __attribute__((pure, visibility("hidden")));
 
 /*******************************************************************************
 * Debugging
@@ -200,4 +205,17 @@ 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);
+
+#if SPLIT_KEXTS_DEBUG
+void kxld_show_split_info(splitKextLinkInfo *info);
+#endif
+
 #endif /* _KXLD_UTIL_H_ */