• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/src/linux/linux-2.6/arch/s390/kernel/

Lines Matching refs:timer

3  *    Virtual cpu timer based timer functions.
24 #include <asm/timer.h>
38 __u64 timer, clock;
41 timer = S390_lowcore.last_update_timer;
43 asm volatile (" STPT %0\n" /* Store current cpu timer value */
47 S390_lowcore.system_timer += timer - S390_lowcore.last_update_timer;
82 __u64 timer;
84 timer = S390_lowcore.last_update_timer;
85 asm volatile (" STPT %0" /* Store current cpu timer value */
87 S390_lowcore.system_timer += timer - S390_lowcore.last_update_timer;
107 __u64 timer;
109 timer = S390_lowcore.last_update_timer;
110 asm volatile (" STPT %0" /* Store current cpu timer value */
112 S390_lowcore.system_timer += timer - S390_lowcore.last_update_timer;
122 __u64 timer;
124 asm volatile (" STPT %0\n" /* Store current cpu timer value */
126 : "=m" (timer) : "m" (expires) );
127 S390_lowcore.system_timer += S390_lowcore.last_update_timer - timer;
130 /* store expire time for this CPU timer */
139 /* store expire time for this CPU timer */
150 /* CPU timer interrupt is pending, don't reprogramm it */
174 * If the CPU timer is negative we don't reprogramm
183 * We cannot halt the CPU timer, we just write a value that
185 * the stored expire value if we continue the timer
195 static void list_add_sorted(struct vtimer_list *timer, struct list_head *head)
200 if (event->expires > timer->expires) {
201 list_add_tail(&timer->entry, &event->entry);
205 list_add_tail(&timer->entry, head);
230 /* delete one shot timer */
233 /* move interval timer back to list */
243 * Handler for the virtual CPU timer.
257 /* walk timer list, fire all expired events */
268 /* re-charge interval timer, we have to add the offset */
272 /* move expired timer to the callback queue */
300 void init_virt_timer(struct vtimer_list *timer)
302 timer->function = NULL;
303 INIT_LIST_HEAD(&timer->entry);
304 spin_lock_init(&timer->lock);
308 static inline int vtimer_pending(struct vtimer_list *timer)
310 return (!list_empty(&timer->entry));
316 static void internal_add_vtimer(struct vtimer_list *timer)
323 vt_list = &per_cpu(virt_cpu_timer, timer->cpu);
326 if (timer->cpu != smp_processor_id())
329 /* if list is empty we only have to set the timer */
331 /* reset the offset, this may happen if the last timer was
350 list_add_sorted(timer, &vt_list->list);
361 static inline int prepare_vtimer(struct vtimer_list *timer)
363 if (!timer->function) {
364 printk("add_virt_timer: uninitialized timer\n");
368 if (!timer->expires || timer->expires > VTIMER_MAX_SLICE) {
369 printk("add_virt_timer: invalid timer expire value!\n");
373 if (vtimer_pending(timer)) {
374 printk("add_virt_timer: timer pending\n");
378 timer->cpu = get_cpu();
383 * add_virt_timer - add an oneshot virtual CPU timer
387 struct vtimer_list *timer;
389 timer = (struct vtimer_list *)new;
391 if (prepare_vtimer(timer) < 0)
394 timer->interval = 0;
395 internal_add_vtimer(timer);
400 * add_virt_timer_int - add an interval virtual CPU timer
404 struct vtimer_list *timer;
406 timer = (struct vtimer_list *)new;
408 if (prepare_vtimer(timer) < 0)
411 timer->interval = timer->expires;
412 internal_add_vtimer(timer);
417 * If we change a pending timer the function must be called on the CPU
418 * where the timer is running on, e.g. by smp_call_function_on()
420 * The original mod_timer adds the timer if it is not pending. For compatibility
421 * we do the same. The timer will be added on the current CPU as a oneshot timer.
423 * returns whether it has modified a pending timer (1) or not (0)
425 int mod_virt_timer(struct vtimer_list *timer, __u64 expires)
431 if (!timer->function) {
432 printk("mod_virt_timer: uninitialized timer\n");
443 * networking code - if the timer is re-modified
446 if (timer->expires == expires && vtimer_pending(timer))
452 /* disable interrupts before test if timer is pending */
455 /* if timer isn't pending add it on the current CPU */
456 if (!vtimer_pending(timer)) {
458 /* we do not activate an interval timer with mod_virt_timer */
459 timer->interval = 0;
460 timer->expires = expires;
461 timer->cpu = cpu;
462 internal_add_vtimer(timer);
467 if (timer->cpu != cpu) {
474 list_del_init(&timer->entry);
475 timer->expires = expires;
477 /* also change the interval if we have an interval timer */
478 if (timer->interval)
479 timer->interval = expires;
481 /* the timer can't expire anymore so we can release the lock */
483 internal_add_vtimer(timer);
489 * delete a virtual timer
491 * returns whether the deleted timer was pending (1) or not (0)
493 int del_virt_timer(struct vtimer_list *timer)
498 /* check if timer is pending */
499 if (!vtimer_pending(timer))
502 vt_list = &per_cpu(virt_cpu_timer, timer->cpu);
505 /* we don't interrupt a running timer, just let it expire! */
506 list_del_init(&timer->entry);
508 /* last timer removed */
520 * Start the virtual CPU timer on the current CPU.
526 /* kick the virtual timer */
532 /* enable cpu timer interrupts */
564 /* request the cpu timer external interrupt */
572 /* Enable cpu timer interrupts on the boot cpu. */