Revision 74475455 hw/usb-ohci.c

b/hw/usb-ohci.c
1101 1101
/* Generate a SOF event, and set a timer for EOF */
1102 1102
static void ohci_sof(OHCIState *ohci)
1103 1103
{
1104
    ohci->sof_time = qemu_get_clock(vm_clock);
1104
    ohci->sof_time = qemu_get_clock_ns(vm_clock);
1105 1105
    qemu_mod_timer(ohci->eof_timer, ohci->sof_time + usb_frame_time);
1106 1106
    ohci_set_interrupt(ohci, OHCI_INTR_SF);
1107 1107
}
......
1186 1186
 */
1187 1187
static int ohci_bus_start(OHCIState *ohci)
1188 1188
{
1189
    ohci->eof_timer = qemu_new_timer(vm_clock,
1189
    ohci->eof_timer = qemu_new_timer_ns(vm_clock,
1190 1190
                    ohci_frame_boundary,
1191 1191
                    ohci);
1192 1192

  
1193 1193
    if (ohci->eof_timer == NULL) {
1194
        fprintf(stderr, "usb-ohci: %s: qemu_new_timer failed\n", ohci->name);
1194
        fprintf(stderr, "usb-ohci: %s: qemu_new_timer_ns failed\n", ohci->name);
1195 1195
        /* TODO: Signal unrecoverable error */
1196 1196
        return 0;
1197 1197
    }
......
1311 1311
    /* Being in USB operational state guarnatees sof_time was
1312 1312
     * set already.
1313 1313
     */
1314
    tks = qemu_get_clock(vm_clock) - ohci->sof_time;
1314
    tks = qemu_get_clock_ns(vm_clock) - ohci->sof_time;
1315 1315

  
1316 1316
    /* avoid muldiv if possible */
1317 1317
    if (tks >= usb_frame_time)

Also available in: Unified diff