summaryrefslogtreecommitdiffstats
path: root/qemu/replay/replay-time.c
blob: fffe072c555f641acb4795af890c8f72075b0d29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
 * replay-time.c
 *
 * Copyright (c) 2010-2015 Institute for System Programming
 *                         of the Russian Academy of Sciences.
 *
 * This work is licensed under the terms of the GNU GPL, version 2 or later.
 * See the COPYING file in the top-level directory.
 *
 */

#include "qemu/osdep.h"
#include "qemu-common.h"
#include "sysemu/replay.h"
#include "replay-internal.h"
#include "qemu/error-report.h"

int64_t replay_save_clock(ReplayClockKind kind, int64_t clock)
{
    replay_save_instructions();

    if (replay_file) {
        replay_mutex_lock();
        replay_put_event(EVENT_CLOCK + kind);
        replay_put_qword(clock);
        replay_mutex_unlock();
    }

    return clock;
}

void replay_read_next_clock(ReplayClockKind kind)
{
    unsigned int read_kind = replay_data_kind - EVENT_CLOCK;

    assert(read_kind == kind);

    int64_t clock = replay_get_qword();

    replay_check_error();
    replay_finish_event();

    replay_state.cached_clock[read_kind] = clock;
}

/*! Reads next clock event from the input. */
int64_t replay_read_clock(ReplayClockKind kind)
{
    replay_account_executed_instructions();

    if (replay_file) {
        int64_t ret;
        replay_mutex_lock();
        if (replay_next_event_is(EVENT_CLOCK + kind)) {
            replay_read_next_clock(kind);
        }
        ret = replay_state.cached_clock[kind];
        replay_mutex_unlock();

        return ret;
    }

    error_report("REPLAY INTERNAL ERROR %d", __LINE__);
    exit(1);
}
t Controller Driver (HCD) options below. Choose a USB 1.1 controller, such as "UHCI HCD support" or "OHCI HCD support", and "EHCI HCD (USB 2.0) support" except for older systems that do not have USB 2.0 support. It doesn't normally hurt to select them all if you are not certain. If your system has a device-side USB port, used in the peripheral side of the USB protocol, see the "USB Gadget" framework instead. After choosing your HCD, then select drivers for the USB peripherals you'll be using. You may want to check out the information provided in <file:Documentation/usb/> and especially the links given in <file:Documentation/usb/usb-help.txt>. To compile this driver as a module, choose M here: the module will be called usbcore. if USB source "drivers/usb/core/Kconfig" source "drivers/usb/mon/Kconfig" source "drivers/usb/wusbcore/Kconfig" source "drivers/usb/host/Kconfig" source "drivers/usb/renesas_usbhs/Kconfig" source "drivers/usb/class/Kconfig" source "drivers/usb/storage/Kconfig" source "drivers/usb/image/Kconfig" source "drivers/usb/usbip/Kconfig" endif source "drivers/usb/musb/Kconfig" source "drivers/usb/dwc3/Kconfig" source "drivers/usb/dwc2/Kconfig" source "drivers/usb/chipidea/Kconfig" source "drivers/usb/isp1760/Kconfig" comment "USB port drivers" if USB config USB_USS720 tristate "USS720 parport driver" depends on PARPORT select PARPORT_NOT_PC ---help--- This driver is for USB parallel port adapters that use the Lucent Technologies USS-720 chip. These cables are plugged into your USB port and provide USB compatibility to peripherals designed with parallel port interfaces. The chip has two modes: automatic mode and manual mode. In automatic mode, it looks to the computer like a standard USB printer. Only printers may be connected to the USS-720 in this mode. The generic USB printer driver ("USB Printer support", above) may be used in that mode, and you can say N here if you want to use the chip only in this mode. Manual mode is not limited to printers, any parallel port device should work. This driver utilizes manual mode. Note however that some operations are three orders of magnitude slower than on a PCI/ISA Parallel Port, so timing critical applications might not work. Say Y here if you own an USS-720 USB->Parport cable and intend to connect anything other than a printer to it. To compile this driver as a module, choose M here: the module will be called uss720. source "drivers/usb/serial/Kconfig" source "drivers/usb/misc/Kconfig" source "drivers/usb/atm/Kconfig" endif # USB source "drivers/usb/phy/Kconfig" source "drivers/usb/gadget/Kconfig" config USB_LED_TRIG bool "USB LED Triggers" depends on LEDS_CLASS && USB_COMMON && LEDS_TRIGGERS help This option adds LED triggers for USB host and/or gadget activity. Say Y here if you are working on a system with led-class supported LEDs and you want to use them as activity indicators for USB host or gadget. endif # USB_SUPPORT