コード例 #1
0
int static_node_info_init()
{
	krg_static_node_info_t *static_node_info;

	register_io_linker(STATIC_NODE_INFO_LINKER,
			   &static_node_info_io_linker);

	/* Create the static node info kddm set */

	static_node_info_kddm_set =
		create_new_kddm_set(kddm_def_ns,
				    STATIC_NODE_INFO_KDDM_ID,
				    STATIC_NODE_INFO_LINKER,
				    KDDM_CUSTOM_DEF_OWNER,
				    sizeof(krg_static_node_info_t),
				    0);
	if (IS_ERR(static_node_info_kddm_set))
		OOM;

	static_node_info = _kddm_grab_object(static_node_info_kddm_set,
					     kerrighed_node_id);

	static_node_info->nr_cpu = num_online_cpus();
	static_node_info->totalram = totalram_pages;
	static_node_info->totalhigh = totalhigh_pages;

	_kddm_put_object(static_node_info_kddm_set, kerrighed_node_id);

	return 0;
}
コード例 #2
0
void epm_pid_start(void)
{
	unsigned long cache_flags = SLAB_PANIC;

#ifdef CONFIG_DEBUG_SLAB
	cache_flags |= SLAB_POISON;
#endif
	pid_kddm_obj_cachep = KMEM_CACHE(pid_kddm_object, cache_flags);

	INIT_WORK(&put_pid_work, put_pid_worker);

	register_io_linker(PID_LINKER, &pid_io_linker);
	pid_kddm_set = create_new_kddm_set(kddm_def_ns,
					   PID_KDDM_ID,
					   PID_LINKER,
					   KDDM_CUSTOM_DEF_OWNER,
					   0, 0);
	if (IS_ERR(pid_kddm_set))
		OOM;

	rpc_register_int(PROC_RESERVE_PID, handle_reserve_pid, 0);
	rpc_register_int(PROC_PID_LINK_TASK, handle_pid_link_task, 0);
	rpc_register_int(PROC_END_PID_RESERVATION,
			 handle_end_pid_reservation, 0);
}
コード例 #3
0
/**
 * @author David Margery
 * @author Pascal Gallard (update to kddm architecture)
 * @author Louis Rilling (split files)
 */
void proc_task_start(void)
{
	unsigned long cache_flags = SLAB_PANIC;

#ifdef CONFIG_DEBUG_SLAB
	cache_flags |= SLAB_POISON;
#endif
	task_kddm_obj_cachep = KMEM_CACHE(task_kddm_object, cache_flags);

	register_io_linker(TASK_LINKER, &task_io_linker);

	task_kddm_set = create_new_kddm_set(kddm_def_ns, TASK_KDDM_ID,
					    TASK_LINKER,
					    KDDM_CUSTOM_DEF_OWNER,
					    0, 0);
	if (IS_ERR(task_kddm_set))
		OOM;

}
コード例 #4
0
int static_cpu_info_init(void)
{
	krg_static_cpu_info_t *static_cpu_info;
	int cpu_id, i;

	register_io_linker(STATIC_CPU_INFO_LINKER, &static_cpu_info_io_linker);

	/* Create the CPU info kddm set */

	static_cpu_info_kddm_set =
		create_new_kddm_set(kddm_def_ns,
				    STATIC_CPU_INFO_KDDM_ID,
				    STATIC_CPU_INFO_LINKER,
				    KDDM_CUSTOM_DEF_OWNER,
				    sizeof(krg_static_cpu_info_t),
				    0);
	if (IS_ERR(static_cpu_info_kddm_set))
		OOM;

	for_each_online_cpu (i) {
		cpu_id = krg_cpu_id(i);
		cpu_data(i).krg_cpu_id = cpu_id;

		static_cpu_info =
			_kddm_grab_object(static_cpu_info_kddm_set, cpu_id);

		static_cpu_info->info = cpu_data(i);
#ifndef CONFIG_USERMODE
		static_cpu_info->info.cpu_khz = cpu_khz;
#endif

		_kddm_put_object(static_cpu_info_kddm_set, cpu_id);
	}

	return 0;
}
コード例 #5
0
int krg_shm_init_ns(struct ipc_namespace *ns)
{
	int r;

	struct krgipc_ops *shm_ops = kmalloc(sizeof(struct krgipc_ops),
					     GFP_KERNEL);
	if (!shm_ops) {
		r = -ENOMEM;
		goto err;
	}

	shm_ops->map_kddm_set = create_new_kddm_set(kddm_def_ns,
						    SHMMAP_KDDM_ID,
						    IPCMAP_LINKER,
						    KDDM_RR_DEF_OWNER,
						    sizeof(ipcmap_object_t),
						    KDDM_LOCAL_EXCLUSIVE);
	if (IS_ERR(shm_ops->map_kddm_set)) {
		r = PTR_ERR(shm_ops->map_kddm_set);
		goto err_map;
	}

	shm_ops->key_kddm_set = create_new_kddm_set(kddm_def_ns,
						    SHMKEY_KDDM_ID,
						    SHMKEY_LINKER,
						    KDDM_RR_DEF_OWNER,
						    sizeof(long),
						    KDDM_LOCAL_EXCLUSIVE);
	if (IS_ERR(shm_ops->key_kddm_set)) {
		r = PTR_ERR(shm_ops->key_kddm_set);
		goto err_key;
	}

	shm_ops->data_kddm_set = create_new_kddm_set(kddm_def_ns,
						     SHMID_KDDM_ID,
						     SHMID_LINKER,
						     KDDM_RR_DEF_OWNER,
						     sizeof(shmid_object_t),
						     KDDM_LOCAL_EXCLUSIVE
						     | KDDM_NEED_SAFE_WALK);
	if (IS_ERR(shm_ops->data_kddm_set)) {
		r = PTR_ERR(shm_ops->data_kddm_set);
		goto err_data;
	}

	shm_ops->ipc_lock = kcb_ipc_shm_lock;
	shm_ops->ipc_unlock = kcb_ipc_shm_unlock;
	shm_ops->ipc_findkey = kcb_ipc_shm_findkey;

	shm_ids(ns).krgops = shm_ops;

	return 0;

err_data:
	_destroy_kddm_set(shm_ops->key_kddm_set);
err_key:
	_destroy_kddm_set(shm_ops->map_kddm_set);
err_map:
	kfree(shm_ops);
err:
	return r;
}