*/
#include <mach_debug.h>
-#include <mach_rt.h>
#include <mach/port.h>
#include <mach/message.h>
#include <kern/kern_types.h>
#include <kern/kalloc.h>
+#include <kern/simple_lock.h>
#include <kern/mach_param.h>
#include <kern/ipc_host.h>
#include <kern/ipc_mig.h>
#include <kern/misc_protos.h>
#include <kern/sync_lock.h>
#include <kern/sync_sema.h>
+#include <kern/ux_handler.h>
#include <vm/vm_map.h>
#include <vm/vm_kern.h>
#include <ipc/ipc_hash.h>
#include <ipc/ipc_init.h>
#include <ipc/ipc_table.h>
+#include <ipc/ipc_voucher.h>
+#include <ipc/ipc_importance.h>
#include <mach/machine/ndr_def.h> /* NDR_record */
-#include <ipc/ipc_labelh.h>
vm_map_t ipc_kernel_map;
vm_size_t ipc_kernel_map_size = 1024 * 1024;
static lck_grp_attr_t ipc_lck_grp_attr;
-extern void ikm_cache_init(void);
-
/*
* Routine: ipc_bootstrap
* Purpose:
IKM_SAVED_KMSG_SIZE,
"ipc kmsgs");
zone_change(ipc_kmsg_zone, Z_CALLERACCT, FALSE);
-
-#if CONFIG_MACF_MACH
- ipc_labelh_zone =
- zinit(sizeof(struct ipc_labelh),
- ipc_port_max * sizeof(struct ipc_labelh),
- sizeof(struct ipc_labelh),
- "label handles");
- /* cant charge callers for label allocations (port refs passed) */
- zone_change(ipc_labelh_zone, Z_CALLERACCT, FALSE);
-
-#endif
+ zone_change(ipc_kmsg_zone, Z_CACHING_ENABLED, TRUE);
/* create special spaces */
#endif
mig_init();
ipc_table_init();
+ ipc_voucher_init();
+
+#if IMPORTANCE_INHERITANCE
+ ipc_importance_init();
+#endif
semaphore_init();
mk_timer_init();
/*
* XXX tunable, belongs in mach.message.h
*/
-#define MSG_OOL_SIZE_SMALL_MAX 4096
+#define MSG_OOL_SIZE_SMALL_MAX (2*PAGE_SIZE)
vm_size_t msg_ool_size_small;
/*
vm_offset_t min;
retval = kmem_suballoc(kernel_map, &min, ipc_kernel_map_size,
- TRUE, VM_FLAGS_ANYWHERE, &ipc_kernel_map);
+ TRUE,
+ (VM_FLAGS_ANYWHERE),
+ VM_MAP_KERNEL_FLAGS_NONE,
+ VM_KERN_MEMORY_IPC,
+ &ipc_kernel_map);
if (retval != KERN_SUCCESS)
panic("ipc_init: kmem_suballoc of ipc_kernel_map failed");
retval = kmem_suballoc(kernel_map, &min, ipc_kernel_copy_map_size,
- TRUE, VM_FLAGS_ANYWHERE, &ipc_kernel_copy_map);
+ TRUE,
+ (VM_FLAGS_ANYWHERE),
+ VM_MAP_KERNEL_FLAGS_NONE,
+ VM_KERN_MEMORY_IPC,
+ &ipc_kernel_copy_map);
if (retval != KERN_SUCCESS)
panic("ipc_init: kmem_suballoc of ipc_kernel_copy_map failed");
else {
msg_ool_size_small = MSG_OOL_SIZE_SMALL_MAX;
}
+ /* account for overhead to avoid spilling over a page */
+ msg_ool_size_small -= cpy_kdata_hdr_sz;
ipc_host_init();
+ ux_handler_init();
+
+}
+
+
+/*
+ * Routine: ipc_thread_call_init
+ * Purpose:
+ * Initialize IPC logic that needs thread call support
+ */
+
+void
+ipc_thread_call_init(void)
+{
+#if IMPORTANCE_INHERITANCE
+ ipc_importance_thread_call_init();
+#endif
}
+