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

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

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

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

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

示例1: __remove_hrtimer

/* * __remove_hrtimer - internal function to remove a timer * * Caller must hold the base lock. * * High resolution timer mode reprograms the clock event device when the * timer is the one which expires next. The caller can disable this by setting * reprogram to zero. This is useful, when the context does a reprogramming * anyway (e.g. timer interrupt) */static void __remove_hrtimer(struct hrtimer *timer,			     struct hrtimer_clock_base *base,			     unsigned long newstate, int reprogram){	struct timerqueue_node *next_timer;	if (!(timer->state & HRTIMER_STATE_ENQUEUED))		goto out;	next_timer = timerqueue_getnext(&base->active);	timerqueue_del(&base->active, &timer->node);	if (&timer->node == next_timer) {#ifdef CONFIG_HIGH_RES_TIMERS		/* Reprogram the clock event device. if enabled */		if (reprogram && hrtimer_hres_active()) {			ktime_t expires;			expires = ktime_sub(hrtimer_get_expires(timer),					    base->offset);			if (base->cpu_base->expires_next.tv64 == expires.tv64)				hrtimer_force_reprogram(base->cpu_base, 1);		}#endif	}	if (!timerqueue_getnext(&base->active))		base->cpu_base->active_bases &= ~(1 << base->index);out:	timer->state = newstate;}
开发者ID:791254467,项目名称:u8500_kernel,代码行数:38,


示例2: hrtimer_run_queues

/* * Called from hardirq context every jiffy */void hrtimer_run_queues(void){	struct timerqueue_node *node;	struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases);	struct hrtimer_clock_base *base;	int index, gettime = 1;	if (hrtimer_hres_active())		return;	for (index = 0; index < HRTIMER_MAX_CLOCK_BASES; index++) {		base = &cpu_base->clock_base[index];		if (!timerqueue_getnext(&base->active))			continue;		if (gettime) {			hrtimer_get_softirq_time(cpu_base);			gettime = 0;		}		raw_spin_lock(&cpu_base->lock);		while ((node = timerqueue_getnext(&base->active))) {			struct hrtimer *timer;			timer = container_of(node, struct hrtimer, node);			if (base->softirq_time.tv64 <=					hrtimer_get_expires_tv64(timer))				break;			__run_hrtimer(timer, &base->softirq_time);		}		raw_spin_unlock(&cpu_base->lock);	}}
开发者ID:791254467,项目名称:u8500_kernel,代码行数:38,


示例3: alarmtimer_remove

/** * alarmtimer_remove - Removes an alarm timer from an alarm_base timerqueue * @base: pointer to the base where the timer is running * @alarm: pointer to alarm being removed * * Removes alarm to a alarm_base timerqueue and if necessary sets * a new timer to run. * * Must hold base->lock when calling. */static void alarmtimer_remove(struct alarm_base *base, struct alarm *alarm){	struct timerqueue_node *next = timerqueue_getnext(&base->timerqueue);	timerqueue_del(&base->timerqueue, &alarm->node);	if (next == &alarm->node) {		hrtimer_try_to_cancel(&base->timer);		next = timerqueue_getnext(&base->timerqueue);		if (!next)			return;		hrtimer_start(&base->timer, next->expires, HRTIMER_MODE_ABS);	}}
开发者ID:303750856,项目名称:linux-3.1,代码行数:23,


示例4: print_active_timers

static voidprint_active_timers(struct seq_file *m, struct hrtimer_clock_base *base,		    u64 now){	struct hrtimer *timer, tmp;	unsigned long next = 0, i;	struct timerqueue_node *curr;	unsigned long flags;next_one:	i = 0;	raw_spin_lock_irqsave(&base->cpu_base->lock, flags);	curr = timerqueue_getnext(&base->active);	/*	 * Crude but we have to do this O(N*N) thing, because	 * we have to unlock the base when printing:	 */	while (curr && i < next) {		curr = timerqueue_iterate_next(curr);		i++;	}	if (curr) {		timer = container_of(curr, struct hrtimer, node);		tmp = *timer;		raw_spin_unlock_irqrestore(&base->cpu_base->lock, flags);		print_timer(m, timer, &tmp, i, now);		next++;		goto next_one;	}	raw_spin_unlock_irqrestore(&base->cpu_base->lock, flags);}
开发者ID:ahmadrezamontazerolghaem,项目名称:VLB-CAC,代码行数:35,


示例5: __hrtimer_get_next_event

static ktime_t __hrtimer_get_next_event(struct hrtimer_cpu_base *cpu_base){	struct hrtimer_clock_base *base = cpu_base->clock_base;	ktime_t expires, expires_next = { .tv64 = KTIME_MAX };	unsigned int active = cpu_base->active_bases;	hrtimer_update_next_timer(cpu_base, NULL);	for (; active; base++, active >>= 1) {		struct timerqueue_node *next;		struct hrtimer *timer;		if (!(active & 0x01))			continue;		next = timerqueue_getnext(&base->active);		timer = container_of(next, struct hrtimer, node);		expires = ktime_sub(hrtimer_get_expires(timer), base->offset);		if (expires.tv64 < expires_next.tv64) {			expires_next = expires;			hrtimer_update_next_timer(cpu_base, timer);		}	}	/*	 * clock_was_set() might have changed base->offset of any of	 * the clock bases so the result might be negative. Fix it up	 * to prevent a false positive in clockevents_program_event().	 */	if (expires_next.tv64 < 0)		expires_next.tv64 = 0;	return expires_next;}
开发者ID:AK101111,项目名称:linux,代码行数:31,


示例6: __hrtimer_get_next_event

ktime_t __hrtimer_get_next_event(struct hrtimer_cpu_base *cpu_base){	struct hrtimer_clock_base *base = cpu_base->clock_base;	ktime_t expires, expires_next = { .tv64 = KTIME_MAX };	int i;	for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++, base++) {		struct timerqueue_node *next;		struct hrtimer *timer;		next = timerqueue_getnext(&base->active);		if (!next)			continue;		timer = container_of(next, struct hrtimer, node);		expires = ktime_sub(hrtimer_get_expires(timer), base->offset);		if (expires.tv64 < expires_next.tv64)			expires_next = expires;	}	/*	 * clock_was_set() might have changed base->offset of any of	 * the clock bases so the result might be negative. Fix it up	 * to prevent a false positive in clockevents_program_event().	 */	if (expires_next.tv64 < 0)		expires_next.tv64 = 0;	return expires_next;}
开发者ID:tiltkoko,项目名称:android_kernel_elephone_p8000,代码行数:28,


示例7: hrtimer_get_next_event

/** * hrtimer_get_next_event - get the time until next expiry event * * Returns the delta to the next expiry event or KTIME_MAX if no timer * is pending. */ktime_t hrtimer_get_next_event(void){	struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases);	struct hrtimer_clock_base *base = cpu_base->clock_base;	ktime_t delta, mindelta = { .tv64 = KTIME_MAX };	unsigned long flags;	int i;	raw_spin_lock_irqsave(&cpu_base->lock, flags);	if (!hrtimer_hres_active()) {		for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++, base++) {			struct hrtimer *timer;			struct timerqueue_node *next;			next = timerqueue_getnext(&base->active);			if (!next)				continue;			timer = container_of(next, struct hrtimer, node);			delta.tv64 = hrtimer_get_expires_tv64(timer);			delta = ktime_sub(delta, base->get_time());			if (delta.tv64 < mindelta.tv64)				mindelta.tv64 = delta.tv64;		}	}	raw_spin_unlock_irqrestore(&cpu_base->lock, flags);	if (mindelta.tv64 < 0)		mindelta.tv64 = 0;	return mindelta;}
开发者ID:RolanDroid,项目名称:lge_MonsterKernel-lproj,代码行数:39,


示例8: migrate_hrtimer_list

static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base,				struct hrtimer_clock_base *new_base){	struct hrtimer *timer;	struct timerqueue_node *node;	while ((node = timerqueue_getnext(&old_base->active))) {		timer = container_of(node, struct hrtimer, node);		BUG_ON(hrtimer_callback_running(timer));		debug_deactivate(timer);		/*		 * Mark it as STATE_MIGRATE not INACTIVE otherwise the		 * timer could be seen as !active and just vanish away		 * under us on another CPU		 */		__remove_hrtimer(timer, old_base, HRTIMER_STATE_MIGRATE, 0);		timer->base = new_base;		/*		 * Enqueue the timers on the new cpu. This does not		 * reprogram the event device in case the timer		 * expires before the earliest on this CPU, but we run		 * hrtimer_interrupt after we migrated everything to		 * sort out already expired timers and reprogram the		 * event device.		 */		enqueue_hrtimer(timer, new_base);		/* Clear the migration state bit */		timer->state &= ~HRTIMER_STATE_MIGRATE;	}}
开发者ID:RolanDroid,项目名称:lge_MonsterKernel-lproj,代码行数:32,


示例9: alarmtimer_enqueue

/** * alarmtimer_enqueue - Adds an alarm timer to an alarm_base timerqueue * @base: pointer to the base where the timer is being run * @alarm: pointer to alarm being enqueued. * * Adds alarm to a alarm_base timerqueue and if necessary sets * an hrtimer to run. * * Must hold base->lock when calling. */static void alarmtimer_enqueue(struct alarm_base *base, struct alarm *alarm){	timerqueue_add(&base->timerqueue, &alarm->node);	if (&alarm->node == timerqueue_getnext(&base->timerqueue)) {		hrtimer_try_to_cancel(&base->timer);		hrtimer_start(&base->timer, alarm->node.expires,				HRTIMER_MODE_ABS);	}}
开发者ID:303750856,项目名称:linux-3.1,代码行数:19,


示例10: hrtimer_force_reprogram

/* * Reprogram the event source with checking both queues for the * next event * Called with interrupts disabled and base->lock held */static voidhrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base, int skip_equal){	int i;	struct hrtimer_clock_base *base = cpu_base->clock_base;	ktime_t expires, expires_next;	expires_next.tv64 = KTIME_MAX;	for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++, base++) {		struct hrtimer *timer;		struct timerqueue_node *next;		next = timerqueue_getnext(&base->active);		if (!next)			continue;		timer = container_of(next, struct hrtimer, node);		expires = ktime_sub(hrtimer_get_expires(timer), base->offset);		/*		 * clock_was_set() has changed base->offset so the		 * result might be negative. Fix it up to prevent a		 * false positive in clockevents_program_event()		 */		if (expires.tv64 < 0)			expires.tv64 = 0;		if (expires.tv64 < expires_next.tv64)			expires_next = expires;	}	if (skip_equal && expires_next.tv64 == cpu_base->expires_next.tv64)		return;	cpu_base->expires_next.tv64 = expires_next.tv64;	/*	 * If a hang was detected in the last timer interrupt then we	 * leave the hang delay active in the hardware. We want the	 * system to make progress. That also prevents the following	 * scenario:	 * T1 expires 50ms from now	 * T2 expires 5s from now	 *	 * T1 is removed, so this code is called and would reprogram	 * the hardware to 5s from now. Any hrtimer_start after that	 * will not reprogram the hardware due to hang_detected being	 * set. So we'd effectivly block all timers until the T2 event	 * fires.	 */	if (cpu_base->hang_detected)		return;	if (cpu_base->expires_next.tv64 != KTIME_MAX)		tick_program_event(cpu_base->expires_next, 1);}
开发者ID:RolanDroid,项目名称:lge_MonsterKernel-lproj,代码行数:60,


示例11: alarmtimer_suspend

/** * alarmtimer_suspend - Suspend time callback * @dev: unused * @state: unused * * When we are going into suspend, we look through the bases * to see which is the soonest timer to expire. We then * set an rtc timer to fire that far into the future, which * will wake us from suspend. */static int alarmtimer_suspend(struct device *dev){	struct rtc_time tm;	ktime_t min, now;	unsigned long flags;	struct rtc_device *rtc;	int i;	spin_lock_irqsave(&freezer_delta_lock, flags);	min = freezer_delta;	freezer_delta = ktime_set(0, 0);	spin_unlock_irqrestore(&freezer_delta_lock, flags);	rtc = rtcdev;	/* If we have no rtcdev, just return */	if (!rtc)		return 0;	/* Find the soonest timer to expire*/	for (i = 0; i < ALARM_NUMTYPE; i++) {		struct alarm_base *base = &alarm_bases[i];		struct timerqueue_node *next;		ktime_t delta;		spin_lock_irqsave(&base->lock, flags);		next = timerqueue_getnext(&base->timerqueue);		spin_unlock_irqrestore(&base->lock, flags);		if (!next)			continue;		delta = ktime_sub(next->expires, base->gettime());		if (!min.tv64 || (delta.tv64 < min.tv64))			min = delta;	}	if (min.tv64 == 0)		return 0;	/* XXX - Should we enforce a minimum sleep time? */	WARN_ON(min.tv64 < NSEC_PER_SEC);	/* Setup an rtc timer to fire that far in the future */	rtc_timer_cancel(rtc, &rtctimer);	rtc_read_time(rtc, &tm);	now = rtc_tm_to_ktime(tm);	now = ktime_add(now, min);	rtc_timer_start(rtc, &rtctimer, now, ktime_set(0, 0));	return 0;}
开发者ID:303750856,项目名称:linux-3.1,代码行数:59,


示例12: alarmtimer_fired

/** * alarmtimer_fired - Handles alarm hrtimer being fired. * @timer: pointer to hrtimer being run * * When a alarm timer fires, this runs through the timerqueue to * see which alarms expired, and runs those. If there are more alarm * timers queued for the future, we set the hrtimer to fire when * when the next future alarm timer expires. */static enum hrtimer_restart alarmtimer_fired(struct hrtimer *timer){	struct alarm_base *base = container_of(timer, struct alarm_base, timer);	struct timerqueue_node *next;	unsigned long flags;	ktime_t now;	int ret = HRTIMER_NORESTART;	spin_lock_irqsave(&base->lock, flags);	now = base->gettime();	while ((next = timerqueue_getnext(&base->timerqueue))) {		struct alarm *alarm;		ktime_t expired = next->expires;		if (expired.tv64 >= now.tv64)			break;		alarm = container_of(next, struct alarm, node);		timerqueue_del(&base->timerqueue, &alarm->node);		alarm->enabled = 0;		/* Re-add periodic timers */		if (alarm->period.tv64) {			alarm->node.expires = ktime_add(expired, alarm->period);			timerqueue_add(&base->timerqueue, &alarm->node);			alarm->enabled = 1;		}		spin_unlock_irqrestore(&base->lock, flags);		if (alarm->function)			alarm->function(alarm);		spin_lock_irqsave(&base->lock, flags);	}	if (next) {		hrtimer_set_expires(&base->timer, next->expires);		ret = HRTIMER_RESTART;	}	spin_unlock_irqrestore(&base->lock, flags);	return ret;}
开发者ID:303750856,项目名称:linux-3.1,代码行数:51,


示例13: rtc_timer_enqueue

/** * rtc_timer_enqueue - Adds a rtc_timer to the rtc_device timerqueue * @rtc rtc device * @timer timer being added. * * Enqueues a timer onto the rtc devices timerqueue and sets * the next alarm event appropriately. * * Sets the enabled bit on the added timer. * * Must hold ops_lock for proper serialization of timerqueue */static int rtc_timer_enqueue(struct rtc_device *rtc, struct rtc_timer *timer){	struct timerqueue_node *next = timerqueue_getnext(&rtc->timerqueue);	struct rtc_time tm;	ktime_t now;	timer->enabled = 1;	__rtc_read_time(rtc, &tm);	now = rtc_tm_to_ktime(tm);	/* Skip over expired timers */	while (next) {		if (next->expires >= now)			break;		next = timerqueue_iterate_next(next);	}	timerqueue_add(&rtc->timerqueue, &timer->node);	trace_rtc_timer_enqueue(timer);	if (!next || ktime_before(timer->node.expires, next->expires)) {		struct rtc_wkalrm alarm;		int err;		alarm.time = rtc_ktime_to_tm(timer->node.expires);		alarm.enabled = 1;		err = __rtc_set_alarm(rtc, &alarm);		if (err == -ETIME) {			pm_stay_awake(rtc->dev.parent);			schedule_work(&rtc->irqwork);		} else if (err) {			timerqueue_del(&rtc->timerqueue, &timer->node);			trace_rtc_timer_dequeue(timer);			timer->enabled = 0;			return err;		}	}	return 0;}
开发者ID:avagin,项目名称:linux,代码行数:50,


示例14: hrtimer_force_reprogram

/* * Reprogram the event source with checking both queues for the * next event * Called with interrupts disabled and base->lock held */static voidhrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base, int skip_equal){	int i;	struct hrtimer_clock_base *base = cpu_base->clock_base;	ktime_t expires, expires_next;	expires_next.tv64 = KTIME_MAX;	for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++, base++) {		struct hrtimer *timer;		struct timerqueue_node *next;		next = timerqueue_getnext(&base->active);		if (!next)			continue;		timer = container_of(next, struct hrtimer, node);		expires = ktime_sub(hrtimer_get_expires(timer), base->offset);		/*		 * clock_was_set() has changed base->offset so the		 * result might be negative. Fix it up to prevent a		 * false positive in clockevents_program_event()		 */		if (expires.tv64 < 0)			expires.tv64 = 0;		if (expires.tv64 < expires_next.tv64)			expires_next = expires;	}	if (skip_equal && expires_next.tv64 == cpu_base->expires_next.tv64)		return;	cpu_base->expires_next.tv64 = expires_next.tv64;	if (cpu_base->expires_next.tv64 != KTIME_MAX)		tick_program_event(cpu_base->expires_next, 1);}
开发者ID:urris,项目名称:android_kernel_casio_ca201l,代码行数:43,


示例15: __hrtimer_run_queues

static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now){	struct hrtimer_clock_base *base = cpu_base->clock_base;	unsigned int active = cpu_base->active_bases;	for (; active; base++, active >>= 1) {		struct timerqueue_node *node;		ktime_t basenow;		if (!(active & 0x01))			continue;		basenow = ktime_add(now, base->offset);		while ((node = timerqueue_getnext(&base->active))) {			struct hrtimer *timer;			timer = container_of(node, struct hrtimer, node);			/*			 * The immediate goal for using the softexpires is			 * minimizing wakeups, not running timers at the			 * earliest interrupt after their soft expiration.			 * This allows us to avoid using a Priority Search			 * Tree, which can answer a stabbing querry for			 * overlapping intervals and instead use the simple			 * BST we already have.			 * We don't add extra wakeups by delaying timers that			 * are right-of a not yet expired timer, because that			 * timer will have to trigger a wakeup anyway.			 */			if (basenow.tv64 < hrtimer_get_softexpires_tv64(timer))				break;			__run_hrtimer(cpu_base, base, timer, &basenow);		}	}}
开发者ID:AK101111,项目名称:linux,代码行数:38,


示例16: hrtimer_interrupt

/* * High resolution timer interrupt * Called with interrupts disabled */void hrtimer_interrupt(struct clock_event_device *dev){	struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases);	ktime_t expires_next, now, entry_time, delta;	int i, retries = 0;	BUG_ON(!cpu_base->hres_active);	cpu_base->nr_events++;	dev->next_event.tv64 = KTIME_MAX;	raw_spin_lock(&cpu_base->lock);	entry_time = now = hrtimer_update_base(cpu_base);retry:	expires_next.tv64 = KTIME_MAX;	/*	 * We set expires_next to KTIME_MAX here with cpu_base->lock	 * held to prevent that a timer is enqueued in our queue via	 * the migration code. This does not affect enqueueing of	 * timers which run their callback and need to be requeued on	 * this CPU.	 */	cpu_base->expires_next.tv64 = KTIME_MAX;	for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {		struct hrtimer_clock_base *base;		struct timerqueue_node *node;		ktime_t basenow;		if (!(cpu_base->active_bases & (1 << i)))			continue;		base = cpu_base->clock_base + i;		basenow = ktime_add(now, base->offset);		while ((node = timerqueue_getnext(&base->active))) {			struct hrtimer *timer;			timer = container_of(node, struct hrtimer, node);			/*			 * The immediate goal for using the softexpires is			 * minimizing wakeups, not running timers at the			 * earliest interrupt after their soft expiration.			 * This allows us to avoid using a Priority Search			 * Tree, which can answer a stabbing querry for			 * overlapping intervals and instead use the simple			 * BST we already have.			 * We don't add extra wakeups by delaying timers that			 * are right-of a not yet expired timer, because that			 * timer will have to trigger a wakeup anyway.			 */			if (basenow.tv64 < hrtimer_get_softexpires_tv64(timer)) {				ktime_t expires;				expires = ktime_sub(hrtimer_get_expires(timer),						    base->offset);				if (expires.tv64 < 0)					expires.tv64 = KTIME_MAX;				if (expires.tv64 < expires_next.tv64)					expires_next = expires;				break;			}			__run_hrtimer(timer, &basenow);		}	}	/*	 * Store the new expiry value so the migration code can verify	 * against it.	 */	cpu_base->expires_next = expires_next;	raw_spin_unlock(&cpu_base->lock);	/* Reprogramming necessary ? */	if (expires_next.tv64 == KTIME_MAX ||	    !tick_program_event(expires_next, 0)) {		cpu_base->hang_detected = 0;		return;	}	/*	 * The next timer was already expired due to:	 * - tracing	 * - long lasting callbacks	 * - being scheduled away when running in a VM	 *	 * We need to prevent that we loop forever in the hrtimer	 * interrupt routine. We give it 3 attempts to avoid	 * overreacting on some spurious event.	 *	 * Acquire base lock for updating the offsets and retrieving	 * the current time.	 */	raw_spin_lock(&cpu_base->lock);//.........这里部分代码省略.........
开发者ID:RolanDroid,项目名称:lge_MonsterKernel-lproj,代码行数:101,


示例17: rtc_timer_do_work

/** * rtc_timer_do_work - Expires rtc timers * @rtc rtc device * @timer timer being removed. * * Expires rtc timers. Reprograms next alarm event if needed. * Called via worktask. * * Serializes access to timerqueue via ops_lock mutex */void rtc_timer_do_work(struct work_struct *work){	struct rtc_timer *timer;	struct timerqueue_node *next;	ktime_t now;	struct rtc_time tm;	struct rtc_device *rtc =		container_of(work, struct rtc_device, irqwork);	mutex_lock(&rtc->ops_lock);again:	__rtc_read_time(rtc, &tm);	now = rtc_tm_to_ktime(tm);	while ((next = timerqueue_getnext(&rtc->timerqueue))) {		if (next->expires > now)			break;		/* expire timer */		timer = container_of(next, struct rtc_timer, node);		timerqueue_del(&rtc->timerqueue, &timer->node);		trace_rtc_timer_dequeue(timer);		timer->enabled = 0;		if (timer->func)			timer->func(timer->rtc);		trace_rtc_timer_fired(timer);		/* Re-add/fwd periodic timers */		if (ktime_to_ns(timer->period)) {			timer->node.expires = ktime_add(timer->node.expires,							timer->period);			timer->enabled = 1;			timerqueue_add(&rtc->timerqueue, &timer->node);			trace_rtc_timer_enqueue(timer);		}	}	/* Set next alarm */	if (next) {		struct rtc_wkalrm alarm;		int err;		int retry = 3;		alarm.time = rtc_ktime_to_tm(next->expires);		alarm.enabled = 1;reprogram:		err = __rtc_set_alarm(rtc, &alarm);		if (err == -ETIME) {			goto again;		} else if (err) {			if (retry-- > 0)				goto reprogram;			timer = container_of(next, struct rtc_timer, node);			timerqueue_del(&rtc->timerqueue, &timer->node);			trace_rtc_timer_dequeue(timer);			timer->enabled = 0;			dev_err(&rtc->dev, "__rtc_set_alarm: err=%d/n", err);			goto again;		}	} else {
开发者ID:avagin,项目名称:linux,代码行数:71,



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


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