您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ tick_broadcast_start_periodic函数代码示例

51自学网 2021-06-03 08:49:52
  C++
这篇教程C++ tick_broadcast_start_periodic函数代码示例写得很实用,希望能帮到您。

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

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

示例1: tick_resume_broadcast

void tick_resume_broadcast(void){	struct clock_event_device *bc;	unsigned long flags;	raw_spin_lock_irqsave(&tick_broadcast_lock, flags);	bc = tick_broadcast_device.evtdev;	if (bc) {		clockevents_tick_resume(bc);		switch (tick_broadcast_device.mode) {		case TICKDEV_MODE_PERIODIC:			if (!cpumask_empty(tick_broadcast_mask))				tick_broadcast_start_periodic(bc);			break;		case TICKDEV_MODE_ONESHOT:			if (!cpumask_empty(tick_broadcast_mask))				tick_resume_broadcast_oneshot(bc);			break;		}	}	raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);}
开发者ID:markus-oberhumer,项目名称:linux,代码行数:25,


示例2: tick_install_broadcast_device

/* * Conditionally install/replace broadcast device */void tick_install_broadcast_device(struct clock_event_device *dev){	struct clock_event_device *cur = tick_broadcast_device.evtdev;	if (!tick_check_broadcast_device(cur, dev))		return;	if (!try_module_get(dev->owner))		return;	clockevents_exchange_device(cur, dev);	if (cur)		cur->event_handler = clockevents_handle_noop;	tick_broadcast_device.evtdev = dev;	if (!cpumask_empty(tick_broadcast_mask))		tick_broadcast_start_periodic(dev);	/*	 * Inform all cpus about this. We might be in a situation	 * where we did not switch to oneshot mode because the per cpu	 * devices are affected by CLOCK_EVT_FEAT_C3STOP and the lack	 * of a oneshot capable broadcast device. Without that	 * notification the systems stays stuck in periodic mode	 * forever.	 */	if (dev->features & CLOCK_EVT_FEAT_ONESHOT)		tick_clock_notify();}
开发者ID:markus-oberhumer,项目名称:linux,代码行数:30,


示例3: tick_broadcast_control

/** * tick_broadcast_control - Enable/disable or force broadcast mode * @mode:	The selected broadcast mode * * Called when the system enters a state where affected tick devices * might stop. Note: TICK_BROADCAST_FORCE cannot be undone. * * Called with interrupts disabled, so clockevents_lock is not * required here because the local clock event device cannot go away * under us. */void tick_broadcast_control(enum tick_broadcast_mode mode){	struct clock_event_device *bc, *dev;	struct tick_device *td;	int cpu, bc_stopped;	td = this_cpu_ptr(&tick_cpu_device);	dev = td->evtdev;	/*	 * Is the device not affected by the powerstate ?	 */	if (!dev || !(dev->features & CLOCK_EVT_FEAT_C3STOP))		return;	if (!tick_device_is_functional(dev))		return;	raw_spin_lock(&tick_broadcast_lock);	cpu = smp_processor_id();	bc = tick_broadcast_device.evtdev;	bc_stopped = cpumask_empty(tick_broadcast_mask);	switch (mode) {	case TICK_BROADCAST_FORCE:		tick_broadcast_forced = 1;	case TICK_BROADCAST_ON:		cpumask_set_cpu(cpu, tick_broadcast_on);		if (!cpumask_test_and_set_cpu(cpu, tick_broadcast_mask)) {			if (tick_broadcast_device.mode ==			    TICKDEV_MODE_PERIODIC)				clockevents_shutdown(dev);		}		break;	case TICK_BROADCAST_OFF:		if (tick_broadcast_forced)			break;		cpumask_clear_cpu(cpu, tick_broadcast_on);		if (!tick_device_is_functional(dev))			break;		if (cpumask_test_and_clear_cpu(cpu, tick_broadcast_mask)) {			if (tick_broadcast_device.mode ==			    TICKDEV_MODE_PERIODIC)				tick_setup_periodic(dev, 0);		}		break;	}	if (cpumask_empty(tick_broadcast_mask)) {		if (!bc_stopped)			clockevents_shutdown(bc);	} else if (bc_stopped) {		if (tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC)			tick_broadcast_start_periodic(bc);		else			tick_broadcast_setup_oneshot(bc);	}	raw_spin_unlock(&tick_broadcast_lock);}
开发者ID:19Dan01,项目名称:linux,代码行数:71,


示例4: tick_broadcast_control

/** * tick_broadcast_control - Enable/disable or force broadcast mode * @mode:	The selected broadcast mode * * Called when the system enters a state where affected tick devices * might stop. Note: TICK_BROADCAST_FORCE cannot be undone. */void tick_broadcast_control(enum tick_broadcast_mode mode){	struct clock_event_device *bc, *dev;	struct tick_device *td;	int cpu, bc_stopped;	unsigned long flags;	/* Protects also the local clockevent device. */	raw_spin_lock_irqsave(&tick_broadcast_lock, flags);	td = this_cpu_ptr(&tick_cpu_device);	dev = td->evtdev;	/*	 * Is the device not affected by the powerstate ?	 */	if (!dev || !(dev->features & CLOCK_EVT_FEAT_C3STOP))		goto out;	if (!tick_device_is_functional(dev))		goto out;	cpu = smp_processor_id();	bc = tick_broadcast_device.evtdev;	bc_stopped = cpumask_empty(tick_broadcast_mask);	switch (mode) {	case TICK_BROADCAST_FORCE:		tick_broadcast_forced = 1;	case TICK_BROADCAST_ON:		cpumask_set_cpu(cpu, tick_broadcast_on);		if (!cpumask_test_and_set_cpu(cpu, tick_broadcast_mask)) {			/*			 * Only shutdown the cpu local device, if:			 *			 * - the broadcast device exists			 * - the broadcast device is not a hrtimer based one			 * - the broadcast device is in periodic mode to			 *   avoid a hickup during switch to oneshot mode			 */			if (bc && !(bc->features & CLOCK_EVT_FEAT_HRTIMER) &&			    tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC)				clockevents_shutdown(dev);		}		break;	case TICK_BROADCAST_OFF:		if (tick_broadcast_forced)			break;		cpumask_clear_cpu(cpu, tick_broadcast_on);		if (cpumask_test_and_clear_cpu(cpu, tick_broadcast_mask)) {			if (tick_broadcast_device.mode ==			    TICKDEV_MODE_PERIODIC)				tick_setup_periodic(dev, 0);		}		break;	}	if (bc) {		if (cpumask_empty(tick_broadcast_mask)) {			if (!bc_stopped)				clockevents_shutdown(bc);		} else if (bc_stopped) {			if (tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC)				tick_broadcast_start_periodic(bc);			else				tick_broadcast_setup_oneshot(bc);		}	}out:	raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);}
开发者ID:markus-oberhumer,项目名称:linux,代码行数:78,


示例5: tick_device_uses_broadcast

/* * Check, if the device is disfunctional and a place holder, which * needs to be handled by the broadcast device. */int tick_device_uses_broadcast(struct clock_event_device *dev, int cpu){	struct clock_event_device *bc = tick_broadcast_device.evtdev;	unsigned long flags;	int ret = 0;	raw_spin_lock_irqsave(&tick_broadcast_lock, flags);	/*	 * Devices might be registered with both periodic and oneshot	 * mode disabled. This signals, that the device needs to be	 * operated from the broadcast device and is a placeholder for	 * the cpu local device.	 */	if (!tick_device_is_functional(dev)) {		dev->event_handler = tick_handle_periodic;		tick_device_setup_broadcast_func(dev);		cpumask_set_cpu(cpu, tick_broadcast_mask);		if (tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC)			tick_broadcast_start_periodic(bc);		else			tick_broadcast_setup_oneshot(bc);		ret = 1;	} else {		/*		 * Clear the broadcast bit for this cpu if the		 * device is not power state affected.		 */		if (!(dev->features & CLOCK_EVT_FEAT_C3STOP))			cpumask_clear_cpu(cpu, tick_broadcast_mask);		else			tick_device_setup_broadcast_func(dev);		/*		 * Clear the broadcast bit if the CPU is not in		 * periodic broadcast on state.		 */		if (!cpumask_test_cpu(cpu, tick_broadcast_on))			cpumask_clear_cpu(cpu, tick_broadcast_mask);		switch (tick_broadcast_device.mode) {		case TICKDEV_MODE_ONESHOT:			/*			 * If the system is in oneshot mode we can			 * unconditionally clear the oneshot mask bit,			 * because the CPU is running and therefore			 * not in an idle state which causes the power			 * state affected device to stop. Let the			 * caller initialize the device.			 */			tick_broadcast_clear_oneshot(cpu);			ret = 0;			break;		case TICKDEV_MODE_PERIODIC:			/*			 * If the system is in periodic mode, check			 * whether the broadcast device can be			 * switched off now.			 */			if (cpumask_empty(tick_broadcast_mask) && bc)				clockevents_shutdown(bc);			/*			 * If we kept the cpu in the broadcast mask,			 * tell the caller to leave the per cpu device			 * in shutdown state. The periodic interrupt			 * is delivered by the broadcast device, if			 * the broadcast device exists and is not			 * hrtimer based.			 */			if (bc && !(bc->features & CLOCK_EVT_FEAT_HRTIMER))				ret = cpumask_test_cpu(cpu, tick_broadcast_mask);			break;		default:			break;		}	}	raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);	return ret;}
开发者ID:markus-oberhumer,项目名称:linux,代码行数:84,



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


C++ tick_cancel_sched_timer函数代码示例
C++ tick函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。