Lines Matching refs:hpet_events

45 static struct hpet_event_channel *__read_mostly hpet_events;  variable
402 hpet_events = xzalloc_array(struct hpet_event_channel, num_chs); in hpet_fsb_cap_lookup()
403 if ( !hpet_events ) in hpet_fsb_cap_lookup()
408 struct hpet_event_channel *ch = &hpet_events[num_hpets_used]; in hpet_fsb_cap_lookup()
419 xfree(hpet_events); in hpet_fsb_cap_lookup()
420 hpet_events = NULL; in hpet_fsb_cap_lookup()
443 return hpet_events; in hpet_get_channel()
446 return &hpet_events[cpu]; in hpet_get_channel()
457 ch = &hpet_events[i % num_hpets_used]; in hpet_get_channel()
466 ch = &hpet_events[next]; in hpet_get_channel()
575 if ( !hpet_events ) in hpet_broadcast_init()
576 hpet_events = xzalloc(struct hpet_event_channel); in hpet_broadcast_init()
577 if ( !hpet_events || !zalloc_cpumask_var(&hpet_events->cpumask) ) in hpet_broadcast_init()
579 hpet_events->msi.irq = -1; in hpet_broadcast_init()
606 hpet_events[i].mult = div_sc((unsigned long)hpet_rate, in hpet_broadcast_init()
608 hpet_events[i].shift = 32; in hpet_broadcast_init()
609 hpet_events[i].next_event = STIME_MAX; in hpet_broadcast_init()
610 spin_lock_init(&hpet_events[i].lock); in hpet_broadcast_init()
612 hpet_events[i].event_handler = handle_hpet_broadcast; in hpet_broadcast_init()
614 hpet_events[i].msi.msi_attrib.maskbit = 1; in hpet_broadcast_init()
615 hpet_events[i].msi.msi_attrib.pos = MSI_TYPE_HPET; in hpet_broadcast_init()
619 hpet_events->flags = HPET_EVT_LEGACY; in hpet_broadcast_init()
627 if ( !hpet_events ) in hpet_broadcast_resume()
640 else if ( hpet_events->flags & HPET_EVT_DISABLE ) in hpet_broadcast_resume()
653 if ( hpet_events[i].msi.irq >= 0 ) in hpet_broadcast_resume()
654 __hpet_setup_msi_irq(irq_to_desc(hpet_events[i].msi.irq)); in hpet_broadcast_resume()
657 cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx)); in hpet_broadcast_resume()
660 if ( !(hpet_events[i].flags & HPET_EVT_LEGACY) ) in hpet_broadcast_resume()
662 hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx)); in hpet_broadcast_resume()
664 hpet_events[i].next_event = STIME_MAX; in hpet_broadcast_resume()
673 if ( !hpet_events || !(hpet_events->flags & HPET_EVT_LEGACY) ) in hpet_disable_legacy_broadcast()
676 spin_lock_irqsave(&hpet_events->lock, flags); in hpet_disable_legacy_broadcast()
678 hpet_events->flags |= HPET_EVT_DISABLE; in hpet_disable_legacy_broadcast()
690 spin_unlock_irqrestore(&hpet_events->lock, flags); in hpet_disable_legacy_broadcast()
751 return ((hpet_events && (hpet_events->flags & HPET_EVT_LEGACY)) in hpet_broadcast_is_available()
759 if ( !hpet_events || in hpet_legacy_irq_tick()
760 (hpet_events->flags & (HPET_EVT_DISABLE|HPET_EVT_LEGACY)) != in hpet_legacy_irq_tick()
763 hpet_events->event_handler(hpet_events); in hpet_legacy_irq_tick()