nsis: Add missing qemu-nbd.exe
[qemu/ar7.git] / qemu-tool-time.c
blob01432a8d248f151e62c86a6fa93157cdb3e1975a
1 /*
2 * Copyright (c) 2010-2011 IBM
4 * Authors:
5 * Chunqiang Tang <ctang@us.ibm.com>
7 * This work is licensed under the terms of the GNU GPL, version 2.
8 * See the COPYING file in the top-level directory.
9 */
11 /*=============================================================================
12 * A short description: this module implements the qemu-tool functions that
13 * are related to time. In the simulation mode (see block/sim.c), these
14 * functions are implemented differently in qemu-test.c because they have to
15 * work with the simulation engine block/sim.c
16 *============================================================================*/
18 #include "qemu/osdep.h"
19 #include "qemu/timer.h"
20 #include "sysemu.h"
22 struct QEMUBH {
23 QEMUBHFunc *cb;
24 void *opaque;
27 #if 1
28 int64_t qemu_get_clock (QEMUClock * clock)
30 qemu_timeval tv;
31 qemu_gettimeofday (&tv);
32 return (tv.tv_sec * 1000000000LL + (tv.tv_usec * 1000)) / 1000000;
34 #endif
36 QEMUBH *qemu_bh_new (QEMUBHFunc * cb, void *opaque)
38 QEMUBH *bh;
40 bh = g_malloc(sizeof(*bh));
41 bh->cb = cb;
42 bh->opaque = opaque;
44 return bh;
47 int qemu_bh_poll (void)
49 return 0;
52 void qemu_bh_schedule (QEMUBH * bh)
54 bh->cb (bh->opaque);
57 void qemu_bh_cancel (QEMUBH * bh)
61 void qemu_bh_delete (QEMUBH * bh)
63 g_free(bh);
66 void timer_mod(QEMUTimer * ts, int64_t expire_time)
68 fprintf (stderr, "timer_mod() should not be invoked in qemu-tool\n");
69 exit (1);
72 QEMUTimer *qemu_new_timer (QEMUClock * clock, QEMUTimerCB * cb, void *opaque)
74 fprintf (stderr, "qemu_new_timer() should not be invoked in qemu-tool\n");
75 exit (1);
76 return NULL;
79 void timer_free(QEMUTimer * ts)
81 fprintf (stderr, "timer_free() should not be invoked in qemu-tool\n");
82 exit (1);
85 void timer_del(QEMUTimer * ts)
87 fprintf (stderr, "timer_del() should not be invoked in qemu-tool\n");
88 exit (1);