Re: [Qemu-devel] [PATCH v4 5/7] RTC:Add RTC update-ended interrupt support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +/* handle update-ended timer */
> +static void check_update_timer(RTCState *s)
> +{
> +    uint64_t next_update_time, expire_time;
> +    uint64_t guest_usec;
> +    qemu_del_timer(s->update_timer);
> +    qemu_del_timer(s->update_timer2);
> +
> +    if (!((s->cmos_data[RTC_REG_C] & (REG_C_UF | REG_C_AF)) ==
> +            (REG_C_UF | REG_C_AF)) && !(s->cmos_data[RTC_REG_B] & REG_B_SET)) {
> +        s->use_timer = 1;
> +        guest_usec = get_guest_rtc_us(s) % USEC_PER_SEC;
> +        if (guest_usec >= (USEC_PER_SEC - 244)) {
> +            /* RTC is in update cycle when enabling UIE */
> +            s->cmos_data[RTC_REG_A] |= REG_A_UIP;
> +            next_update_time = (USEC_PER_SEC - guest_usec) * NS_PER_USEC;
> +            expire_time = qemu_get_clock_ns(rtc_clock) + next_update_time;
> +            qemu_mod_timer(s->update_timer2, expire_time);
> +        } else {
> +            next_update_time = (USEC_PER_SEC - guest_usec - 244) * NS_PER_USEC;
> +            expire_time = qemu_get_clock_ns(rtc_clock) + next_update_time;
> +            s->next_update_time = expire_time;
> +            qemu_mod_timer(s->update_timer, expire_time);
> +        }
> +    } else {
> +        s->use_timer = 0;
> +    }
> +}

This is the function that is used to figure out whether we need the
timers or not, the condition seems to be:

(Not (REG_C_UF | REG_C_AF)) And (Not (REG_B_SET))

Shouldn't actually check for UIE being enabled?
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux