• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ plist_head_init函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中plist_head_init函数的典型用法代码示例。如果您正苦于以下问题:C++ plist_head_init函数的具体用法?C++ plist_head_init怎么用?C++ plist_head_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了plist_head_init函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: init_rt_rq

void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq)
{
	struct rt_prio_array *array;
	int i;

	array = &rt_rq->active;
	for (i = 0; i < MAX_RT_PRIO; i++) {
		INIT_LIST_HEAD(array->queue + i);
		__clear_bit(i, array->bitmap);
	}
	/* delimiter for bitsearch: */
	__set_bit(MAX_RT_PRIO, array->bitmap);

#if defined CONFIG_SMP
	rt_rq->highest_prio.curr = MAX_RT_PRIO;
	rt_rq->highest_prio.next = MAX_RT_PRIO;
	rt_rq->rt_nr_migratory = 0;
	rt_rq->overloaded = 0;
	plist_head_init(&rt_rq->pushable_tasks);
#endif

	rt_rq->rt_time = 0;
	rt_rq->rt_throttled = 0;
	rt_rq->rt_runtime = 0;
	raw_spin_lock_init(&rt_rq->rt_runtime_lock);
}
开发者ID:yumusic,项目名称:OS-hmwk4,代码行数:26,代码来源:rt.c


示例2: rt_mutex_init_task

static void rt_mutex_init_task(struct task_struct *p)
{
	spin_lock_init(&p->pi_lock);
#ifdef CONFIG_RT_MUTEXES
	plist_head_init(&p->pi_waiters, &p->pi_lock);
	p->pi_blocked_on = NULL;
#endif
}
开发者ID:genua,项目名称:anoubis_os,代码行数:8,代码来源:fork.c


示例3: __rt_mutex_init

/**
 * __rt_mutex_init - initialize the rt lock
 *
 * @lock: the rt lock to be initialized
 *
 * Initialize the rt lock to unlocked state.
 *
 * Initializing of a locked rt lock is not allowed
 */
void __rt_mutex_init(struct rt_mutex *lock, const char *name)
{
	lock->owner = NULL;
	raw_spin_lock_init(&lock->wait_lock);
	plist_head_init(&lock->wait_list);

	debug_rt_mutex_init(lock, name);
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:17,代码来源:rtmutex.c


示例4: init_lists

/*
 * we initialize the wait_list runtime. (Could be done build-time and/or
 * boot-time.)
 */
static inline void init_lists(struct rt_mutex *lock)
{
	if (unlikely(!lock->wait_list.prio_list.prev)) {
		plist_head_init(&lock->wait_list, &lock->wait_lock);
#ifdef CONFIG_DEBUG_RT_MUTEXES
		pi_initialized++;
#endif
	}
}
开发者ID:mrtos,项目名称:Logitech-Revue,代码行数:13,代码来源:rtmutex.c


示例5: kmalloc

void *mm_core_init(struct mm_common *mm_common, \
		const char *mm_dev_name, \
		MM_CORE_HW_IFC *core_params)
{
	struct mm_core *core_dev = NULL;

	if (validate(core_params))
		goto err_register2;

	core_dev = kmalloc(sizeof(struct mm_core), GFP_KERNEL);
	if (core_dev == NULL) {
		pr_err("mm_core_init: kmalloc failed\n");
		goto err_register;
	}
	memset(core_dev, 0, sizeof(struct mm_core));

	/* Init structure */
	INIT_WORK(&(core_dev->job_scheduler), mm_fmwk_job_scheduler);
	plist_head_init(&(core_dev->job_list));
	core_dev->device_job_id = 1;
	core_dev->mm_core_idle = true;
	core_dev->mm_core_is_on = false;

	core_dev->mm_common = mm_common;

	/* Map the dev registers */
	if (core_params->mm_hw_size) {
		core_dev->dev_base = (void __iomem *)ioremap_nocache(\
						core_params->mm_base_addr, \
						core_params->mm_hw_size);
		if (core_dev->dev_base == NULL) {
			pr_err("register mapping failed ");
			goto err_register;
			}
		/* core_params is known to device, device can make use of KVA */
		core_params->mm_virt_addr = (void *)core_dev->dev_base;
		}
	core_params->mm_update_virt_addr(core_params->mm_virt_addr);
	core_dev->mm_device = *core_params;
	if (core_params->mm_version_init != NULL) {
		mm_core_enable_clock(core_dev);
		core_params->mm_version_init(core_params->mm_device_id,
					     core_params->mm_virt_addr,
					     &mm_common->version_info);
		mm_core_disable_clock(core_dev);
	}

	return core_dev;

err_register:
	pr_err("Error in core_init for %s", mm_dev_name);
	if (core_dev)
		mm_core_exit(core_dev);
err_register2:
	return NULL;
}
开发者ID:birey,项目名称:android_kernel_samsung_kyleproxx,代码行数:56,代码来源:mm_core.c


示例6: init_rt_rq

// ARM10C 20140830
// [pcp0] &rq->rt: &(&runqueues)->rt, rq: (&runqueues)
void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq)
{
	struct rt_prio_array *array;
	int i;

	// &rt_rq->active: (&(&runqueues)->rt)->active
	array = &rt_rq->active;
	// array: (&(&runqueues)->rt)->active

	// MAX_RT_PRIO: 100
	for (i = 0; i < MAX_RT_PRIO; i++) {
		// i: 0, array->queue: (&(&(&runqueues)->rt)->active)->queue
		INIT_LIST_HEAD(array->queue + i);
		// (&(&(&runqueues)->rt)->active)->queue[0] 의 리스트 초기화

		// i: 0, array->bitmap: (&(&(&runqueues)->rt)->active)->bitmap
		__clear_bit(i, array->bitmap);
		// (&(&(&runqueues)->rt)->active)->bitmap의 0 bit를 클리어

		// i: 1 ... 99 까지 수행
	}

	/* delimiter for bitsearch: */
	// MAX_RT_PRIO: 100, array->bitmap: (&(&(&runqueues)->rt)->active)->bitmap
	__set_bit(MAX_RT_PRIO, array->bitmap);
	// (&(&(&runqueues)->rt)->active)->bitmap의 100 bit를 1로 세팅

#if defined CONFIG_SMP // CONFIG_SMP=y
	// &rt_rq->highest_prio.curr: (&(&runqueues)->rt)->highest_prio.curr, MAX_RT_PRIO: 100
	rt_rq->highest_prio.curr = MAX_RT_PRIO;
	// &rt_rq->highest_prio.curr: (&(&runqueues)->rt)->highest_prio.curr: 100

	// &rt_rq->highest_prio.next: (&(&runqueues)->rt)->highest_prio.next, MAX_RT_PRIO: 100
	rt_rq->highest_prio.next = MAX_RT_PRIO;
	// &rt_rq->highest_prio.next: (&(&runqueues)->rt)->highest_prio.next: 100

	// &rt_rq->rt_nr_migratory: (&(&runqueues)->rt)->rt_nr_migratory
	rt_rq->rt_nr_migratory = 0;
	// &rt_rq->rt_nr_migratory: (&(&runqueues)->rt)->rt_nr_migratory: 0

	// &rt_rq->overloaded: (&(&runqueues)->rt)->overloaded
	rt_rq->overloaded = 0;
	// &rt_rq->overloaded: (&(&runqueues)->rt)->overloaded: 0

	// &rt_rq->pushable_tasks: &(&(&runqueues)->rt)->pushable_tasks
	plist_head_init(&rt_rq->pushable_tasks);
	// (&(&(&runqueues)->rt)->pushable_tasks)->node_list 리스트 초기화
#endif

	// &rt_rq->rt_time: (&(&runqueues)->rt)->rt_time
	rt_rq->rt_time = 0;
	// &rt_rq->rt_time: (&(&runqueues)->rt)->rt_time: 0

	// &rt_rq->rt_throttled: (&(&runqueues)->rt)->rt_throttled
	rt_rq->rt_throttled = 0;
	// &rt_rq->rt_throttled: (&(&runqueues)->rt)->rt_throttled: 0

	// &rt_rq->rt_runtime: (&(&runqueues)->rt)->rt_runtime
	rt_rq->rt_runtime = 0;
	// &rt_rq->rt_runtime: (&(&runqueues)->rt)->rt_runtime: 0

	// &rt_rq->rt_runtime_lock: (&(&runqueues)->rt)->rt_runtime_lock
	raw_spin_lock_init(&rt_rq->rt_runtime_lock);
	// (&(&runqueues)->rt)->rt_runtime_lock 을 사용한 spinlock 초기화
}
开发者ID:BozkurTR,项目名称:kernel,代码行数:67,代码来源:rt.c


示例7: kona_memc_probe

static int kona_memc_probe(struct platform_device *pdev)
{
	u32 val, *addr;
	int size, ret;
	struct resource *iomem;
	struct kona_memc_pdata *pdata;
	spin_lock_init(&kona_memc.memc_lock);
	plist_head_init(&kona_memc.min_pwr_list);
	kona_memc.active_min_pwr = 0;

	if (pdev->dev.platform_data)
		pdata =	(struct kona_memc_pdata *)pdev->dev.platform_data;
	else if (pdev->dev.of_node) {
		pdata = kzalloc(sizeof(struct kona_memc_pdata),	GFP_KERNEL);

		if (!pdata)
			return -ENOMEM;

		/* Get register memory resource */
		iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
		if (!iomem) {
			pr_info("no mem resource\n");
			kfree(pdata);
			return -ENODEV;
		}
		pdata->memc0_ns_base = (u32)ioremap(iomem->start,
				resource_size(iomem));
		if (!pdata->memc0_ns_base) {
			pr_info("unable to map in registers\n");
			kfree(pdata);
			return -ENOMEM;
		}

		addr = (u32 *)of_get_property(pdev->dev.of_node, "chipreg_base",
				&size);
		if (!addr) {
			kfree(pdata);
			return -EINVAL;
		}
		val = *(addr + 1);
		pdata->chipreg_base = (u32)ioremap(be32_to_cpu(*addr),
				be32_to_cpu(val));

		addr = (u32 *)of_get_property(pdev->dev.of_node,
				"memc0_aphy_base", &size);
		if (!addr) {
			kfree(pdata);
			return -EINVAL;
		}
		val = *(addr + 1);
		pdata->memc0_aphy_base = (u32)ioremap(be32_to_cpu(*addr),
				be32_to_cpu(val));


		ret = of_property_read_u32(pdev->dev.of_node,
				"seq_busy_val", &val);
		if (ret != 0) {
			kfree(pdata);
			return -EINVAL;
		}
		pdata->seq_busy_val = val;

		if (of_property_read_u32(pdev->dev.of_node,
					"flags", &val)) {
			kfree(pdata);
			return -EINVAL;
		}
		pdata->flags = val;

		if (of_property_read_u32(pdev->dev.of_node,
					"max_pwr", &val)) {
			kfree(pdata);
			return -EINVAL;
		}
		pdata->max_pwr = val;

	} else {
		pr_info("%s: no platform data found\n", __func__);
		return -EINVAL;
	}

	kona_memc.pdata = pdata;
	kona_memc.memc0_ns_base = pdata->memc0_ns_base;
	kona_memc.chipreg_base = pdata->chipreg_base;
	kona_memc.memc0_aphy_base = pdata->memc0_aphy_base;
	memc_init(&kona_memc);
	pr_info("%s: ddr freq = %lu\n", __func__,
			compute_ddr_clk_freq(&kona_memc));
	return 0;
}
开发者ID:ASAZING,项目名称:Android-Kernel-Gt-s7390l,代码行数:90,代码来源:kona_memc.c



注:本文中的plist_head_init函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ plist_new_dict函数代码示例发布时间:2022-05-30
下一篇:
C++ plist_get_string_val函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap