这篇教程C++ tbase_get_deferrable函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中tbase_get_deferrable函数的典型用法代码示例。如果您正苦于以下问题:C++ tbase_get_deferrable函数的具体用法?C++ tbase_get_deferrable怎么用?C++ tbase_get_deferrable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了tbase_get_deferrable函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: init_timers_cpustatic int __cpuinit init_timers_cpu(int cpu){ int j; struct tvec_base *base; static char __cpuinitdata tvec_base_done[NR_CPUS]; if (!tvec_base_done[cpu]) { static char boot_done; if (boot_done) { /* * The APs use this path later in boot */ base = kmalloc_node(sizeof(*base), GFP_KERNEL | __GFP_ZERO, cpu_to_node(cpu)); if (!base) return -ENOMEM; /* Make sure that tvec_base is 2 byte aligned */ if (tbase_get_deferrable(base)) { WARN_ON(1); kfree(base); return -ENOMEM; } per_cpu(tvec_bases, cpu) = base; } else { /* * This is for the boot CPU - we use compile-time * static initialisation because per-cpu memory isn't * ready yet and because the memory allocators are not * initialised either. */ boot_done = 1; base = &boot_tvec_bases; per_cpu(tvec_bases, cpu) = base; } tvec_base_done[cpu] = 1; } else { base = per_cpu(tvec_bases, cpu); } spin_lock_init(&base->lock); for (j = 0; j < TVN_SIZE; j++) { INIT_LIST_HEAD(base->tv5.vec + j); INIT_LIST_HEAD(base->tv4.vec + j); INIT_LIST_HEAD(base->tv3.vec + j); INIT_LIST_HEAD(base->tv2.vec + j); } for (j = 0; j < TVR_SIZE; j++) INIT_LIST_HEAD(base->tv1.vec + j); base->timer_jiffies = jiffies; base->next_timer = base->timer_jiffies; base->active_timers = 0; return 0;}
开发者ID:goumuli,项目名称:GridOS,代码行数:58,
示例2: detach_if_pendingstatic int detach_if_pending(struct timer_list *timer, struct tvec_base *base, bool clear_pending){ if (!timer_pending(timer)) return 0; detach_timer(timer, clear_pending); if (!tbase_get_deferrable(timer->base)) { base->active_timers--; if (timer->expires == base->next_timer) base->next_timer = base->timer_jiffies; } return 1;}
开发者ID:goumuli,项目名称:GridOS,代码行数:14,
示例3: detach_expired_timerstatic inline void detach_expired_timer(struct timer_list *timer, struct tvec_base *base){ detach_timer(timer, true); if (!tbase_get_deferrable(timer->base)) base->active_timers--;}
开发者ID:goumuli,项目名称:GridOS,代码行数:6,
注:本文中的tbase_get_deferrable函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ tboot_shutdown函数代码示例 C++ tb_trace_noimpl函数代码示例 |