+#if (defined(__i386__) || defined(__x86_64__)) && NCOPY_WINDOWS > 0
+ /*
+ * Create and initialize the copy window for processor 0
+ * This also allocates window space for all other processors.
+ * However, this is dependent on the number of processors - so this call
+ * must be after IOKit has been started because IOKit performs processor
+ * discovery.
+ */
+ cpu_userwindow_init(0);
+#endif
+
+#if (!defined(__i386__) && !defined(__x86_64__))
+ if (turn_on_log_leaks && !new_nkdbufs)
+ new_nkdbufs = 200000;
+ start_kern_tracing(new_nkdbufs);
+ if (turn_on_log_leaks)
+ log_leaks = 1;
+#endif
+
+ /*
+ * Initialize the shared region module.
+ */
+ vm_shared_region_init();
+ vm_commpage_init();
+ vm_commpage_text_init();
+
+#if CONFIG_MACF
+ mac_policy_initmach();
+#endif
+
+ /*
+ * Initialize the global used for permuting kernel
+ * addresses that may be exported to userland as tokens
+ * using VM_KERNEL_ADDRPERM(). Force the random number
+ * to be odd to avoid mapping a non-zero
+ * word-aligned address to zero via addition.
+ */
+ vm_kernel_addrperm = (vm_offset_t)early_random() | 1;