Exemplo n.º 1
0
Arquivo: ipc_init.c Projeto: ctos/bpi
void
ipc_bootstrap(void)
{
	kern_return_t kr;

	ipc_port_multiple_lock_init();

	ipc_port_timestamp_lock_init();
	ipc_port_timestamp_data = 0;

	ipc_space_zone = zinit(sizeof(struct ipc_space), 0,
			       ipc_space_max * sizeof(struct ipc_space),
			       sizeof(struct ipc_space),
			       IPC_ZONE_TYPE, "ipc spaces");

	ipc_tree_entry_zone =
		zinit(sizeof(struct ipc_tree_entry), 0,
			ipc_tree_entry_max * sizeof(struct ipc_tree_entry),
			sizeof(struct ipc_tree_entry),
			IPC_ZONE_TYPE, "ipc tree entries");

	ipc_object_zones[IOT_PORT] =
		zinit(sizeof(struct ipc_port), 0,
		      ipc_port_max * sizeof(struct ipc_port),
		      sizeof(struct ipc_port),
		      0, "ipc ports");

	ipc_object_zones[IOT_PORT_SET] =
		zinit(sizeof(struct ipc_pset), 0,
		      ipc_pset_max * sizeof(struct ipc_pset),
		      sizeof(struct ipc_pset),
		      IPC_ZONE_TYPE, "ipc port sets");

	/* create special spaces */

	kr = ipc_space_create_special(&ipc_space_kernel);
	assert(kr == KERN_SUCCESS);

	kr = ipc_space_create_special(&ipc_space_reply);
	assert(kr == KERN_SUCCESS);

	/* initialize modules with hidden data structures */

	ipc_table_init();
	ipc_notify_init();
	ipc_hash_init();
	ipc_marequest_init();
}
Exemplo n.º 2
0
void
ipc_bootstrap(void)
{
	kern_return_t kr;

	ipc_port_multiple_lock_init();

	ipc_port_timestamp_lock_init();
	ipc_port_timestamp_data = 0;

	kmem_cache_init(&ipc_space_cache, "ipc_space",
			sizeof(struct ipc_space), 0, NULL, 0);

	kmem_cache_init(&ipc_entry_cache, "ipc_entry",
			sizeof(struct ipc_entry), 0, NULL, 0);

	kmem_cache_init(&ipc_object_caches[IOT_PORT], "ipc_port",
			sizeof(struct ipc_port), 0, NULL, 0);

	kmem_cache_init(&ipc_object_caches[IOT_PORT_SET], "ipc_pset",
			sizeof(struct ipc_pset), 0, NULL, 0);

	/* create special spaces */

	kr = ipc_space_create_special(&ipc_space_kernel);
	assert(kr == KERN_SUCCESS);

	kr = ipc_space_create_special(&ipc_space_reply);
	assert(kr == KERN_SUCCESS);

	/* initialize modules with hidden data structures */

	ipc_table_init();
	ipc_notify_init();
	ipc_marequest_init();
}