X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/316670eb35587141e969394ae8537d66b9211e80..4d15aeb193b2c68f1d38666c317f8d3734f5f083:/osfmk/ipc/ipc_init.c diff --git a/osfmk/ipc/ipc_init.c b/osfmk/ipc/ipc_init.c index 11dd9dafc..d81098ce9 100644 --- a/osfmk/ipc/ipc_init.c +++ b/osfmk/ipc/ipc_init.c @@ -79,6 +79,7 @@ #include #include +#include #include #include #include @@ -100,9 +101,10 @@ #include #include #include +#include +#include #include /* NDR_record */ -#include vm_map_t ipc_kernel_map; vm_size_t ipc_kernel_map_size = 1024 * 1024; @@ -190,17 +192,6 @@ ipc_bootstrap(void) "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 - /* create special spaces */ kr = ipc_space_create_special(&ipc_space_kernel); @@ -217,9 +208,13 @@ ipc_bootstrap(void) #endif mig_init(); ipc_table_init(); + ipc_voucher_init(); + +#if IMPORTANCE_INHERITANCE + ipc_importance_init(); +#endif semaphore_init(); - lock_set_init(); mk_timer_init(); host_notify_init(); } @@ -227,7 +222,7 @@ ipc_bootstrap(void) /* * 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; /* @@ -243,13 +238,13 @@ ipc_init(void) 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_MAKE_TAG(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_MAKE_TAG(VM_KERN_MEMORY_IPC), &ipc_kernel_copy_map); if (retval != KERN_SUCCESS) panic("ipc_init: kmem_suballoc of ipc_kernel_copy_map failed"); @@ -269,6 +264,24 @@ ipc_init(void) 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(); + +} + + +/* + * 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 }