/*
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include <mach_debug.h>
#include <mach_rt.h>
+#include <mach/port.h>
#include <mach/kern_return.h>
+
+#include <kern/kern_types.h>
+#include <kern/kalloc.h>
#include <kern/mach_param.h>
#include <kern/ipc_host.h>
+#include <kern/ipc_mig.h>
+#include <kern/host_notify.h>
+#include <kern/mk_timer.h>
#include <kern/misc_protos.h>
+#include <kern/sync_lock.h>
+#include <kern/sync_sema.h>
#include <vm/vm_map.h>
#include <vm/vm_kern.h>
+
#include <ipc/ipc_entry.h>
#include <ipc/ipc_space.h>
#include <ipc/ipc_object.h>
#include <ipc/ipc_kmsg.h>
#include <ipc/ipc_hash.h>
#include <ipc/ipc_init.h>
+#include <ipc/ipc_table.h>
+
#include <mach/machine/ndr_def.h> /* NDR_record */
vm_map_t ipc_kernel_map;
int ipc_port_max = PORT_MAX;
int ipc_pset_max = SET_MAX;
-extern void mig_init(void);
extern void ikm_cache_init(void);
/*
/* make it exhaustible */
zone_change(ipc_object_zones[IOT_PORT_SET], Z_EXHAUST, TRUE);
+ /*
+ * Create the basic ipc_kmsg_t zone (the one we also cache)
+ * elements at the processor-level to avoid the locking.
+ */
+ ipc_kmsg_zone = zinit(IKM_SAVED_KMSG_SIZE,
+ ipc_port_max * MACH_PORT_QLIMIT_MAX *
+ IKM_SAVED_KMSG_SIZE,
+ IKM_SAVED_KMSG_SIZE,
+ "ipc kmsgs");
+
/* create special spaces */
kr = ipc_space_create_special(&ipc_space_kernel);
#endif
mig_init();
ipc_table_init();
- ipc_notify_init();
ipc_hash_init();
- ipc_kmsg_init();
semaphore_init();
lock_set_init();
+ mk_timer_init();
+ host_notify_init();
}
/*
ipc_init(void)
{
kern_return_t retval;
- vm_offset_t min, max;
- extern vm_size_t kalloc_max_prerounded;
+ vm_offset_t min;
retval = kmem_suballoc(kernel_map, &min, ipc_kernel_map_size,
- TRUE, TRUE, &ipc_kernel_map);
+ TRUE, VM_FLAGS_ANYWHERE, &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, TRUE, &ipc_kernel_copy_map);
+ TRUE, VM_FLAGS_ANYWHERE, &ipc_kernel_copy_map);
+
if (retval != KERN_SUCCESS)
panic("ipc_init: kmem_suballoc of ipc_kernel_copy_map failed");